Agno Agents with Together AI

Open In Colab

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:

  1. Setting up a simple agent with web search capability
  2. Creating an agent with a knowledge base for specialized domains
  3. 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
[3]
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.

[10]
Output()

Agent with Knowledge Base

This example demonstrates how to create an agent with specialized knowledge. We'll build a Thai cuisine expert by:

  1. Loading a PDF containing Thai recipes into a knowledge base
  2. Setting up a vector database to store and retrieve this information efficiently
  3. 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.

[13]
Output()
Output()

Multi-Agent System

This example demonstrates how to create a team of specialized agents that work together. We'll build:

  1. A web search agent for finding general information
  2. A finance agent for retrieving financial data
  3. A coordinator agent that delegates tasks to the specialized agents

This approach allows us to create more powerful systems by combining specialized capabilities.

[14]
Output()

In this notebook, we've demonstrated three approaches to building AI agents with Agno and Together AI:

  1. Simple Agent: Quick to set up and useful for general tasks that require web search
  2. Knowledge Base Agent: Combines specialized knowledge with web search for domain-specific applications
  3. 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