From 5ec129f9d7236b5d6cd2e7d3bc517988700b2676 Mon Sep 17 00:00:00 2001 From: MervinPraison Date: Tue, 11 Mar 2025 04:58:56 +0000 Subject: [PATCH] Add course documentation for AI Agents - Created a comprehensive course on AI Agents covering 20 lessons - Included documentation for course topics like agent architecture, tools, memory, multi-agent systems, and deployment - Added structured MDX files for each lesson with code examples, explanations, and best practices - Updated `mint.json` to include new course navigation and pages - Provided a step-by-step learning path for understanding and building AI agents --- docs/course/agents/01-introduction.mdx | 59 +++ docs/course/agents/02-types-of-agents.mdx | 113 ++++++ docs/course/agents/03-agent-architecture.mdx | 157 ++++++++ docs/course/agents/04-agent-instructions.mdx | 187 ++++++++++ docs/course/agents/05-agent-tools.mdx | 183 ++++++++++ docs/course/agents/06-agent-memory.mdx | 167 +++++++++ docs/course/agents/07-multi-agent-systems.mdx | 171 +++++++++ docs/course/agents/08-agent-process.mdx | 152 ++++++++ docs/course/agents/09-knowledge-bases.mdx | 190 ++++++++++ docs/course/agents/10-agent-tasks.mdx | 274 ++++++++++++++ .../agents/11-creating-your-first-agent.mdx | 172 +++++++++ .../agents/12-adding-tools-to-agents.mdx | 275 ++++++++++++++ .../agents/13-building-multi-agent-system.mdx | 218 +++++++++++ .../agents/14-conversational-agents.mdx | 193 ++++++++++ docs/course/agents/15-research-agents.mdx | 216 +++++++++++ .../agents/16-content-creation-agents.mdx | 252 +++++++++++++ .../course/agents/17-data-analysis-agents.mdx | 333 +++++++++++++++++ .../agents/18-customer-support-agents.mdx | 260 +++++++++++++ .../agents/19-personal-assistant-agents.mdx | 270 ++++++++++++++ docs/course/agents/20-deploying-agents.mdx | 342 ++++++++++++++++++ docs/mint.json | 29 ++ 21 files changed, 4213 insertions(+) create mode 100644 docs/course/agents/01-introduction.mdx create mode 100644 docs/course/agents/02-types-of-agents.mdx create mode 100644 docs/course/agents/03-agent-architecture.mdx create mode 100644 docs/course/agents/04-agent-instructions.mdx create mode 100644 docs/course/agents/05-agent-tools.mdx create mode 100644 docs/course/agents/06-agent-memory.mdx create mode 100644 docs/course/agents/07-multi-agent-systems.mdx create mode 100644 docs/course/agents/08-agent-process.mdx create mode 100644 docs/course/agents/09-knowledge-bases.mdx create mode 100644 docs/course/agents/10-agent-tasks.mdx create mode 100644 docs/course/agents/11-creating-your-first-agent.mdx create mode 100644 docs/course/agents/12-adding-tools-to-agents.mdx create mode 100644 docs/course/agents/13-building-multi-agent-system.mdx create mode 100644 docs/course/agents/14-conversational-agents.mdx create mode 100644 docs/course/agents/15-research-agents.mdx create mode 100644 docs/course/agents/16-content-creation-agents.mdx create mode 100644 docs/course/agents/17-data-analysis-agents.mdx create mode 100644 docs/course/agents/18-customer-support-agents.mdx create mode 100644 docs/course/agents/19-personal-assistant-agents.mdx create mode 100644 docs/course/agents/20-deploying-agents.mdx diff --git a/docs/course/agents/01-introduction.mdx b/docs/course/agents/01-introduction.mdx new file mode 100644 index 0000000..f02853b --- /dev/null +++ b/docs/course/agents/01-introduction.mdx @@ -0,0 +1,59 @@ +--- +title: "Introduction to AI Agents" +description: "Welcome to the beginner's course on AI Agents" +icon: "book-open" +--- + +# Introduction to AI Agents + +Welcome to the beginners' course on AI Agents! This course is designed to help you understand and build your own AI agents, even if you have little to no programming experience. + +## What Are AI Agents? + +An AI agent is a software program that can: +- Understand information from its environment +- Make decisions based on that information +- Take actions to achieve specific goals + +Think of an AI agent like a helpful assistant that can perform tasks for you automatically. + +```mermaid +graph TD + A[Perceive Information] --> B[Make Decisions] + B --> C[Take Actions] + C --> A +``` + +## Examples in Daily Life + +You might already be using AI agents without realizing it: + +- **Virtual Assistants**: Siri, Alexa, and Google Assistant are AI agents that respond to your voice commands +- **Recommendation Systems**: Netflix, YouTube, and Amazon use AI agents to suggest content you might like +- **Smart Home Devices**: Devices that adjust temperature or lighting based on your preferences + +## What You'll Learn in This Course + +Throughout this course, you will: + +1. Understand the basic concepts of AI agents +2. Learn about different types of AI agents +3. Explore how AI agents make decisions +4. Discover how to build simple AI agents without complex programming +5. Create your own functional AI agents + +## Who This Course Is For + +This course is perfect for: +- Complete beginners with no prior knowledge of AI +- Non-technical professionals interested in how AI can solve problems +- Students curious about artificial intelligence +- Anyone who wants to understand and use AI agents in practical ways + +Let's begin our journey into the fascinating world of AI agents! + + + + Continue to the next lesson to learn about the different types of AI agents. + + diff --git a/docs/course/agents/02-types-of-agents.mdx b/docs/course/agents/02-types-of-agents.mdx new file mode 100644 index 0000000..03e898f --- /dev/null +++ b/docs/course/agents/02-types-of-agents.mdx @@ -0,0 +1,113 @@ +--- +title: "Types of AI Agents" +description: "Understanding the different categories of AI agents" +icon: "sitemap" +--- + +# Types of AI Agents + +AI agents come in different forms, each designed for specific purposes and with varying levels of complexity. Understanding these types will help you choose the right approach for your needs. + +## Simple Reflex Agents + +These are the most basic type of AI agents that operate using simple if-then rules. + + + + - React directly to current input only + - No memory of past events + - No prediction of future states + - Use predefined rules to determine actions + + + +**Real-world example**: A basic thermostat that turns heating on when temperature drops below a set point. + +```mermaid +graph LR + A[Sensor Input] --> B{If-Then Rules} + B --> C[Action] +``` + +## Model-Based Agents + +These agents maintain an internal model of their environment to make better decisions. + + + + - Build and maintain an internal representation of the world + - Can work with partial information + - Can consider "what if" scenarios + - Make decisions based on their understanding of how the world works + + + +**Real-world example**: A GPS navigation system that models roads and traffic conditions. + +## Goal-Based Agents + +These agents make decisions based on how their actions will help achieve specific goals. + + + + - Consider future consequences of actions + - Evaluate which actions will lead toward goals + - Can plan sequences of actions + - Choose actions that maximize goal attainment + + + +**Real-world example**: A chess-playing AI that plans moves to achieve checkmate. + +## Utility-Based Agents + +These agents choose actions that maximize a specific utility (or happiness) function. + + + + - Assign a utility value to different possible outcomes + - Consider probability and risk + - Choose actions that maximize expected utility + - Can balance competing objectives + + + +**Real-world example**: An investment robo-advisor that balances risk and return. + +## Learning Agents + +These agents improve their performance over time through experience. + + + + - Learn from past experiences + - Adapt to changing environments + - Improve decision-making over time + - Can discover new strategies + + + +**Real-world example**: Recommendation systems that learn your preferences over time. + +## Understanding Agent Complexity + + +As you move from Simple Reflex Agents toward Learning Agents, both capability and complexity increase. For beginners, starting with simpler agent types is often best. + + +## Which Agent Type Should You Build? + +The best type of agent for your project depends on: + +1. **The problem complexity**: Simple problems may only need reflex agents +2. **Available data**: Learning agents need training data +3. **Required adaptability**: Will your agent need to adapt to new situations? +4. **Available resources**: More complex agents require more computational power + +In this course, we'll focus primarily on goal-based and simple learning agents as they provide a good balance of capability and complexity for beginners. + + + + In the next lesson, we'll explore how agents process information and make decisions. + + diff --git a/docs/course/agents/03-agent-architecture.mdx b/docs/course/agents/03-agent-architecture.mdx new file mode 100644 index 0000000..a30aab9 --- /dev/null +++ b/docs/course/agents/03-agent-architecture.mdx @@ -0,0 +1,157 @@ +--- +title: "Agent Architecture" +description: "Understanding how AI agents are structured" +icon: "layer-group" +--- + +# Agent Architecture + +Understanding how AI agents are structured will help you build more effective agents. This lesson covers the fundamental components of an agent's architecture. + +## Basic Components of an AI Agent + +Every AI agent, regardless of complexity, has these basic components: + +```mermaid +graph TD + A[Sensors/Input] --> B[Processing Unit] + B --> C[Decision-Making] + C --> D[Actions/Output] +``` + +### 1. Input (Sensors) + +This is how agents receive information from their environment. + + + + - Text input from users + - Data from databases + - Image or audio input + - API responses + - Sensor readings (in physical agents) + + + +### 2. Processing Unit + +This component processes information and converts it into a format the agent can understand. + + + + - Data cleaning and transformation + - Feature extraction + - Context building + - Information retrieval + - Pattern recognition + + + +### 3. Decision-Making Core + +The "brain" of the agent that determines what actions to take. + + + + - Language models (like GPT-4) + - Rule systems + - Planning algorithms + - Knowledge base + - Memory systems + + + +### 4. Output (Actions) + +The actions the agent can perform to achieve its goals. + + + + - Generating text responses + - Creating visual content + - Making API calls + - Controlling other systems + - Updating databases + + + +## The Agent Loop + +Agents operate in a continuous loop: + +```mermaid +graph LR + A[Perceive] --> B[Process] + B --> C[Decide] + C --> D[Act] + D --> A +``` + +This cycle allows agents to continuously: +1. Gather information +2. Update their understanding +3. Make new decisions +4. Take appropriate actions + +## PraisonAI Agent Architecture + +In the PraisonAI framework, agents follow a specific architecture: + + + + - **Instructions**: Defines the agent's purpose and behavior + - **Language Model**: Powers the agent's intelligence (e.g., GPT-4) + - **Memory**: Stores context and previous interactions + - **Tools**: Specialized capabilities an agent can use + + + +### Simple Agent Structure + +```python +from praisonaiagents import Agent + +# Create a simple agent +research_agent = Agent( + instructions="Research the latest developments in renewable energy", + name="ResearchAgent" +) + +# Start the agent +research_agent.start() +``` + +## Understanding Agent Communication + +Multi-agent systems allow agents to communicate with each other: + +```mermaid +graph LR + A[Agent 1] --> B[Agent 2] + B --> C[Agent 3] + C --> A +``` + +Each agent can: +- Pass information to other agents +- Request assistance from specialized agents +- Collaborate on complex tasks + +## Key Takeaways + + + + Each component plays a vital role in the agent's functionality + + + You can customize each component based on your specific needs + + + A well-designed agent balances all components effectively + + + Agents can be improved by enhancing individual components + + + +In the next lesson, we'll explore how to define effective instructions for your AI agents. diff --git a/docs/course/agents/04-agent-instructions.mdx b/docs/course/agents/04-agent-instructions.mdx new file mode 100644 index 0000000..a196c45 --- /dev/null +++ b/docs/course/agents/04-agent-instructions.mdx @@ -0,0 +1,187 @@ +--- +title: "Creating Effective Agent Instructions" +description: "How to write clear instructions for your AI agents" +icon: "file-lines" +--- + +# Creating Effective Agent Instructions + +The instructions you give to your AI agent are crucial to its performance. Well-crafted instructions lead to agents that understand their purpose and execute tasks effectively. + +## Why Instructions Matter + +Instructions serve as the agent's "job description" and guide its behavior: + + + + Clear instructions reduce confusion and misinterpretation + + + Specific instructions keep the agent on task + + + Good instructions define what an agent should and shouldn't do + + + Instructions can shape how an agent communicates + + + +## Elements of Effective Instructions + +### 1. Role Definition + +Tell the agent who it is and what its expertise should be. + + +```text Good Example +You are a financial analyst with expertise in market trends and investment strategies. +``` + +```text Weak Example +You are a helper. +``` + + +### 2. Purpose and Goals + +Clearly state what the agent should accomplish. + + +```text Good Example +Your goal is to analyze company quarterly reports and provide actionable investment insights. +``` + +```text Weak Example +Help with finance stuff. +``` + + +### 3. Process Guidelines + +Explain how the agent should approach tasks. + + +```text Good Example +First analyze the data trends, then identify key risk factors, and finally make recommendations based on the client's risk tolerance. +``` + +```text Weak Example +Just do a good analysis. +``` + + +### 4. Response Format + +Specify how you want information presented. + + +```text Good Example +Present your analysis in a structured format with: Summary, Key Findings, Risk Assessment, and Recommendations. +``` + +```text Weak Example +Tell me what you find. +``` + + +## Instructions Template + +Here's a template you can use to create effective agent instructions: + +``` +You are a [ROLE] specializing in [EXPERTISE AREAS]. + +Your goal is to [MAIN OBJECTIVE]. + +When approaching tasks: +1. [FIRST STEP/APPROACH] +2. [SECOND STEP/APPROACH] +3. [THIRD STEP/APPROACH] + +Present your results in [FORMAT PREFERENCES]. + +Additional guidelines: +- [SPECIFIC BEHAVIOR 1] +- [SPECIFIC BEHAVIOR 2] +- [SPECIFIC BEHAVIOR 3] +``` + +## Examples in PraisonAI + +Let's look at how instructions are implemented in PraisonAI: + + +```python Simple Example +from praisonaiagents import Agent + +research_agent = Agent( + instructions="You are a research assistant specializing in climate science. Your goal is to find the latest research on rising sea levels and summarize key findings in bullet points." +) + +research_agent.start() +``` + +```python Detailed Example +from praisonaiagents import Agent + +content_agent = Agent( + name="ContentCreator", + instructions=""" + You are a content creation specialist with expertise in digital marketing. + + Your goal is to create engaging blog content that drives traffic and conversions. + + When creating content: + 1. Research the target keyword thoroughly + 2. Create an attention-grabbing headline + 3. Develop well-structured content with clear sections + 4. Include actionable takeaways for readers + + Present content in markdown format with proper headings, bullet points, and emphasis where appropriate. + + Additional guidelines: + - Maintain a conversational but professional tone + - Include 2-3 relevant statistics to support key points + - Add a call-to-action at the end of each piece + """ +) + +content_agent.start("Create a blog post about sustainable living tips") +``` + + +## Common Instruction Mistakes + + + + Vague instructions lead to unpredictable outputs + + + Too many details can confuse the agent's priorities + + + Conflicting instructions create confusion + + + Insufficient background information leads to generic outputs + + + +## Refining Your Instructions + + +Good instructions often require iteration. Start with basic instructions, review the agent's performance, and refine as needed. + + +Effective instruction improvement follows this cycle: + +```mermaid +graph TD + A[Write Initial Instructions] --> B[Test Agent Performance] + B --> C[Identify Issues/Gaps] + C --> D[Refine Instructions] + D --> B +``` + +In the next lesson, we'll explore how agents use tools to extend their capabilities. diff --git a/docs/course/agents/05-agent-tools.mdx b/docs/course/agents/05-agent-tools.mdx new file mode 100644 index 0000000..1627df4 --- /dev/null +++ b/docs/course/agents/05-agent-tools.mdx @@ -0,0 +1,183 @@ +--- +title: "Agent Tools" +description: "Understanding how tools extend agent capabilities" +icon: "screwdriver-wrench" +--- + +# Agent Tools + +Tools allow AI agents to interact with the world and perform specific actions. Think of tools as the "hands" of your agent that let it accomplish tasks beyond just generating text. + +## What Are Agent Tools? + + + + Tools are functions or capabilities that agents can access to perform specific actions, retrieve information, or interact with external systems. + + + +Just as humans use tools to extend their physical abilities, AI agents use digital tools to extend their capabilities. + +## Why Tools Matter + +Tools transform agents from simple chat interfaces into powerful assistants that can: + + + + Retrieve data from various sources + + + Analyze numbers and data accurately + + + Generate images, code, or other media + + + Interact with other software or hardware + + + +## Common Types of Tools + +### 1. Information Retrieval Tools + +These tools help agents access information beyond their training data. + +**Examples:** +- Web search tools +- Database query tools +- Document retrieval tools + +```python +# Example of a simple web search tool +from praisonaiagents import Agent + +def web_search(query): + # Simplified example + return f"Results for: {query}" + +agent = Agent( + instructions="Research assistant", + tools=[web_search] +) +``` + +### 2. Computation Tools + +These tools perform calculations or data processing. + +**Examples:** +- Calculator tools +- Data analysis tools +- Conversion tools + +### 3. Content Creation Tools + +These tools help generate or modify various types of content. + +**Examples:** +- Image generation tools +- Code writing tools +- Document formatting tools + +### 4. External API Tools + +These tools connect to third-party services. + +**Examples:** +- Weather API tools +- Translation API tools +- E-commerce API tools + +## How Tools Work in PraisonAI + +In the PraisonAI framework, tools follow a simple pattern: + +1. Tools are defined as functions +2. Tools are registered with an agent +3. The agent decides when to use appropriate tools +4. Tool results are incorporated into the agent's reasoning + +```mermaid +graph TD + A[Agent Receives Task] --> B{Needs a Tool?} + B -->|Yes| C[Select Appropriate Tool] + C --> D[Execute Tool] + D --> E[Process Tool Results] + E --> F[Continue Task] + B -->|No| F +``` + +## Creating Basic Tools + +Here's a simple example of creating and using tools in PraisonAI: + +```python +from praisonaiagents import Agent + +# Define a simple calculator tool +def calculator(expression): + try: + return str(eval(expression)) + except: + return "Error: Could not calculate" + +# Create an agent with the tool +math_agent = Agent( + instructions="You are a math tutor helping students solve problems", + tools=[calculator] +) + +# Use the agent +math_agent.start("Calculate 24 * 17 and explain the steps") +``` + +## Tool Best Practices + + + + Provide detailed descriptions so the agent knows when to use each tool + + + Make tools robust with proper error handling + + + Each tool should do one thing well + + + Validate inputs to prevent misuse + + + +## Building a Toolbox + +As you advance, you'll want to create a collection of tools your agent can use: + +```python +from praisonaiagents import Agent, Tool + +# Define multiple tools +def weather(location): + return f"Weather in {location}: Sunny, 75°F" + +def translator(text, target_language): + return f"Translated to {target_language}: {text} (placeholder)" + +def reminder(message, time): + return f"Reminder set for {time}: {message}" + +# Create tool collection +tools = [ + Tool(name="weather", function=weather, description="Get weather for a location"), + Tool(name="translator", function=translator, description="Translate text"), + Tool(name="reminder", function=reminder, description="Set a reminder") +] + +# Create agent with multiple tools +assistant = Agent( + instructions="You are a helpful personal assistant", + tools=tools +) +``` + +In the next lesson, we'll explore how agents use memory to maintain context across interactions. diff --git a/docs/course/agents/06-agent-memory.mdx b/docs/course/agents/06-agent-memory.mdx new file mode 100644 index 0000000..bb264fa --- /dev/null +++ b/docs/course/agents/06-agent-memory.mdx @@ -0,0 +1,167 @@ +--- +title: "Agent Memory" +description: "Understanding how agents maintain context and learn" +icon: "brain" +--- + +# Agent Memory + +Memory enables AI agents to remember past interactions, maintain context, and provide more coherent responses over time. Without memory, agents would treat each interaction as if it was their first. + +## Why Memory Matters + + + + Remembers previous parts of a conversation + + + Recalls user preferences and history + + + Builds on past experiences + + + Maintains progress on long-running tasks + + + +## Types of Agent Memory + +### 1. Short-Term Memory (Conversation Memory) + +This type of memory stores recent interactions within a session. + +```mermaid +graph LR + A[User Input 1] --> B[Agent Response 1] + B --> C[User Input 2] + C --> D[Agent Response 2] + D --> E[User Input 3] +``` + +The agent can refer back to earlier messages in the same conversation. + +### 2. Long-Term Memory + +This allows agents to remember information across different sessions. + + + + - Remembering user preferences + - Recalling previous tasks completed + - Storing learned information + - Maintaining relationship history + + + +### 3. Working Memory + +This is where agents process current information and combine it with retrieved memories. + +```mermaid +graph TD + A[Current Input] --> D[Working Memory] + B[Short-Term Memory] --> D + C[Long-Term Memory] --> D + D --> E[Agent Response] +``` + +## How Memory Works in PraisonAI + +In the PraisonAI framework, memory is handled automatically for basic cases and can be customized for more advanced needs: + +```python +from praisonaiagents import Agent + +# Basic agent with default memory handling +agent = Agent( + instructions="You are a helpful assistant that remembers our conversations" +) + +# The conversation history is maintained automatically +agent.start("My name is Alex") +agent.continue("What's my name?")# Note: TODO: This Feature yet to be developed # Agent will remember "Alex" +``` + +## Memory Limitations + + +All AI memories have limitations. They aren't perfect and may occasionally forget or misremember information. + + +Common limitations include: + + + + Limit to how much information can be stored + + + Only a portion of memory fits in the active context + + + Older memories may become less accessible + + + Finding the right memory at the right time + + + +## Implementing Persistent Memory + +For more advanced applications, you can implement custom memory systems: + +```python +# Note: TODO: This Feature yet to be tested +from praisonaiagents import Agent, Memory + +# Create a simple memory store +memory = Memory() + +# Add information to memory +memory.add("user_name", "Alex") +memory.add("favorite_color", "blue") + +# Create agent with this memory +agent = Agent( + instructions="You are a personal assistant", + memory=memory +) + +# The agent can now access these memories +agent.start("What's my favorite color?") # Agent should respond "blue" +``` + +## Memory Best Practices + + + + Not everything needs to be remembered + + + Have agents confirm uncertain memories + + + Organize memories by categories + + + Update memories when information changes + + + +## Memory in Multi-Agent Systems + +In systems with multiple agents, memory can be: + +1. **Private**: Each agent has its own memories +2. **Shared**: Agents have access to a common memory store +3. **Hybrid**: Some memories are private, others are shared + +```mermaid +graph TD + A[Agent 1] --> B[Private Memory 1] + C[Agent 2] --> D[Private Memory 2] + A -.-> E[Shared Memory] + C -.-> E +``` + +In the next lesson, we'll learn about how to set up multiple agents to work together effectively. diff --git a/docs/course/agents/07-multi-agent-systems.mdx b/docs/course/agents/07-multi-agent-systems.mdx new file mode 100644 index 0000000..75c2c89 --- /dev/null +++ b/docs/course/agents/07-multi-agent-systems.mdx @@ -0,0 +1,171 @@ +--- +title: "Multi-Agent Systems" +description: "How multiple agents can work together" +icon: "users" +--- + +# Multi-Agent Systems + +Multi-agent systems allow multiple AI agents to work together, each handling different parts of a complex task. This approach mirrors how human teams collaborate, with each member contributing their specialized skills. + +## Why Use Multiple Agents? + + + + Each agent can focus on its area of expertise + + + Break down difficult problems into manageable pieces + + + Add more agents as tasks become more complex + + + Different agents can approach problems differently + + + +## Basic Multi-Agent Architecture + +```mermaid +graph LR + A[Research Agent] --> B[Analysis Agent] + B --> C[Writing Agent] + C --> D[Final Output] +``` + +In this example: +1. The Research Agent gathers information +2. The Analysis Agent processes and interprets the data +3. The Writing Agent creates the final content + +## Multi-Agent Patterns + +### 1. Pipeline Pattern + +Agents work in sequence, with each agent handling a specific stage of the process. + +```mermaid +graph LR + A[Agent 1] --> B[Agent 2] + B --> C[Agent 3] +``` + +**Example Use Case**: Content creation where one agent researches, another drafts, and a third edits. + +### 2. Expert Panel Pattern + +Multiple specialist agents work in parallel on the same problem, then their outputs are combined. + +```mermaid +graph TD + Task --> A[Expert Agent 1] + Task --> B[Expert Agent 2] + Task --> C[Expert Agent 3] + A --> D[Coordination Agent] + B --> D + C --> D + D --> Result +``` + +**Example Use Case**: Financial analysis where different experts analyze market trends, economic indicators, and company performance. + +### 3. Hierarchical Pattern + +A manager agent delegates tasks to worker agents and coordinates their efforts. + +```mermaid +graph TD + A[Manager Agent] --> B[Worker Agent 1] + A --> C[Worker Agent 2] + A --> D[Worker Agent 3] + B --> A + C --> A + D --> A +``` + +**Example Use Case**: Project management where a coordinator assigns tasks and integrates results. + +## Implementing Multi-Agent Systems in PraisonAI + +Here's a simple example of creating a multi-agent system: + +```python +from praisonaiagents import Agent, PraisonAIAgents + +# Create individual agents +research_agent = Agent( + name="Researcher", + instructions="Research the latest trends in renewable energy" +) + +analysis_agent = Agent( + name="Analyst", + instructions="Analyze the research findings and identify key insights" +) + +writing_agent = Agent( + name="Writer", + instructions="Create a clear, engaging report based on the analysis" +) + +# Create a multi-agent system +agents = PraisonAIAgents( + agents=[research_agent, analysis_agent, writing_agent] +) + +# Start the agents +agents.start() +``` + +## Agent Communication + +For agents to work together effectively, they need to communicate. This happens through: + + + + One agent's output becomes another's input + + + Agents can access common information + + + Agents can send specific messages to each other + + + Rules that determine how agents interact + + + +## Challenges in Multi-Agent Systems + + + + Ensuring agents work together smoothly + + + Managing agents with different objectives + + + Passing information effectively between agents + + + Allocating computational resources efficiently + + + +## Designing Effective Multi-Agent Systems + + +Start simple with just 2-3 agents and a clear workflow before scaling to more complex systems. + + +Key principles for effective design: + +1. **Clear Role Definition**: Each agent should have a specific and well-defined role +2. **Minimized Dependencies**: Reduce complex interdependencies between agents +3. **Standardized Communication**: Use consistent formats for information exchange +4. **Failure Handling**: Plan for cases where an agent fails to complete its task +5. **Performance Monitoring**: Track how well each agent and the overall system performs + +In the next lesson, we'll explore how to create effective agent workflows using the Process component. diff --git a/docs/course/agents/08-agent-process.mdx b/docs/course/agents/08-agent-process.mdx new file mode 100644 index 0000000..108a4ca --- /dev/null +++ b/docs/course/agents/08-agent-process.mdx @@ -0,0 +1,152 @@ +--- +title: "Agent Process" +description: "Understanding agent workflows and processes" +icon: "diagram-project" +--- + +# Agent Process + +The Process component in AI agent systems defines how agents work together and the flow of information between them. Think of it as the "playbook" that coordinates how agents complete tasks. + +## What is an Agent Process? + + + + A process is a structured workflow that defines the sequence of steps, decision points, and information flow between agents to complete a task. + + + +## Process Flow Basics + +A simple process flow might look like this: + +```mermaid +graph LR + A[Start] --> B[Gather Information] + B --> C[Process Information] + C --> D[Make Decision] + D --> E[Take Action] + E --> F[Report Results] +``` + +Each step could be handled by a different agent or by the same agent in different stages. + +## Types of Process Flows + +### 1. Sequential Process + +Agents work in a straight line, one after another. + +```mermaid +graph LR + A[Agent 1] --> B[Agent 2] + B --> C[Agent 3] + C --> D[Complete] +``` + +**Best for**: Tasks with clear, linear stages + +### 2. Parallel Process + +Multiple agents work simultaneously on different parts of a task. + +```mermaid +graph TD + A[Start] --> B[Agent 1] + A --> C[Agent 2] + A --> D[Agent 3] + B --> E[Combine Results] + C --> E + D --> E + E --> F[Complete] +``` + +**Best for**: Tasks that can be broken into independent pieces + +### 3. Conditional Process + +The workflow changes based on decisions or conditions. + +```mermaid +graph TD + A[Start] --> B{Decision Point} + B -->|Condition A| C[Agent 1] + B -->|Condition B| D[Agent 2] + C --> E[Complete] + D --> E +``` + +**Best for**: Tasks requiring different approaches based on circumstances + +## Implementing Process in PraisonAI + +Here's a simple example of creating a process in PraisonAI: + +```python +from praisonaiagents import Agent, Process, PraisonAIAgents + +# Create agents +research_agent = Agent( + name="Researcher", + instructions="Research the topic and gather key information about AI" +) + +writing_agent = Agent( + name="Writer", + instructions="Create content based on the research" +) + +editing_agent = Agent( + name="Editor", + instructions="Review and improve the content" +) + +# Create the multi-agent system with the process +agents = PraisonAIAgents( + agents=[research_agent, writing_agent, editing_agent], + process="hierarchical" +) + +# Start the process +agents.start() +``` + +## Process Best Practices + + + + Define exactly what each step should accomplish + + + Include steps for handling unexpected situations + + + Allow agents to request clarification when needed + + + Create reusable process components + + + + +Start with simple processes and gradually add complexity as you become more comfortable with the system. + + +## Monitoring Process Execution + +It's important to track how your processes are running: + +```python +agents = PraisonAIAgents( + agents=[research_agent, writing_agent, editing_agent], + process=content_process, + verbose=True # Enables detailed logging +) +``` + +This will provide information about: +- Which step is currently running +- The inputs and outputs of each step +- Any errors or issues encountered + +In the next lesson, we'll explore how to use knowledge bases to enhance agent capabilities. diff --git a/docs/course/agents/09-knowledge-bases.mdx b/docs/course/agents/09-knowledge-bases.mdx new file mode 100644 index 0000000..2f3af30 --- /dev/null +++ b/docs/course/agents/09-knowledge-bases.mdx @@ -0,0 +1,190 @@ +--- +title: "Knowledge Bases" +description: "Enhancing agents with specialized knowledge" +icon: "book" +--- + +# Knowledge Bases + +Knowledge bases provide agents with specialized information beyond their training data. They help agents answer specific questions, follow guidelines, or work within defined domains. + +## What is a Knowledge Base? + + + + A knowledge base is a structured collection of information that an agent can access to answer questions or make decisions. + + + +Think of a knowledge base as a specialized reference library for your agent. + +## Why Use Knowledge Bases? + + + + Provide specialized information for specific fields + + + Include data beyond the agent's training cutoff + + + Define rules and policies for the agent to follow + + + Ensure agents provide standardized answers + + + +## Types of Knowledge Bases + +### 1. Document Collections + +Text documents, articles, guides, or manuals that agents can reference. + +```mermaid +graph TD + A[Query] --> B[Search Documents] + B --> C[Find Relevant Content] + C --> D[Generate Response] +``` + +### 2. Structured Data + +Databases, tables, or other structured formats that organize information systematically. + + + + - Product catalogs with specifications + - Customer information databases + - Statistical data collections + - Reference tables for compliance information + + + +### 3. Vector Databases + +Special databases that store information as numerical representations (vectors) for semantic search. + +```mermaid +graph TD + A[User Question] --> B[Convert to Vector] + B --> C[Find Similar Vectors] + C --> D[Retrieve Related Information] + D --> E[Generate Answer] +``` + +## Implementing Knowledge Bases in PraisonAI + +Here's an example of how to use a knowledge base with an agent: + +```python +from praisonaiagents import Agent + +agent = Agent( + name="Knowledge Agent", + instructions="You answer questions based on the provided knowledge.", + knowledge=["small.pdf"] +) + +agent.start("What is KAG in one line?") +``` + +## Advanced Configuration + +For more control over the knowledge base, you can specify a configuration: + +```python +from praisonaiagents import Agent + +config = { + "vector_store": { + "provider": "chroma", + "config": { + "collection_name": "custom_knowledge", + "path": ".praison", + } + } +} + +agent = Agent( + name="Knowledge Agent", + instructions="You answer questions based on the provided knowledge.", + knowledge=["small.pdf"], + knowledge_config=config +) + +agent.start("What is KAG in one line?") +``` + +## Knowledge Retrieval Process + +When an agent uses a knowledge base, this typical process occurs: + +```mermaid +graph LR + A[User Question] --> B[Query Processing] + B --> C[Search Knowledge Base] + C --> D[Rank Results] + D --> E[Synthesize Answer] +``` + +1. **Query Processing**: The user's question is analyzed +2. **Search**: The system searches the knowledge base for relevant information +3. **Ranking**: Results are ranked by relevance +4. **Synthesis**: The agent creates an answer using the retrieved information + +## Best Practices for Knowledge Bases + + + + Regularly update your knowledge base + + + Structure information in intuitive categories + + + Focus on accurate, high-quality information + + + Add examples to illustrate complex concepts + + + +## When to Use Knowledge Bases + +Knowledge bases are particularly valuable when: + +1. Your agent needs to reference specific information that may change over time +2. You need to ensure consistent answers to common questions +3. Your agent needs to follow specific guidelines or protocols +4. You want to provide expertise in specialized domains + + +Start with a small knowledge base focusing on the most important information, then expand as needed. + + +## Creating a Simple Knowledge Base + +For beginners, you can start with a simple text-based knowledge base: + +``` +# Company FAQ Knowledge Base + +## Return Policy +Our return policy allows customers to return products within 30 days of purchase for a full refund. + +## Shipping Information +Standard shipping takes 3-5 business days. Express shipping takes 1-2 business days. + +## Product Warranty +All products come with a 1-year limited warranty covering manufacturing defects. +``` + +Save this as a text file and add it to your knowledge base: + +```python +kb = KnowledgeBase() +kb.add_document("company_faq.txt") +``` + +In the next lesson, we'll explore how agents handle tasks and the task management process. diff --git a/docs/course/agents/10-agent-tasks.mdx b/docs/course/agents/10-agent-tasks.mdx new file mode 100644 index 0000000..61627aa --- /dev/null +++ b/docs/course/agents/10-agent-tasks.mdx @@ -0,0 +1,274 @@ +--- +title: "Agent Tasks" +description: "Understanding how agents handle and manage tasks" +icon: "clipboard-list" +--- + +# Agent Tasks + +Tasks are the specific units of work that AI agents perform. Understanding how to define and manage tasks is essential for creating effective agent systems. + +## What is an Agent Task? + + + + A task is a specific, well-defined piece of work assigned to an agent with clear inputs, expected outputs, and success criteria. + + + +Just as human jobs are broken into specific responsibilities, agent systems work best when complex goals are divided into manageable tasks. + +## Anatomy of a Task + +A well-defined task includes: + + + + What the task should accomplish + + + Information provided to complete the task + + + Steps to follow or approach to take + + + Expected results or deliverables + + + +## Task Types + +### 1. Information Tasks + +These tasks involve finding, analyzing, or summarizing information. + +**Examples:** +- Research a topic +- Summarize a document +- Extract data from text +- Answer questions + +### 2. Creation Tasks + +These tasks involve generating new content. + +**Examples:** +- Write an article +- Create a marketing plan +- Generate images (with appropriate tools) +- Design a workflow + +### 3. Analysis Tasks + +These tasks involve evaluating information and drawing conclusions. + +**Examples:** +- Analyze data trends +- Review content for quality +- Evaluate options +- Identify patterns + +### 4. Interaction Tasks + +These tasks involve communicating or working with users or other systems. + +**Examples:** +- Answer customer questions +- Guide users through processes +- Collect information from users +- Notify about events + +## Creating Tasks in PraisonAI + +### Task Flow + +The typical lifecycle of a task follows this pattern: + +```mermaid +graph LR + A[Define Task] --> B[Assign to Agent] + B --> C[Execute Task] + C --> D[Return Results] + D --> E[Evaluate Success] +``` + +### Task Configuration + + + ```python Basic + task = Task( + description="Research AI trends", + expected_output="Summary report", + agent=research_agent + ) + ``` + ```python Advanced + task = Task( + description="Analyze market data", + expected_output="Detailed analysis", + agent=analyst_agent, + tools=[AnalysisTool()], + output_file="analysis.md", + async_execution=True + ) + ``` + + +# Understanding Tasks +
+```mermaid +graph LR + %% Task Flow Steps + Start([▶ Start]) --> TaskDef + TaskDef --> AgentAssign + AgentAssign --> Exec + Exec --> Output([✓ Output]) + + %% Define subgraphs for each step + subgraph TaskDef[" "] + TD_Icon[📋 Task Definition] + TD_Desc[Description & Requirements] + + TD_Icon --- TD_Desc + + style TD_Icon fill:#2D3047,stroke:#7C90A0,color:#fff + style TD_Desc fill:#5C80BC,stroke:#7C90A0,color:#fff + end + + subgraph AgentAssign[" "] + AA_Icon[🤖 Agent Assignment] + AA_Desc[Matching & Delegation] + + AA_Icon --- AA_Desc + + style AA_Icon fill:#2D3047,stroke:#7C90A0,color:#fff + style AA_Desc fill:#5C80BC,stroke:#7C90A0,color:#fff + end + + subgraph Exec[" "] + E_Icon[⚙️ Execution] + E_Desc[Processing & Tools] + + E_Icon --- E_Desc + + style E_Icon fill:#2D3047,stroke:#7C90A0,color:#fff + style E_Desc fill:#5C80BC,stroke:#7C90A0,color:#fff + end + + %% Styling for main elements + style Start fill:#2D3047,stroke:#7C90A0,color:#fff + style Output fill:#2D3047,stroke:#7C90A0,color:#fff + + %% Style for containers + style TaskDef fill:#1B1F3B,stroke:#7C90A0,color:#fff + style AgentAssign fill:#1B1F3B,stroke:#7C90A0,color:#fff + style Exec fill:#1B1F3B,stroke:#7C90A0,color:#fff + + %% Global styles + classDef default fill:#2D3047,stroke:#7C90A0,color:#fff + linkStyle default stroke:#7C90A0,stroke-width:2px +``` +

