Skip to content

Avyakta000/agno-agent

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

3 Commits
 
 
 
 
 
 
 
 

Repository files navigation

Agno AgentOS Research Team

An AgentOS FastAPI app that exposes a multi‑agent research team using the agno framework. It includes:

  • Web research via DuckDuckGo
  • Finance lookups via Yahoo Finance (with NSE/BSE symbol handling)
  • RAG document QA backed by Pinecone
  • Image analysis/generation via DALL·E

Also provides upload/delete endpoints to manage your knowledge base and an AGUI interface compatible with CopilotKit.


Prerequisites

  • Python 3.10+
  • API keys in .env:
OPENAI_API_KEY=sk-...
PINECONE_API_KEY=...

Optional: set any other environment variables your OpenAI/Pinecone accounts need.


Install

python -m venv .venv
.\.venv\Scripts\activate  # PowerShell on Windows
pip install -U pip
pip install -r requirements.txt

Run the server

This project exposes a FastAPI app at agent.research_team:app and includes a main entrypoint that serves AgentOS on port 9001 (for Dojo/CopilotKit compatibility).

Option A: run the module (recommended)

python -m agent.research_team

Option B: run the file directly

python agent/research_team.py

You should see AgentOS available at:

  • http://localhost:9001/config – app configuration
  • http://localhost:9001/agui – AGUI interface

API Endpoints

  • POST /documents/upload – Upload a document into Pinecone-backed knowledge base
    • Supported: .pdf, .csv, .txt, .docx
  • POST /documents/url – Ingest website content into the knowledge base
    • Body: { "url": "https://example.com", "max_links": 5 }
    • Returns: { status, url, max_links, doc_id } – save doc_id to delete later
  • DELETE /documents/{doc_id} – Delete a document by its doc_id

Example: upload a file via curl (PowerShell uses --data-binary for raw bodies)

curl -X POST "http://localhost:9001/documents/upload" ^
  -H "Content-Type: multipart/form-data" ^
  -F "file=@path\\to\\your.pdf"

Example: delete a document

curl -X DELETE "http://localhost:9001/documents/<doc_id>"

Example: ingest a website (crawl up to 5 links from the page)

curl -X POST "http://localhost:9001/documents/url" \
  -H "Content-Type: application/json" \
  -d '{"url": "https://docs.agno.com/introduction", "max_links": 5}'

Then delete the ingested website content by doc_id:

curl -X DELETE "http://localhost:9001/documents/<doc_id>"

Project Structure (high level)

  • agent/research_team.py – defines agents, team, AgentOS app, and document endpoints
  • agent/document_utils.py – helpers for uploading/deleting docs in the knowledge base
  • requirements.txt – Python dependencies

Next.js (App Router) integration with CopilotKit

Use CopilotKit to connect your Next.js app to this AgentOS backend. Create app/api/copilotkit/route.ts (or src/app/api/copilotkit/route.ts depending on your setup) with:

import { NextRequest } from "next/server";
import {
  CopilotRuntime,
  EmptyAdapter,
  copilotRuntimeNextJSAppRouterEndpoint,
} from "@copilotkit/runtime";
import { AgnoAgent } from "@ag-ui/agno";

const serviceAdapter = new EmptyAdapter();

const runtime = new CopilotRuntime({
  agents: {
    // FastAPI AgentOS URL (port must match your backend)
    // @ts-ignore for now
    agno_agent: new AgnoAgent({ url: "http://localhost:9001/agui" }),
  },
});

export const POST = async (req: NextRequest) => {
  const { handleRequest } = copilotRuntimeNextJSAppRouterEndpoint({
    runtime,
    serviceAdapter,
    endpoint: "/api/copilotkit",
  });

  return handleRequest(req);
};

Notes:

  • Ensure the backend is running on http://localhost:9001 (or update the URL).
  • If developing Next.js and FastAPI on different origins, configure CORS on your FastAPI app as needed.

Pinecone setup

The app uses a Pinecone vector DB named pinecone-vdb-hybrid-search with serverless spec aws/us-east-1. Make sure the index exists or the SDK has permissions to create it with your PINECONE_API_KEY.


Troubleshooting

  • 401/403 from OpenAI or Pinecone: verify .env values are loaded and the PowerShell session is restarted.
  • Next.js cannot reach the agent: confirm the AgentOS server is listening on 9001 and the URL in AgnoAgent matches.
  • Uploading files fails: only .pdf, .csv, .txt, .docx are supported by default.

About

No description, website, or topics provided.

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

 
 
 

Contributors

Languages