Introduction
Agno is a framework for building AI agents that can use tools, access knowledge bases, and work together in teams. This notebook demonstrates how to use Agno with Together AI's language models to create powerful AI applications with different capabilities.
In this notebook, we'll explore:
- Setting up a simple agent with web search capability
- Creating an agent with a knowledge base for specialized domains
- Building multi-agent systems where specialized agents work together
Install required packages for this notebook
- agno: The agent framework we'll be using
- duckduckgo-search: For web search capabilities
- pypdf: For processing PDF documents
- lancedb and tantivy: For vector storage
- yfinance: For financial data retrieval
ERROR: pip's dependency resolver does not currently take into account all the packages that are installed. This behaviour is the source of the following dependency conflicts. dspy 2.6.10 requires datasets<3.0.0,>=2.14.6, but you have datasets 3.5.0 which is incompatible.
Simple Agent
Below we create a basic agent that can search the web to answer questions. This agent uses:
- The Meta-Llama-3.1-8B-Instruct-Turbo
- DuckDuckGo search as a tool to retrieve information from the web
When we run this agent with a question about the NBA, it will search for recent information and provide an answer.
Output()
Agent with Knowledge Base
This example demonstrates how to create an agent with specialized knowledge. We'll build a Thai cuisine expert by:
- Loading a PDF containing Thai recipes into a knowledge base
- Setting up a vector database to store and retrieve this information efficiently
- Configuring the agent to prioritize its knowledge base while still being able to search the web
This type of agent is ideal for specialized domains where you want to combine proprietary knowledge with the ability to find supplementary information.
Output()
Output()
Multi-Agent System
This example demonstrates how to create a team of specialized agents that work together. We'll build:
- A web search agent for finding general information
- A finance agent for retrieving financial data
- A coordinator agent that delegates tasks to the specialized agents
This approach allows us to create more powerful systems by combining specialized capabilities.
Output()
In this notebook, we've demonstrated three approaches to building AI agents with Agno and Together AI:
- Simple Agent: Quick to set up and useful for general tasks that require web search
- Knowledge Base Agent: Combines specialized knowledge with web search for domain-specific applications
- Multi-Agent System: Coordinates specialized agents for complex tasks requiring different capabilities
These examples show the flexibility of the Agno framework for building various types of AI applications. You can extend these examples by:
- Adding more tools to enhance capabilities
- Building larger knowledge bases for deeper expertise
- Creating more specialized agents for complex multi-agent systems
