What is an Agent?

Core Concepts

Definition

Key Characteristics

Types of Agents

1. Chat-Based Agents

interface ChatAgent {
  context: ConversationContext;
  memory: MessageHistory[];

  async chat(message: string): Promise<string> {
    const response = await this.llm.chat([
      ...this.memory,
      { role: 'user', content: message }
    ]);

    if (this.shouldUseTool(response)) {
      const result = await this.executeTool(response);
      return this.synthesizeResponse(result);
    }

    return response;
  }
}

2. Task-Based Agents