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.
- 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.
python -m venv .venv
.\.venv\Scripts\activate # PowerShell on Windows
pip install -U pip
pip install -r requirements.txtThis 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_teamOption B: run the file directly
python agent/research_team.pyYou should see AgentOS available at:
http://localhost:9001/config– app configurationhttp://localhost:9001/agui– AGUI interface
POST /documents/upload– Upload a document into Pinecone-backed knowledge base- Supported:
.pdf,.csv,.txt,.docx
- Supported:
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 }– savedoc_idto delete later
- Body:
DELETE /documents/{doc_id}– Delete a document by itsdoc_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>"agent/research_team.py– defines agents, team, AgentOS app, and document endpointsagent/document_utils.py– helpers for uploading/deleting docs in the knowledge baserequirements.txt– Python dependencies
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.
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.
- 401/403 from OpenAI or Pinecone: verify
.envvalues are loaded and the PowerShell session is restarted. - Next.js cannot reach the agent: confirm the AgentOS server is listening on
9001and the URL inAgnoAgentmatches. - Uploading files fails: only
.pdf,.csv,.txt,.docxare supported by default.