+```mermaid +graph LR + %% Task States + Pending([📥 Pending]) --> InProgress([⚡ In Progress]) + InProgress --> Completed([✅ Completed]) + InProgress --> Failed([❌ Failed]) + + %% Styling + style Pending fill:#2D3047,stroke:#7C90A0,color:#fff + style InProgress fill:#5C80BC,stroke:#7C90A0,color:#fff + style Completed fill:#2D3047,stroke:#7C90A0,color:#fff + style Failed fill:#2D3047,stroke:#7C90A0,color:#fff + + %% Global styles + classDef default fill:#2D3047,stroke:#7C90A0,color:#fff + linkStyle default stroke:#7C90A0,stroke-width:2px +``` + +## Task Types + + + + Simple, single-operation tasks with clear inputs and outputs + + + Tasks involving choices and conditional paths + ```python + decision_task = Task( + type="decision", + conditions={ + "success": ["next_task"], + "failure": ["error_task"] + } + ) + ``` + + + Repetitive operations over collections + ```python + loop_task = Task( + type="loop", + items=data_list, + operation="process_item" + ) + ``` + + + +## Task Relationships + + + Properly managing task dependencies is crucial for complex workflows. Always ensure proper context sharing and error handling. + + +### Context Sharing +```python +task_a = Task(name="research") +task_b = Task( + name="analyze", + context=[task_a] # Uses task_a's output +) +``` + +## Task Best Practices + + + + Clearly define what the task should accomplish + + + Each task should focus on a single objective + + + Include necessary background information + + + Specify what a successful outcome looks like + + + + +Break complex goals into multiple smaller tasks rather than creating one large, complex task. + + +## Common Task Mistakes + + + + Unclear about what the agent should do + + + Asking for too many things in one task + + + Not providing necessary background information + + + Asking for tasks beyond agent capabilities + + + +In the next lesson, we'll learn about creating your first complete agent application. diff --git a/docs/course/agents/11-creating-your-first-agent.mdx b/docs/course/agents/11-creating-your-first-agent.mdx new file mode 100644 index 0000000..6734007 --- /dev/null +++ b/docs/course/agents/11-creating-your-first-agent.mdx @@ -0,0 +1,172 @@ +--- +title: "Creating Your First Agent" +description: "A step-by-step guide to building your first AI agent" +icon: "robot" +--- + +# Creating Your First Agent + +In this lesson, we'll walk through the process of building a simple AI agent. We'll focus on practical implementation without complex programming. + +## What We'll Build + +We'll create a basic research assistant agent that can: +- Understand simple instructions +- Respond to questions +- Provide helpful information + +## Prerequisites + +Before you begin, make sure you have: + +1. A basic understanding of the concepts from previous lessons +2. Python installed on your computer (if following the code examples) +3. An OpenAI API key (or access to another supported language model) + +## Step 1: Installation + +First, install the PraisonAI package: + +```bash +pip install praisonaiagents +``` + +## Step 2: Setup Your Environment + +Create a file called `first_agent.py` and set up your API key: + +```python +import os +from praisonaiagents import Agent + +# Set your API key +# Option 1: Set it in your environment (recommended) +# export OPENAI_API_KEY=your_key_here + +# Option 2: Set it in your code (not recommended for production) +# os.environ["OPENAI_API_KEY"] = "your_key_here" +``` + +## Step 3: Define Your Agent + +Now, let's create a simple agent: + +```python +# Create a research assistant agent +research_assistant = Agent( + name="ResearchAssistant", + instructions=""" + You are a helpful research assistant that provides clear, + accurate information on various topics. When answering: + + 1. Be concise and to the point + 2. Explain complex concepts in simple terms + 3. When appropriate, organize information with bullet points + 4. If you don't know something, admit it instead of guessing + """ +) +``` + +## Step 4: Start Your Agent + +Now let's use our agent to answer a question: + +```python +# Start the agent with a specific query +response = research_assistant.start("Explain how solar panels work in simple terms") + +# Print the response +print(response) +``` + +## Step 5: Run Your Agent + +Save the file and run it from your terminal: + +```bash +python first_agent.py +``` + +You should see the agent's response explaining how solar panels work in simple terms. + +## Experimenting with Your Agent + +Try changing the question to see how your agent responds to different topics: + +```python +# Try different questions +response = research_assistant.start("What are the benefits of exercise?") +# or +response = research_assistant.start("How does artificial intelligence work?") +``` + +## Modifying Agent Behavior + +You can change how your agent behaves by adjusting its instructions: + +```python +# Create an agent with different instructions +creative_writer = Agent( + name="CreativeWriter", + instructions=""" + You are a creative writer that specializes in short, engaging stories. + Your writing should: + + 1. Include vivid descriptions + 2. Have interesting characters + 3. Include some dialogue + 4. Have a clear beginning, middle, and end + """ +) + +# Ask for a story +story = creative_writer.start("Write a short story about a lost dog finding its way home") +print(story) +``` + +## Examining How It Works + +What's happening behind the scenes: + +1. The agent receives your instructions and query +2. The language model (like GPT-4) processes the information +3. The model generates a response based on the instructions and query +4. The response is returned to you + +```mermaid +graph TD + A[Your Instructions] --> B[Agent] + C[Your Query] --> B + B --> D[Language Model] + D --> E[Generated Response] + E --> F[Output to You] +``` + +## Common Challenges + +If you encounter issues, check these common problems: + + + + Make sure your API key is set correctly + + + Check your internet connection + + + Try making your instructions more specific + + + You might be making too many API calls + + + +## Next Steps + +Now that you've created your first agent, you can: +- Experiment with different instructions +- Try more complex queries +- Add specialized capabilities (we'll cover this in upcoming lessons) +- Create agents for specific use cases + +Congratulations on creating your first AI agent! In the next lesson, we'll explore how to add tools to enhance your agent's capabilities. diff --git a/docs/course/agents/12-adding-tools-to-agents.mdx b/docs/course/agents/12-adding-tools-to-agents.mdx new file mode 100644 index 0000000..aeb7d61 --- /dev/null +++ b/docs/course/agents/12-adding-tools-to-agents.mdx @@ -0,0 +1,275 @@ +--- +title: "Adding Tools to Agents" +description: "Enhancing your agents with specialized capabilities" +icon: "screwdriver-wrench" +--- + +# Adding Tools to Agents + +In this lesson, we'll learn how to enhance your agents by adding tools. Tools allow agents to perform specific actions beyond just generating text, making them much more useful for real-world tasks. + +## What You'll Learn + +By the end of this lesson, you'll understand: +- What agent tools are and why they're useful +- How to create simple tools for your agents +- How to integrate tools with your agents +- Best practices for tool design + +## Understanding Agent Tools + +Tools give your agents the ability to: +- Perform calculations +- Access specific information +- Interact with external systems +- Generate different types of content + + + + + + + +Install the core package: +```bash Terminal +pip install praisonaiagents duckduckgo-search +``` + + + + ```bash Terminal + export OPENAI_API_KEY=your_openai_key + ``` + Generate your OpenAI API key from [OpenAI](https://platform.openai.com/api-keys) + Use other LLM providers like Ollama, Anthropic, Groq, Google, etc. Please refer to the [Models](/models) for more information. + + + + Create `app.py` + +```python Single Agent +from praisonaiagents import Agent +from duckduckgo_search import DDGS + +# 1. Define the tool +def internet_search_tool(query: str): + results = [] + ddgs = DDGS() + for result in ddgs.text(keywords=query, max_results=5): + results.append({ + "title": result.get("title", ""), + "url": result.get("href", ""), + "snippet": result.get("body", "") + }) + return results + +# 2. Assign the tool to an agent +search_agent = Agent( + instructions="Perform internet searches to collect relevant information.", + tools=[internet_search_tool] # <--- Tool Assignment +) + +# 3. Start Agent +search_agent.start("Search about AI job trends in 2025") +``` + +```python Multiple Agents +from praisonaiagents import Agent, PraisonAIAgents +from duckduckgo_search import DDGS + +# 1. Define the tool +def internet_search_tool(query: str): + results = [] + ddgs = DDGS() + for result in ddgs.text(keywords=query, max_results=5): + results.append({ + "title": result.get("title", ""), + "url": result.get("href", ""), + "snippet": result.get("body", "") + }) + return results + +# 2. Assign the tool to an agent +search_agent = Agent( + instructions="Search about AI job trends in 2025", + tools=[internet_search_tool] # <--- Tool Assignment +) + +blog_agent = Agent( + instructions="Write a blog article based on the previous agent's search results." +) + +# 3. Start Agents +agents = PraisonAIAgents(agents=[search_agent, blog_agent]) +agents.start() +``` + + + + + Execute your script: +```bash Terminal +python app.py +``` + + + + + + + +Install the core package and duckduckgo_search package: +```bash Terminal +pip install praisonai duckduckgo_search +``` + + + +To add additional tools/features you need some coding which can be generated using ChatGPT or any LLM + +Create a new file `tools.py` with the following content: +```python +from duckduckgo_search import DDGS +from typing import List, Dict + +# 1. Tool +def internet_search_tool(query: str) -> List[Dict]: + """ + Perform Internet Search + """ + results = [] + ddgs = DDGS() + for result in ddgs.text(keywords=query, max_results=5): + results.append({ + "title": result.get("title", ""), + "url": result.get("href", ""), + "snippet": result.get("body", "") + }) + return results +``` + + + +Create a new file `agents.yaml` with the following content: +```yaml +framework: praisonai +topic: create movie script about cat in mars +roles: + scriptwriter: + backstory: Expert in dialogue and script structure, translating concepts into + scripts. + goal: Write a movie script about a cat in Mars + role: Scriptwriter + tools: + - internet_search_tool # <-- Tool assigned to Agent here + tasks: + scriptwriting_task: + description: Turn the story concept into a production-ready movie script, + including dialogue and scene details. + expected_output: Final movie script with dialogue and scene details. +``` + + + + +Execute your script: +```bash Terminal +praisonai agents.yaml +``` + + + + + + +## Creating Custom Tool + + +Create any function that you want to use as a tool, that performs a specific task. +```python +from duckduckgo_search import DDGS + +def internet_search_tool(query: str): + results = [] + ddgs = DDGS() + for result in ddgs.text(keywords=query, max_results=5): + results.append({ + "title": result.get("title", ""), + "url": result.get("href", ""), + "snippet": result.get("body", "") + }) + return results +``` + + +Assign the tool to an agent +```python + data_agent = Agent( + instructions="Search about AI job trends in 2025", + tools=[internet_search_tool], # <-- Tool Assignment + ) +``` + + + + +You have created a custom tool and assigned it to an agent. + + +## When Does the Agent Use Tools? + +The agent decides when to use tools based on: +1. The nature of the user's request +2. The tools available to it +3. The instructions you've provided + +If your agent isn't using tools when expected, you might need to: +- Make your instructions more explicit about when to use tools +- Provide more descriptive tool definitions +- Ensure the tools are appropriate for the task + +## Tool Best Practices + + + + Each tool should have a clear, specific purpose + + + Tools should handle errors gracefully + + + Use clear names that indicate functionality + + + Include detailed descriptions and examples + + + +## Real-World Tool Examples + +In production systems, you might create tools for: + + + + Retrieve or store information in databases + + + Connect to external services + + + Read from or write to files + + + Create images based on descriptions + + + +## Advanced Tool Concepts + +As you become more comfortable with tools, you can explore: +- Tools that call other tools +- Tools with complex parameters +- Tools that maintain state +- Dynamically generated tools + +In the next lesson, we'll explore how to create a multi-agent system for more complex tasks. diff --git a/docs/course/agents/13-building-multi-agent-system.mdx b/docs/course/agents/13-building-multi-agent-system.mdx new file mode 100644 index 0000000..9e6514c --- /dev/null +++ b/docs/course/agents/13-building-multi-agent-system.mdx @@ -0,0 +1,218 @@ +--- +title: "Building a Multi-Agent System" +description: "Creating a system with multiple cooperative agents" +icon: "users" +--- + +# Building a Multi-Agent System + +In this lesson, we'll create a simple multi-agent system where several agents work together to accomplish a task. This approach allows you to divide complex problems into smaller, more manageable pieces. + +## What We'll Build + +We'll create a content creation system with three specialized agents: +1. A research agent to gather information +2. A writing agent to create content +3. An editing agent to improve and refine the content + +## Step 1: Setting Up + +First, let's import the necessary modules and set up our environment: + +```python +from praisonaiagents import Agent, PraisonAIAgents + +# Make sure your API key is set in your environment: +# export OPENAI_API_KEY=your_openai_key +``` + +## Step 2: Creating Specialized Agents + +Now, let's create our three specialized agents: + +```python +# Research Agent +research_agent = Agent( + name="Researcher", + instructions=""" + You are a research specialist who excels at finding relevant information. + Your job is to: + 1. Thoroughly research the given topic + 2. Identify key facts, statistics, and insights + 3. Organize the information in a clear, structured format + 4. Provide accurate information with no fabrications + 5. Focus on the most relevant and current information + """ +) + +# Writing Agent +writing_agent = Agent( + name="Writer", + instructions=""" + You are a content writer who creates engaging, reader-friendly content. + Your job is to: + 1. Use the research provided to create well-structured content + 2. Write in a clear, engaging style + 3. Include an attention-grabbing introduction + 4. Organize the content with appropriate headings + 5. Conclude with a summary and call-to-action when appropriate + """ +) + +# Editing Agent +editing_agent = Agent( + name="Editor", + instructions=""" + You are an editor who refines and improves content. + Your job is to: + 1. Correct any grammatical or spelling errors + 2. Improve clarity and flow + 3. Ensure consistency in tone and style + 4. Check for logical structure and organization + 5. Enhance readability for the target audience + """ +) +``` + +## Step 3: Creating the Multi-Agent System + +Now, let's combine these agents into a multi-agent system: + +```python +# Create a multi-agent system +content_team = PraisonAIAgents( + agents=[research_agent, writing_agent, editing_agent] +) +``` + +## Step 4: Setting Up the Workflow + +Next, we need to define how our agents will work together: + +```python +# Define a topic +topic = "The Benefits of Regular Exercise" + +# Start the multi-agent process +results = content_team.start( + f""" + Task: Create a comprehensive blog post about {topic} + + Process: + 1. Researcher: Research {topic} and provide key information including: + - Main benefits of exercise (physical and mental) + - Recommended exercise guidelines + - Scientific studies supporting the benefits + - Common misconceptions + + 2. Writer: Use the research to create a 500-word blog post about {topic} with: + - An engaging introduction + - Clear sections with headings + - Practical advice for readers + - A compelling conclusion + + 3. Editor: Review and improve the blog post by: + - Correcting any errors + - Enhancing clarity and flow + - Ensuring a consistent tone + - Making the content more engaging + """ +) + +# Print the final result +print(results) +``` + +## Understanding the Workflow + +Let's examine how the multi-agent system works: + +```mermaid +graph TD + A[Start] --> B[Research Agent] + B --> C[Writing Agent] + C --> D[Editing Agent] + D --> E[Final Output] +``` + +1. The research agent gathers and organizes relevant information +2. The writing agent uses that research to create the initial content +3. The editing agent refines and improves the content +4. The final polished content is returned + +## Customizing Agent Interactions + +You can customize how agents interact by modifying the process instructions. For example, you could add feedback loops: + +```python +process_with_feedback = """ +Task: Create a comprehensive blog post about {topic} + +Process: +1. Researcher: Research {topic} and provide key information + +2. Writer: Use the research to create a blog post + +3. Editor: Review the blog post and provide feedback + +4. Writer: Revise the blog post based on the editor's feedback + +5. Editor: Make final improvements to the revised blog post +""" +``` + +## Alternative Agent Configurations + +You can organize multi-agent systems in different ways: + +### Parallel Processing + +```python +parallel_process = """ +Task: Create a marketing campaign for a new product + +Process: +1. Market Researcher: Research the target market and competitors + Content Researcher: Research the product features and benefits + [These tasks happen in parallel] + +2. Strategy Agent: Use both research results to create a marketing strategy + +3. Content Creator: Create the marketing materials based on the strategy +""" +``` + +### Expert Panel + +```python +expert_panel = """ +Task: Evaluate a business idea + +Process: +1. Financial Expert: Analyze financial viability + Market Expert: Analyze market potential + Technical Expert: Analyze technical feasibility + [These assessments happen in parallel] + +2. Coordinator: Compile all expert opinions into a final recommendation +""" +``` + +## Best Practices for Multi-Agent Systems + + + + Define exactly what each agent is responsible for + + + Specify how information passes between agents + + + Don't have multiple agents do the same work + + + Plan for cases where an agent might fail + + + +In the next lesson, we'll learn how to create a conversational agent that can maintain context across multiple interactions. diff --git a/docs/course/agents/14-conversational-agents.mdx b/docs/course/agents/14-conversational-agents.mdx new file mode 100644 index 0000000..5fa57e7 --- /dev/null +++ b/docs/course/agents/14-conversational-agents.mdx @@ -0,0 +1,193 @@ +--- +title: "Building Conversational Agents" +description: "Creating agents that maintain context in conversations" +icon: "comments" +--- + +# Building Conversational Agents + +In this lesson, we'll learn how to create conversational agents that can maintain context across multiple interactions. This is essential for creating assistants that feel natural to interact with. + +## What Makes a Good Conversational Agent? + +A good conversational agent should: +- Remember previous parts of the conversation +- Understand context and references +- Provide coherent, relevant responses +- Maintain a consistent personality + +## Creating a Simple Conversational Agent + +Let's build a basic conversational agent: + +```python +# Note: TODO: This Feature yet to be developed +from praisonaiagents import Agent + +# Create a conversational agent +chat_agent = Agent( + name="Conversational Assistant", + instructions=""" + You are a friendly, helpful conversational assistant. + + When chatting with users: + 1. Maintain a warm, friendly tone + 2. Remember information shared earlier in the conversation + 3. Ask clarifying questions when needed + 4. Keep responses concise but informative + 5. Be helpful while respecting boundaries + """ +) + +# Start a conversation +response = chat_agent.start("Hi there! My name is Jamie.") +print(response) + +# Continue the conversation +response = chat_agent.continue("What can you help me with today?") +print(response) + +# The agent should remember the user's name +response = chat_agent.continue("Can you remember my name?") +print(response) +``` + +## How Context Works + +PraisonAI automatically manages conversation context for you: + +```mermaid +graph TD + A[User Message 1] --> B[Agent] + B --> C[Response 1] + D[User Message 2] --> E[Agent + Context] + E --> F[Response 2] + G[User Message 3] --> H[Agent + More Context] + H --> I[Response 3] +``` + +The agent maintains a memory of the conversation, allowing it to refer back to previous messages. + +## Conversation Settings + +You can customize how your conversational agent behaves: + +```python +# Create an agent with specific conversation settings +custom_chat_agent = Agent( + name="Custom Chat Assistant", + instructions="You are a helpful assistant", + memory_size=10, # Remember the last 10 messages + temperature=0.7 # Slightly more creative in responses +) +``` + +## Handling Different Types of Conversations + +Different use cases require different conversation styles: + + + + - Professional and helpful tone + - Focus on problem resolution + - Remember customer details + + + - Patient and explanatory + - Builds on previous lessons + - Adjusts to learning pace + + + - Remembers preferences + - Provides reminders + - Handles scheduling + + + - More casual tone + - Focuses on engagement + - Shows personality + + + +## Example: Customer Support Agent + +Let's create a specialized customer support agent: + +```python +support_agent = Agent( + name="Support Agent", + instructions=""" + You are a customer support specialist for a tech company. + + When helping customers: + 1. Greet them professionally + 2. Show empathy for their issues + 3. Ask for necessary information to troubleshoot + 4. Provide clear step-by-step solutions + 5. Confirm if the issue is resolved + 6. End with an offer for additional help + + Remember product details and customer information throughout the conversation. + """ +) + +# Example conversation +print(support_agent.start("Hi, I'm having trouble logging into my account.")) +print(support_agent.continue("My username is user123.")) +print(support_agent.continue("I've tried resetting my password but I'm not receiving the email.")) +``` + +## Building Multi-Turn Conversations + +To create engaging multi-turn conversations, consider: + +1. **Appropriate follow-up questions**: Keep the conversation flowing +2. **Acknowledgment**: Reference what the user has said +3. **Progressive disclosure**: Don't overwhelm with information at once +4. **Conversation repair**: Gracefully handle misunderstandings + +## Example: Multi-Turn Educational Conversation + +```python +tutor_agent = Agent( + name="Math Tutor", + instructions=""" + You are a patient, encouraging math tutor. + + When teaching: + 1. Gauge the student's current understanding + 2. Explain concepts using clear, simple language + 3. Provide examples to illustrate points + 4. Ask questions to check understanding + 5. Give positive reinforcement for progress + + Adapt your explanations based on the student's responses. + """ +) + +# Example tutoring session +print(tutor_agent.start("Can you help me understand algebra?")) +print(tutor_agent.continue("I'm struggling with equations like 2x + 5 = 13")) +print(tutor_agent.continue("So I subtract 5 from both sides first?")) +print(tutor_agent.continue("Then I divide by 2 to get x = 4?")) +print(tutor_agent.continue("Could you give me another example to practice?")) +``` + +## Conversation Best Practices + + + + Signal when changing topics + + + Break complex information into smaller pieces + + + Periodically confirm understanding + + + Maintain a consistent tone and style + + + +In the next lesson, we'll explore how to build agents that can search and retrieve information from external sources. diff --git a/docs/course/agents/15-research-agents.mdx b/docs/course/agents/15-research-agents.mdx new file mode 100644 index 0000000..18753bd --- /dev/null +++ b/docs/course/agents/15-research-agents.mdx @@ -0,0 +1,216 @@ +--- +title: "Building Research Agents" +description: "Creating agents that can gather and analyze information" +icon: "magnifying-glass" +--- + +# Building Research Agents + +In this lesson, we'll build agents specialized in gathering, analyzing, and summarizing information. Research agents are valuable for quickly obtaining insights on various topics. + +## What is a Research Agent? + +A research agent is designed to: +- Find relevant information on specific topics +- Analyze and synthesize data +- Present findings in a clear, structured format +- Answer questions based on gathered information + +## Creating a Basic Research Agent + +Let's start by building a simple research agent: + +```python +from praisonaiagents import Agent + +# Create a basic research agent +research_agent = Agent( + name="ResearchAgent", + instructions=""" + You are a research specialist who finds and summarizes information. + + When researching topics: + 1. Focus on finding accurate, current information + 2. Organize findings in a logical structure + 3. Identify key points and insights + 4. Cite sources when available + 5. Present information in a clear, concise format + """ +) + +# Use the research agent +research_results = research_agent.start("Research the impact of renewable energy on reducing carbon emissions") +print(research_results) +``` + +## Adding Web Search Capability + +To make our research agent more powerful, let's add web search capability: + +```python +from praisonaiagents import Agent, Tool + +# Define a web search function (simulated for this example) +def web_search(query): + """ + Simulated web search function. + In a real application, this would connect to a search API. + + Args: + query (str): The search query + + Returns: + str: Search results + """ + # This is just a simulation - in a real application, you'd call a search API + if "renewable energy" in query.lower(): + return """ + Search results for 'renewable energy carbon emissions': + + 1. According to the IEA, renewable energy prevented 2.1 billion tonnes of CO2 emissions in 2022. + + 2. Solar and wind power generate electricity with 95-98% lower carbon emissions than coal-based electricity. + + 3. The IPCC reports that renewable energy could deliver more than half of the emission reductions needed by 2030. + """ + else: + return f"Search results for '{query}' (simulated data)" + +# Create the web search tool +search_tool = Tool( + name="web_search", + function=web_search, + description="Search the web for current information on a topic" +) + +# Create a research agent with web search capability +enhanced_research_agent = Agent( + name="EnhancedResearchAgent", + instructions=""" + You are a research specialist who finds and summarizes information. + + When researching topics: + 1. Use the web_search tool to find current information + 2. Analyze and synthesize the search results + 3. Organize findings in a logical structure + 4. Identify key points and insights + 5. Present information in a clear, concise format + """, + tools=[search_tool] +) + +# Use the enhanced research agent +enhanced_results = enhanced_research_agent.start("What is the impact of renewable energy on carbon emissions?") +print(enhanced_results) +``` + +## Research Agent with Structured Output + +For more organized research results, we can instruct the agent to provide structured output: + +```python +structured_research_agent = Agent( + name="StructuredResearchAgent", + instructions=""" + You are a research specialist who finds and organizes information. + + When researching topics: + 1. Use available tools to find current information + 2. Analyze and synthesize the findings + + Always structure your response in this format: + + ## Summary + [Brief 2-3 sentence overview of the topic] + + ## Key Facts + - [Important fact 1] + - [Important fact 2] + - [Important fact 3] + + ## Analysis + [Deeper analysis of the information, including implications] + + ## Sources + [List of sources if available] + """, + tools=[search_tool] +) + +# Use the structured research agent +structured_results = structured_research_agent.start("Research the latest advancements in quantum computing") +print(structured_results) +``` + +## Specialized Research Agents + +Different research tasks require different approaches. Here are some specialized research agents: + +### Comparison Research Agent + +```python +comparison_agent = Agent( + name="ComparisonAgent", + instructions=""" + You are a research specialist who compares different options or topics. + + When comparing items: + 1. Identify the key criteria for comparison + 2. Research each option thoroughly + 3. Create a clear side-by-side comparison + 4. Highlight advantages and disadvantages of each option + 5. Provide a balanced conclusion + + Present your findings in a structured table format when appropriate. + """, + tools=[search_tool] +) + +# Use the comparison agent +comparison_results = comparison_agent.start("Compare solar and wind energy for residential use") +print(comparison_results) +``` + +### Literature Review Agent + +```python +literature_agent = Agent( + name="LiteratureAgent", + instructions=""" + You are a research specialist who reviews academic and professional literature. + + When reviewing literature: + 1. Identify key papers, articles, and studies on the topic + 2. Summarize the main findings and methodologies + 3. Identify trends, agreements, and contradictions + 4. Evaluate the strength of evidence + 5. Highlight gaps in current research + + Structure your review in a clear, academic format. + """, + tools=[search_tool] +) + +# Use the literature review agent +literature_results = literature_agent.start("Review recent research on artificial intelligence in healthcare") +print(literature_results) +``` + +## Research Process Best Practices + + + + Set clear boundaries for the research + + + Cross-check facts from multiple sources + + + Be aware of potential biases in sources + + + Focus on information most relevant to the query + + + +In the next lesson, we'll explore how to build agents that can assist with creative tasks like content creation. diff --git a/docs/course/agents/16-content-creation-agents.mdx b/docs/course/agents/16-content-creation-agents.mdx new file mode 100644 index 0000000..63f6db9 --- /dev/null +++ b/docs/course/agents/16-content-creation-agents.mdx @@ -0,0 +1,252 @@ +--- +title: "Content Creation Agents" +description: "Building agents that generate various types of content" +icon: "pen-to-square" +--- + +# Content Creation Agents + +Content creation agents can help generate various types of content, from blog posts to marketing materials. In this lesson, we'll learn how to build effective content creation agents. + +## What is a Content Creation Agent? + +A content creation agent is designed to: +- Generate written content based on specific requirements +- Structure content in appropriate formats +- Adapt tone and style to match the target audience +- Create content that achieves specific goals (inform, persuade, entertain) + +## Creating a Basic Content Creation Agent + +Let's start with a simple content creation agent: + +```python +from praisonaiagents import Agent + +# Create a basic content creation agent +content_agent = Agent( + name="ContentCreator", + instructions=""" + You are a versatile content creator who specializes in writing engaging material. + + When creating content: + 1. Understand the purpose and target audience + 2. Create a logical structure with clear sections + 3. Use an engaging, appropriate writing style + 4. Include a strong introduction and conclusion + 5. Format content for easy readability + """ +) + +# Use the content creation agent +blog_post = content_agent.start( + """ + Create a blog post about the benefits of meditation. + Target audience: Busy professionals + Length: Approximately 500 words + Tone: Informative but conversational + """ +) +print(blog_post) +``` + +## Specialized Content Creation Agents + +Different types of content require different approaches. Let's create specialized agents for various content needs: + +### Blog Post Agent + +```python +blog_agent = Agent( + name="BlogWriter", + instructions=""" + You are a blog post writer who creates engaging, informative articles. + + When writing blog posts: + 1. Create attention-grabbing headlines + 2. Start with a compelling introduction + 3. Use subheadings to organize content + 4. Include relevant examples and evidence + 5. Incorporate a clear call-to-action at the end + + Format your content with proper Markdown formatting including: + - Headings (## for main sections, ### for subsections) + - Bullet points for lists + - *Italic* for emphasis + - **Bold** for important points + - > Blockquotes for notable quotes + """ +) + +# Use the blog agent +blog_content = blog_agent.start( + """ + Topic: 5 Ways to Improve Your Productivity + Target audience: Remote workers + Style: Practical, actionable advice + Length: 800 words + Include: Tips, examples, and research-backed information + """ +) +print(blog_content) +``` + +### Social Media Content Agent + +```python +social_media_agent = Agent( + name="SocialMediaCreator", + instructions=""" + You are a social media content creator who crafts engaging posts. + + When creating social media content: + 1. Create attention-grabbing, concise content + 2. Adapt to the specific platform requirements + 3. Include relevant hashtags when appropriate + 4. Craft content that encourages engagement + 5. Consider visual elements that would pair well with the text + + For each platform, follow these guidelines: + - Twitter/X: 280 characters max, punchy, relevant hashtags + - LinkedIn: Professional tone, industry insights, 1-3 paragraphs + - Instagram: Visual-focused descriptions, emoji-friendly, hashtags + - Facebook: Conversational, can be longer, question-based engagement + """ +) + +# Use the social media agent +social_content = social_media_agent.start( + """ + Create posts for Twitter, LinkedIn, and Facebook announcing: + + Event: Free Webinar on "Future of AI in Business" + Date: March 15, 2025 + Time: 2:00 PM EST + Registration link: example.com/webinar + Key speakers: Dr. Jane Smith, AI Ethics Expert & Tom Johnson, Business AI Implementation Specialist + """ +) +print(social_content) +``` + +### Email Campaign Agent + +```python +email_agent = Agent( + name="EmailWriter", + instructions=""" + You are an email marketing specialist who creates effective email campaigns. + + When writing marketing emails: + 1. Create compelling subject lines that increase open rates + 2. Write engaging opening lines that hook the reader + 3. Keep content concise and focused on a single main message + 4. Include clear calls-to-action + 5. Use a tone appropriate for the brand and audience + + Structure your emails with: + - Subject line + - Greeting + - Opening hook + - Main content (2-3 paragraphs maximum) + - Call-to-action + - Sign-off + """ +) + +# Use the email agent +email_content = email_agent.start( + """ + Create a promotional email for: + + Product: Premium Fitness Subscription + Key benefit: Personalized workout plans and nutrition advice + Special offer: 30% off first 3 months + Target audience: Health-conscious professionals aged 25-45 + CTA: Sign up for the discounted offer + Tone: Motivational but not aggressive + """ +) +print(email_content) +``` + +## Content Creation with Templates + +Templates can help create more consistent content. Let's build an agent that works with templates: + +```python +template_agent = Agent( + name="TemplateWriter", + instructions=""" + You are a content creator who works with templates to create consistent content. + + When filling a template: + 1. Maintain the overall structure of the template + 2. Replace placeholder text with appropriate content + 3. Ensure consistency in tone and style + 4. Adapt content to the specific requirements + 5. Review for coherence and flow + + Always preserve formatting elements like headings, lists, and emphasis. + """ +) + +# Example template +product_review_template = """ +# {Product Name} Review: {Brief Opinion} + +## Quick Summary +**Rating:** {Rating}/10 +**Price:** {Price Range} +**Recommended For:** {Target User} + +## What We Liked +- {Positive Point 1} +- {Positive Point 2} +- {Positive Point 3} + +## What Could Be Better +- {Negative Point 1} +- {Negative Point 2} + +## Bottom Line +{Conclusion Paragraph} + +""" + +# Use the template agent +filled_template = template_agent.start( + f""" + Fill the following template for a product review: + + {product_review_template} + + Product: Wireless Noise-Cancelling Headphones XZ200 + Key features: 30-hour battery life, active noise cancellation, voice assistant integration + Price: $249.99 + Target audience: Commuters and office workers + Notable pros: Sound quality, comfort, battery life + Notable cons: Price, occasional Bluetooth connectivity issues + """ +) +print(filled_template) +``` + +## Content Creation Best Practices + + + + Understand who will consume the content + + + Define what the content should achieve + + + Maintain a consistent tone and style + + + Make content easy to scan and understand + + + +In the next lesson, we'll explore how to build AI agents that can analyze and work with data. diff --git a/docs/course/agents/17-data-analysis-agents.mdx b/docs/course/agents/17-data-analysis-agents.mdx new file mode 100644 index 0000000..cd85b68 --- /dev/null +++ b/docs/course/agents/17-data-analysis-agents.mdx @@ -0,0 +1,333 @@ +--- +title: "Data Analysis Agents" +description: "Creating agents that analyze and interpret data" +icon: "chart-line" +--- + +# Data Analysis Agents + +Data analysis agents can help process, analyze, and extract insights from data. In this lesson, we'll learn how to build agents that can work with data effectively. + +## What is a Data Analysis Agent? + +A data analysis agent is designed to: +- Process and interpret data +- Identify patterns and trends +- Generate insights and recommendations +- Present findings in an understandable format + +## Creating a Basic Data Analysis Agent + +Let's start by building a simple data analysis agent: + +```python +from praisonaiagents import Agent + +# Create a basic data analysis agent +data_analysis_agent = Agent( + name="DataAnalyst", + instructions=""" + You are a data analysis specialist who interprets and explains data. + + When analyzing data: + 1. First understand what the data represents + 2. Identify key patterns, trends, or anomalies + 3. Generate meaningful insights + 4. Explain findings in simple, clear language + 5. Provide actionable recommendations when appropriate + """ +) + +# Use the data analysis agent with sample data +sample_data = """ +Monthly Sales Data (2024): +January: $12,500 +February: $13,200 +March: $15,800 +April: $14,300 +May: $16,700 +June: $18,900 +""" + +analysis = data_analysis_agent.start( + f""" + Analyze the following sales data and provide insights: + + {sample_data} + + Questions to answer: + 1. What is the overall sales trend? + 2. Which month had the highest sales? + 3. What is the average monthly sales? + 4. What recommendations would you make based on this data? + """ +) +print(analysis) +``` + +## Adding Data Processing Tools + +Let's enhance our agent with basic data processing capabilities: + +```python +from praisonaiagents import Agent, Tool + +# Define a simple calculation tool +def calculate_statistics(data_string): + """ + Calculate basic statistics from a string of numbers. + + Args: + data_string (str): A string with numbers separated by commas + + Returns: + str: Statistical summary + """ + try: + # Convert string to list of numbers + data = [float(x.strip()) for x in data_string.split(',')] + + # Calculate statistics + total = sum(data) + average = total / len(data) + minimum = min(data) + maximum = max(data) + + return f""" + Statistical summary: + - Count: {len(data)} + - Sum: {total} + - Average: {average:.2f} + - Minimum: {minimum} + - Maximum: {maximum} + - Range: {maximum - minimum} + """ + except Exception as e: + return f"Error processing data: {str(e)}" + +# Create the tool +stats_tool = Tool( + name="calculate_statistics", + function=calculate_statistics, + description="Calculate basic statistics from a list of numbers (comma-separated)" +) + +# Create an agent with the statistics tool +enhanced_data_agent = Agent( + name="EnhancedDataAnalyst", + instructions=""" + You are a data analysis specialist who interprets and explains data. + + When analyzing data: + 1. First understand what the data represents + 2. Use the calculate_statistics tool for numerical data + 3. Identify key patterns, trends, or anomalies + 4. Generate meaningful insights + 5. Explain findings in simple, clear language + 6. Provide actionable recommendations when appropriate + """, + tools=[stats_tool] +) + +# Use the enhanced data agent +numerical_data = "12500, 13200, 15800, 14300, 16700, 18900" +enhanced_analysis = enhanced_data_agent.start( + f""" + Analyze the following monthly sales data for the first half of 2024: + + {numerical_data} + + Provide a complete analysis with trends and recommendations. + """ +) +print(enhanced_analysis) +``` + +## Specialized Data Analysis Agents + +Different analysis tasks require specialized approaches. Let's create some specialized agents: + +### Market Trend Analysis Agent + +```python +market_analysis_agent = Agent( + name="MarketAnalyst", + instructions=""" + You are a market trend analyst who specializes in identifying patterns and making predictions. + + When analyzing market data: + 1. Identify long-term trends and short-term patterns + 2. Compare data points to industry benchmarks + 3. Identify potential causes for changes + 4. Assess future implications + 5. Provide strategic recommendations + + Present your analysis with clear sections for: + - Overall Market Assessment + - Key Trends Identified + - Growth Opportunities + - Risk Factors + - Strategic Recommendations + """, + tools=[stats_tool] +) + +# Use the market analysis agent +market_data = """ +Industry Growth Rates (2021-2024): +2021: 3.2% +2022: 2.8% +2023: 4.5% +2024: 5.1% + +Our Company Growth: +2021: 2.9% +2022: 3.1% +2023: 4.8% +2024: 6.3% + +Competitor A Growth: +2021: 3.5% +2022: 3.7% +2023: 4.2% +2024: 4.5% + +Competitor B Growth: +2021: 3.0% +2022: 2.5% +2023: 5.0% +2024: 5.8% +""" + +market_analysis = market_analysis_agent.start( + f""" + Analyze the following market and company growth data: + + {market_data} + + Provide a comprehensive market analysis and strategic recommendations. + """ +) +print(market_analysis) +``` + +### Customer Data Analysis Agent + +```python +customer_analysis_agent = Agent( + name="CustomerAnalyst", + instructions=""" + You are a customer data analyst who specializes in understanding customer behavior. + + When analyzing customer data: + 1. Identify customer segments and patterns + 2. Analyze purchasing behavior + 3. Evaluate customer satisfaction metrics + 4. Identify opportunities to improve customer experience + 5. Recommend strategies for customer retention and growth + + Present your analysis with sections for: + - Customer Segmentation + - Behavior Patterns + - Key Insights + - Recommended Actions + """, + tools=[stats_tool] +) + +# Use the customer analysis agent +customer_data = """ +Customer Segments by Age: +18-24: 15% of customers (Avg. Purchase: $45) +25-34: 32% of customers (Avg. Purchase: $78) +35-44: 28% of customers (Avg. Purchase: $92) +45-54: 18% of customers (Avg. Purchase: $85) +55+: 7% of customers (Avg. Purchase: $65) + +Customer Satisfaction: +Very Satisfied: 42% +Satisfied: 35% +Neutral: 15% +Dissatisfied: 6% +Very Dissatisfied: 2% + +Repeat Purchase Rate: +One-time: 40% +2-5 purchases: 35% +6-10 purchases: 15% +10+ purchases: 10% +""" + +customer_analysis = customer_analysis_agent.start( + f""" + Analyze the following customer data: + + {customer_data} + + Provide insights on customer segments, behavior patterns, and recommendations to improve customer retention. + """ +) +print(customer_analysis) +``` + +## Data Visualization Recommendations + +While our agents can't directly create visualizations, they can recommend appropriate visualization types: + +```python +visualization_agent = Agent( + name="VisualizationAdvisor", + instructions=""" + You are a data visualization specialist who helps select the best ways to visually represent data. + + When recommending visualizations: + 1. Understand the nature of the data (categorical, numerical, time-series, etc.) + 2. Consider the key relationships or patterns to highlight + 3. Recommend the most appropriate chart or graph type + 4. Explain why your recommendation is effective + 5. Provide suggestions for layout, color scheme, and labeling + + Common visualization types to consider: + - Line charts (for trends over time) + - Bar charts (for comparing categories) + - Pie charts (for showing composition, use sparingly) + - Scatter plots (for showing relationships between variables) + - Heatmaps (for showing patterns in complex data) + - Box plots (for showing distributions) + """ +) + +# Use the visualization agent +viz_recommendations = visualization_agent.start( + """ + I have the following data and need visualization recommendations: + + 1. Monthly sales data for the past year + 2. Customer satisfaction ratings across 5 product categories + 3. Market share compared to 3 competitors + 4. Customer age distribution + + What visualizations would you recommend for each of these datasets and why? + """ +) +print(viz_recommendations) +``` + +## Data Analysis Best Practices + + + + Ensure data is accurate and complete + + + Consider external factors affecting data + + + Present findings in understandable terms + + + Focus on insights that lead to action + + + +In the next lesson, we'll explore how to build AI agents that can assist with customer support tasks. diff --git a/docs/course/agents/18-customer-support-agents.mdx b/docs/course/agents/18-customer-support-agents.mdx new file mode 100644 index 0000000..66f6820 --- /dev/null +++ b/docs/course/agents/18-customer-support-agents.mdx @@ -0,0 +1,260 @@ +--- +title: "Customer Support Agents" +description: "Building agents that handle customer inquiries and issues" +icon: "headset" +--- + +# Customer Support Agents + +Customer support agents can handle inquiries, resolve issues, and provide assistance to users. In this lesson, we'll learn how to build effective customer support agents. + +## What is a Customer Support Agent? + +A customer support agent is designed to: +- Answer frequently asked questions +- Troubleshoot common problems +- Provide information about products or services +- Collect information for support tickets +- Guide users through processes or procedures + +## Creating a Basic Customer Support Agent + +Let's start by building a simple customer support agent: + +```python +from praisonaiagents import Agent + +# Create a basic customer support agent +support_agent = Agent( + name="SupportAgent", + instructions=""" + You are a helpful customer support representative for a software company. + + When helping customers: + 1. Greet them professionally and warmly + 2. Understand their issue completely before attempting to solve it + 3. Provide clear, step-by-step solutions when possible + 4. Maintain a friendly, patient tone throughout + 5. If you cannot solve the issue, explain how to escalate it + + Our software product is a productivity app with features for: + - Task management + - Calendar scheduling + - Note-taking + - Team collaboration + """ +) + +# Use the support agent +response = support_agent.start("I'm having trouble syncing my calendar with my phone. Can you help?") +print(response) +``` + +## Adding a Knowledge Base + +Let's enhance our agent with a simple knowledge base to answer common questions: + +```python +from praisonaiagents import Agent, KnowledgeBase + +# Create a simple knowledge base +faq_kb = KnowledgeBase() + +# Add FAQ content (in a real scenario, you would load this from files) +faq_kb.add_text(""" +# Frequently Asked Questions + +## Account Issues + +### How do I reset my password? +To reset your password: +1. Go to the login page +2. Click on "Forgot Password" +3. Enter your email address +4. Follow the instructions sent to your email + +### How do I change my email address? +To change your email address: +1. Log in to your account +2. Go to Settings > Account +3. Click on "Change Email" +4. Enter your new email and confirm with your password + +## Subscription and Billing + +### What subscription plans do you offer? +We offer three plans: +- Basic: $9.99/month - Includes core features for individuals +- Pro: $19.99/month - Includes advanced features and team capabilities for up to 5 users +- Enterprise: Custom pricing - Full feature set with advanced security and support + +### How do I cancel my subscription? +To cancel your subscription: +1. Log in to your account +2. Go to Settings > Billing +3. Click "Cancel Subscription" +4. Follow the confirmation steps + +## Technical Issues + +### Why isn't my calendar syncing? +Common reasons for calendar sync issues: +1. Outdated app version - Try updating the app +2. Account permission issues - Check sync permissions in Settings > Integrations +3. Internet connectivity problems - Ensure you have a stable connection + +### How do I export my data? +To export your data: +1. Go to Settings > Data +2. Click "Export Data" +3. Choose the data types you want to export +4. Select your preferred format (CSV or JSON) +5. Click "Export" and save the file +""") + +# Create an agent with the knowledge base +kb_support_agent = Agent( + name="KnowledgeBaseAgent", + instructions=""" + You are a helpful customer support representative with access to our FAQ knowledge base. + + When helping customers: + 1. Greet them professionally and warmly + 2. Search the knowledge base for relevant information + 3. Provide clear, accurate answers based on the knowledge base + 4. If the knowledge base doesn't cover the question, provide general helpful guidance + 5. Maintain a friendly, supportive tone throughout + """, + knowledge_base=faq_kb +) + +# Use the knowledge base support agent +kb_response = kb_support_agent.start("How do I cancel my subscription?") +print(kb_response) +``` + +## Creating a Troubleshooting Agent + +Let's create an agent specialized in technical troubleshooting: + +```python +troubleshooting_agent = Agent( + name="TroubleshootingAgent", + instructions=""" + You are a technical support specialist who helps users troubleshoot problems. + + When troubleshooting: + 1. Ask clarifying questions to understand the exact issue + 2. Identify the most likely causes of the problem + 3. Provide step-by-step solutions, starting with the simplest fixes + 4. Explain what each step does and why it might help + 5. Confirm if the issue is resolved or suggest next steps + + Common troubleshooting areas: + - Login and account access issues + - App installation and updates + - Feature functionality problems + - Data synchronization + - Performance issues + """ +) + +# Use the troubleshooting agent +troubleshooting_response = troubleshooting_agent.start("The app keeps crashing when I try to open it on my iPhone") +print(troubleshooting_response) +``` + +## Building a Conversational Support Agent + +Let's create a support agent that can handle multi-turn conversations: + +```python +conversational_support = Agent( + name="ConversationalSupport", + instructions=""" + You are a customer support representative who handles support conversations. + + When handling support conversations: + 1. Maintain context throughout the conversation + 2. Ask follow-up questions when needed + 3. Verify understanding before providing solutions + 4. Be patient with users who may be frustrated + 5. Summarize the conversation and next steps at the end + + Our product is a mobile banking app with features for: + - Account balance checking + - Money transfers + - Bill payments + - Mobile check deposits + - Budget tracking + """ +) + +# Start a support conversation +initial_response = conversational_support.start("I can't find where to deposit checks in the app") +print("Initial Response:", initial_response) + +# Continue the conversation +follow_up_response = conversational_support.continue("I'm using version 2.5 of the app on Android") +print("Follow-up Response:", follow_up_response) + +# Further continuation +resolution_response = conversational_support.continue("I found the deposit button now, but it's giving me an error when I try to take a photo") +print("Resolution Response:", resolution_response) +``` + +## Support Ticket Creation Agent + +Let's create an agent that can gather information for support tickets: + +```python +ticket_agent = Agent( + name="TicketCreationAgent", + instructions=""" + You are a support ticket creation specialist who gathers the necessary information to create support tickets. + + When creating a ticket: + 1. Collect the customer's name and contact information + 2. Identify the category of the issue + 3. Gather a detailed description of the problem + 4. Determine the severity level + 5. Collect relevant technical details (device, software version, etc.) + 6. Organize all information in a structured ticket format + + Present the final ticket in a clearly formatted structure. + """ +) + +# Use the ticket creation agent +ticket = ticket_agent.start( + """ + Create a support ticket for the following issue: + + Customer: Jane Smith + Email: jane.smith@example.com + Issue: Cannot access premium features after payment + Details: Completed payment yesterday, received confirmation email, but premium features are still locked in the app + Using: iPhone 13, app version 3.2.1 + """ +) +print(ticket) +``` + +## Customer Support Best Practices + + + + Show understanding before offering solutions + + + Use simple language, avoid jargon + + + Provide consistent answers to similar questions + + + Have clear processes for escalating complex issues + + + +In the next lesson, we'll explore how to build AI agents that can assist with personal productivity tasks. diff --git a/docs/course/agents/19-personal-assistant-agents.mdx b/docs/course/agents/19-personal-assistant-agents.mdx new file mode 100644 index 0000000..6ac420b --- /dev/null +++ b/docs/course/agents/19-personal-assistant-agents.mdx @@ -0,0 +1,270 @@ +--- +title: "Personal Assistant Agents" +description: "Building agents that help with personal tasks and productivity" +icon: "calendar-check" +--- + +# Personal Assistant Agents + +Personal assistant agents can help users manage tasks, organize information, and increase productivity. In this lesson, we'll learn how to build effective personal assistant agents. + +## What is a Personal Assistant Agent? + +A personal assistant agent is designed to: +- Manage tasks and reminders +- Organize information +- Answer questions +- Provide recommendations +- Help with personal productivity + +## Creating a Basic Personal Assistant Agent + +Let's start by building a simple personal assistant agent: + +```python +from praisonaiagents import Agent + +# Create a basic personal assistant agent +assistant_agent = Agent( + name="PersonalAssistant", + instructions=""" + You are a helpful personal assistant who helps users manage tasks and information. + + When assisting users: + 1. Be concise and efficient in your responses + 2. Prioritize user requests based on importance and urgency + 3. Maintain a helpful, friendly tone + 4. Remember important information the user shares + 5. Proactively suggest relevant information when appropriate + """, + llm="gpt-4o-mini" # Using the specified model +) + +# Use the personal assistant agent +response = assistant_agent.start("I need to plan a meeting with my team next Tuesday at 2 PM") +print(response) +``` + +## Task Management Assistant + +Let's create an agent specialized in task management: + +```python +task_agent = Agent( + name="TaskManager", + instructions=""" + You are a task management assistant who helps users organize and prioritize tasks. + + When managing tasks: + 1. Help identify and clarify tasks + 2. Assist with prioritization + 3. Break down complex tasks into manageable steps + 4. Track deadlines and progress + 5. Provide reminders and follow-ups + + For each task, collect: + - Task description + - Priority (High, Medium, Low) + - Deadline (if applicable) + - Dependencies (other tasks that must be completed first) + - Estimated time required + """, + llm="gpt-4o-mini" # Using the specified model +) + +# Use the task management agent +task_response = task_agent.start( + """ + I need help organizing these tasks for the week: + + - Prepare quarterly report (due Friday) + - Meet with client about new project (Wednesday, 2 PM) + - Review team's project proposals + - Finish budget planning for next quarter + - Send feedback on marketing materials + """ +) +print(task_response) +``` + +## Information Organization Assistant + +Let's create an agent that helps organize information: + +```python +info_agent = Agent( + name="InformationOrganizer", + instructions=""" + You are an information organization assistant who helps users structure and categorize information. + + When organizing information: + 1. Identify the main categories and topics + 2. Create logical groupings + 3. Suggest clear labels and headers + 4. Establish relationships between different pieces of information + 5. Present information in a structured, easily navigable format + """, + llm="gpt-4o-mini" # Using the specified model +) + +# Use the information organization agent +info_response = info_agent.start( + """ + Help me organize my research notes on climate change: + + - Rising sea levels affecting coastal cities + - Carbon dioxide levels increasing annually + - Renewable energy adoption statistics by country + - Impact of deforestation on carbon sequestration + - Climate policy differences between EU and US + - Economic impacts of extreme weather events + - Public opinion polls on climate action + - Arctic ice sheet measurements over 50 years + - Agricultural adaptations to changing climate + """ +) +print(info_response) +``` + +## Daily Planning Assistant + +Let's create an agent that helps with daily planning: + +```python +planning_agent = Agent( + name="DailyPlanner", + instructions=""" + You are a daily planning assistant who helps users organize their day efficiently. + + When helping with daily planning: + 1. Prioritize tasks based on importance and deadlines + 2. Consider time constraints and commitments + 3. Suggest efficient scheduling + 4. Allow for breaks and transitions + 5. Balance work tasks with personal needs + + Create a structured daily plan with time blocks and priorities. + """, + llm="gpt-4o-mini" # Using the specified model +) + +# Use the daily planning agent +planning_response = planning_agent.start( + """ + Help me plan my day tomorrow. I have: + + - A team meeting from 9:30-10:30 AM + - A report due by end of day + - Emails to catch up on (about 1 hour's worth) + - Lunch with a colleague at 12:30 PM + - A dentist appointment at 3:00 PM (will take about 1 hour including travel) + - Need to prepare a presentation for Friday + + I typically work from 8:30 AM to 5:30 PM and prefer to have short breaks between tasks. + """ +) +print(planning_response) +``` + +## Decision Support Assistant + +Let's create an agent that helps with decision-making: + +```python +decision_agent = Agent( + name="DecisionSupport", + instructions=""" + You are a decision support assistant who helps users make informed choices. + + When supporting decisions: + 1. Help clarify the decision to be made + 2. Identify relevant criteria and factors + 3. Present pros and cons for each option + 4. Ask questions to understand preferences and priorities + 5. Provide a structured analysis without making the final decision + + Present options with balanced information to help the user make their own informed choice. + """, + llm="gpt-4o-mini" # Using the specified model +) + +# Use the decision support agent +decision_response = decision_agent.start( + """ + I'm trying to decide whether to buy a new laptop now or wait 3 months. + + Current situation: + - My current laptop is 4 years old and running slow + - It still works but has battery issues + - I use it daily for work (programming and video calls) + - I've heard new models are coming out in 3 months + - My budget is around $1,500 + + What should I consider in making this decision? + """ +) +print(decision_response) +``` + +## Recommendation Assistant + +Let's create an agent that provides personalized recommendations: + +```python +recommendation_agent = Agent( + name="RecommendationAssistant", + instructions=""" + You are a recommendation assistant who provides personalized suggestions. + + When making recommendations: + 1. Understand the user's preferences and requirements + 2. Consider constraints (budget, time, location, etc.) + 3. Provide diverse options that match the criteria + 4. Explain why each recommendation might be suitable + 5. Give enough detail for the user to evaluate options + + For each recommendation, include: + - A brief description + - Key features or highlights + - Why it matches the user's needs + """, + llm="gpt-4o-mini" # Using the specified model +) + +# Use the recommendation agent +recommendation_response = recommendation_agent.start( + """ + Can you recommend some books for me? I enjoy: + + - Science fiction and fantasy + - Books with complex, morally gray characters + - Intricate world-building + - Books that explore philosophical themes + + I've recently read and enjoyed: + - "The Fifth Season" by N.K. Jemisin + - "Dune" by Frank Herbert + - "The Lies of Locke Lamora" by Scott Lynch + """ +) +print(recommendation_response) +``` + +## Personal Assistant Best Practices + + + + Be careful with personal information + + + Adapt to the user's preferences + + + Keep responses direct and easy to understand + + + Remember relevant context from previous interactions + + + +In the next lesson, we'll explore how to deploy and share your AI agents with others. diff --git a/docs/course/agents/20-deploying-agents.mdx b/docs/course/agents/20-deploying-agents.mdx new file mode 100644 index 0000000..6b0546c --- /dev/null +++ b/docs/course/agents/20-deploying-agents.mdx @@ -0,0 +1,342 @@ +--- +title: "Deploying Agents" +description: "How to deploy and share your AI agents with others" +icon: "rocket" +--- + +# Deploying Agents + +After creating your AI agents, the next step is deploying them for use by yourself or others. In this final lesson, we'll explore different deployment options and best practices. + +## Deployment Options + +There are several ways to deploy your AI agents: + +### 1. Local Deployment + +Running your agents locally is the simplest approach: + +```python +from praisonaiagents import Agent + +def run_local_agent(): + agent = Agent( + name="SimpleAgent", + instructions="You are a helpful assistant that answers questions concisely.", + llm="gpt-4o-mini" # Using the specified model + ) + + while True: + user_input = input("Ask a question (type 'exit' to quit): ") + if user_input.lower() == 'exit': + break + + response = agent.start(user_input) + print("\nAgent response:") + print(response) + print("\n" + "-"*50 + "\n") + +if __name__ == "__main__": + run_local_agent() +``` + +### 2. Web Application Deployment + +You can deploy your agents as part of a web application: + +```python +from flask import Flask, request, jsonify +from praisonaiagents import Agent +import os + +app = Flask(__name__) + +# Create agent once at startup +support_agent = Agent( + name="SupportAgent", + instructions="You are a customer support agent that helps users with product questions.", + llm="gpt-4o-mini" # Using the specified model +) + +@app.route('/api/support', methods=['POST']) +def get_support(): + data = request.json + user_query = data.get('query', '') + + if not user_query: + return jsonify({"error": "No query provided"}), 400 + + try: + response = support_agent.start(user_query) + return jsonify({"response": response}) + except Exception as e: + return jsonify({"error": str(e)}), 500 + +if __name__ == "__main__": + app.run(debug=True, port=5000) +``` + +### 3. Serverless Function Deployment + +For scalable, event-driven deployments, serverless functions work well: + +```python +# Example AWS Lambda function +import json +from praisonaiagents import Agent + +# Initialize agent outside the handler for reuse across invocations +agent = Agent( + name="ServerlessAgent", + instructions="You provide concise, helpful responses to user questions.", + llm="gpt-4o-mini" # Using the specified model +) + +def lambda_handler(event, context): + try: + # Get the user query from the event + body = json.loads(event.get('body', '{}')) + user_query = body.get('query', '') + + if not user_query: + return { + 'statusCode': 400, + 'body': json.dumps({'error': 'No query provided'}) + } + + # Process with the agent + response = agent.start(user_query) + + return { + 'statusCode': 200, + 'body': json.dumps({'response': response}) + } + except Exception as e: + return { + 'statusCode': 500, + 'body': json.dumps({'error': str(e)}) + } +``` + +## Environment Variables and Security + +When deploying agents, it's crucial to handle API keys and secrets securely: + +```python +import os +from dotenv import load_dotenv +from praisonaiagents import Agent + +# Load environment variables from .env file +load_dotenv() + +# Access API key from environment variable +api_key = os.getenv("OPENAI_API_KEY") + +# Create agent with API key +agent = Agent( + name="SecureAgent", + instructions="You are a helpful assistant.", + llm="gpt-4o-mini", # Using the specified model + api_key=api_key # Pass API key securely +) +``` + +## Creating a Simple Chat Interface + +Here's a simple command-line chat interface for your agent: + +```python +import os +from praisonaiagents import Agent + +def create_chat_interface(): + # Initialize agent + agent = Agent( + name="ChatAgent", + instructions=""" + You are a conversational assistant that maintains context throughout the conversation. + Respond in a helpful, concise manner. + """, + llm="gpt-4o-mini" # Using the specified model + ) + + print("Chat with AI Assistant (type 'exit' to quit)") + print("-" * 50) + + # Start conversation + conversation_active = True + first_message = True + + while conversation_active: + # Get user input + user_message = input("You: ") + + # Check if user wants to exit + if user_message.lower() == 'exit': + print("Goodbye!") + conversation_active = False + continue + + # Get agent response + try: + if first_message: + response = agent.start(user_message) + first_message = False + else: + response = agent.continue(user_message) + + print("\nAssistant:", response) + print("\n" + "-" * 50) + except Exception as e: + print(f"Error: {str(e)}") + +if __name__ == "__main__": + create_chat_interface() +``` + +## Scaling Considerations + +As you deploy agents for wider use, consider these scaling factors: + + + + Implement rate limiting to manage API usage and costs + + + Cache common responses to improve performance and reduce API calls + + + Implement robust error handling for API failures + + + Set up monitoring for usage patterns and performance issues + + + +## Best Practices for Deployment + +### 1. Testing Before Deployment + +Always test your agents thoroughly before deployment: + +```python +def test_agent_functionality(): + """Test basic agent functionality with various inputs""" + agent = Agent( + name="TestAgent", + instructions="You are a helpful assistant for testing.", + llm="gpt-4o-mini" # Using the specified model + ) + + test_cases = [ + "What is artificial intelligence?", + "How do I reset my password?", + "Tell me about machine learning" + ] + + for test_case in test_cases: + print(f"\nTesting: {test_case}") + response = agent.start(test_case) + print(f"Response: {response[:100]}...") # Print first 100 chars + + # Add assertions or validation logic here + assert len(response) > 0, "Response should not be empty" +``` + +### 2. Documentation + +Create clear documentation for users of your agent: + +```python +""" +# Customer Support Agent API + +This API provides access to an AI customer support agent +that can answer questions about our products. + +## Authentication + +Include your API key in the request header: +``` +Authorization: Bearer YOUR_API_KEY +``` + +## Endpoints + +POST /api/support +- Request body: {"query": "Your question here"} +- Response: {"response": "Agent's answer"} + +## Example + +```python +import requests + +response = requests.post( + "https://api.example.com/api/support", + headers={"Authorization": "Bearer YOUR_API_KEY"}, + json={"query": "How do I reset my password?"} +) + +print(response.json()) +``` +""" +``` + +### 3. Version Control + +Implement version control for your agents to track changes: + +```python +class VersionedAgent: + def __init__(self, name, version, instructions): + self.name = name + self.version = version + self.agent = Agent( + name=f"{name}_v{version}", + instructions=instructions, + llm="gpt-4o-mini" # Using the specified model + ) + + def get_response(self, query): + response = self.agent.start(query) + return { + "agent_name": self.name, + "version": self.version, + "response": response, + "timestamp": datetime.now().isoformat() + } +``` + +## Conclusion + +Congratulations on completing the AI Agents Course! You've learned how to: + +1. Understand different types of AI agents and their architectures +2. Create effective agent instructions and tools +3. Implement memory and context for your agents +4. Build specialized agents for various tasks +5. Create multi-agent systems +6. Deploy your agents for real-world use + +As AI agent technology continues to evolve, keep experimenting with new capabilities and use cases. Remember that the best agents are those that effectively solve real problems for users while being trustworthy, reliable, and helpful. + +We hope this course has provided you with the knowledge and skills to build powerful AI agents that enhance productivity and creativity! + +## Next Steps + + + + Participate in discussions and share your agent projects + + + Follow updates in AI agent technology and new features + + + Let us know how you're using agents and what you'd like to learn next + + + Apply your knowledge to build solutions for real-world problems + + diff --git a/docs/mint.json b/docs/mint.json index 676913c..25298a5 100644 --- a/docs/mint.json +++ b/docs/mint.json @@ -78,6 +78,10 @@ { "name": "JS", "url": "/js" + }, + { + "name": "Course", + "url": "/course" } ], "navigation": [ @@ -154,6 +158,31 @@ "models/other" ] }, + { + "group": "Course", + "pages": [ + "course/agents/01-introduction", + "course/agents/02-types-of-agents", + "course/agents/03-agent-architecture", + "course/agents/04-agent-instructions", + "course/agents/05-agent-tools", + "course/agents/06-agent-memory", + "course/agents/07-multi-agent-systems", + "course/agents/08-agent-process", + "course/agents/09-knowledge-bases", + "course/agents/10-agent-tasks", + "course/agents/11-creating-your-first-agent", + "course/agents/12-adding-tools-to-agents", + "course/agents/13-building-multi-agent-system", + "course/agents/14-conversational-agents", + "course/agents/15-research-agents", + "course/agents/16-content-creation-agents", + "course/agents/17-data-analysis-agents", + "course/agents/18-customer-support-agents", + "course/agents/19-personal-assistant-agents", + "course/agents/20-deploying-agents" + ] + }, { "group": "Examples", "pages": [