Introduction to Agents
AI agents go beyond simple prompt-response interactions. They can reason about problems, use tools to gather information, and take autonomous actions to accomplish goals. In this lesson, you will learn what makes an agent different from a basic LLM call and how CoFounder structures agent behavior.
What Is an AI Agent?
A simple LLM call takes a prompt, generates a response, and stops. An AI agent, on the other hand, operates in a loop. It observes its environment, thinks about what to do next, and acts by invoking tools or producing output. This loop continues until the agent determines its task is complete.
In practical terms, agents can search the web, query databases, run code, call APIs, and combine the results before answering. They maintain state across multiple steps and can recover from errors mid-task.
The Observe-Think-Act Cycle
Every CoFounder agent follows a three-phase cycle:
- Observe -- The agent receives input from the user or from tool results. It reads conversation history and any new context.
- Think -- The LLM reasons about the current state, decides which tools to call (if any), and plans its next move.
- Act -- The agent executes tool calls, appends results to its context, and either loops back to observe or returns a final response.
This cycle repeats until the agent produces a final answer or hits a configured step limit.
Agents vs. Simple LLM Calls
Here is a basic LLM call using CoFounder -- it sends a message and gets a single response:
import { createLLMClient } from '@waymakerai/aicofounder-core';
const client = createLLMClient({ provider: 'openai' });
const response = await client.chat({
messages: [{ role: 'user', content: 'What is React?' }],
});
console.log(response.content);Compare that with creating an agent that can use tools and loop autonomously:
import { createAgent } from '@waymakerai/aicofounder-core';
const agent = createAgent({
name: 'research-assistant',
model: 'gpt-4o',
systemPrompt: 'You are a helpful research assistant.',
tools: [searchTool, summarizeTool],
maxSteps: 10,
});
const result = await agent.run('Find the latest React 19 features and summarize them.');
console.log(result.output);The agent automatically decides when to search, when to summarize, and when it has enough information to respond.
CoFounder Agent Architecture
CoFounder provides a layered architecture for building agents:
- Core layer (
@waymakerai/aicofounder-core) -- The LLM client, agent runtime, tool registry, and memory management. - React layer (
@waymakerai/aicofounder-react) -- Hooks likeuseAgentanduseChatthat connect agents to your UI. - CLI layer (
@waymakerai/aicofounder-cli) -- Scaffolding commands to generate agent boilerplate and test harnesses.
Throughout this course, you will work primarily with the core layer to understand agent fundamentals before connecting agents to a React frontend.
What You Will Build
Over the next 12 lessons, you will progress from configuring a basic agent to building full-featured research and code assistant agents. By the end, you will understand tool design, memory management, orchestration, error handling, testing, and production best practices.