From agno-agentos-api
Interact with AgentOS Knowledge API endpoints. For standard operations (listing content, uploading files, searching, deleting), use the provided CLI script first. Only write custom Python when the script cannot handle the use case (e.g., pagination, updating metadata, bulk workflows, get config). Trigger when: uploading documents, searching the knowledge base, listing content, or asking things like "upload this md file to my knowledge base" or "search my docs for X."
How this skill is triggered — by the user, by Claude, or both
Slash command
/agno-agentos-api:agentos-api-knowledgeThe summary Claude sees in its skill listing — used to decide when to auto-load this skill
Start an AgentOS server with knowledge configured:
Start an AgentOS server with knowledge configured:
from agno.agent import Agent
from agno.models.anthropic import Claude
from agno.db.sqlite import SqliteDb
from agno.knowledge.knowledge import Knowledge
from agno.knowledge.embedder.openai import OpenAIEmbedder
from agno.vectordb.chroma import ChromaDb
from agno.os import AgentOS
db = SqliteDb(db_file="tmp/app.db")
knowledge = Knowledge(
vector_db=ChromaDb(
path="tmp/chromadb",
collection="docs",
embedder=OpenAIEmbedder(id="text-embedding-3-small"),
),
contents_db=db, # Required for upload/management endpoints
)
agent = Agent(
name="Knowledge Agent",
model=Claude(id="claude-sonnet-4-5"),
knowledge=knowledge,
search_knowledge=True,
db=db,
)
agent_os = AgentOS(agents=[agent], knowledge=[knowledge])
agent_os.serve()
Always try the provided script first. It covers listing content, uploading files, uploading raw text, searching the knowledge base, checking processing status, and deleting content — all from the command line with no custom code needed.
The script is at: scripts/manage_knowledge.py
uv run scripts/manage_knowledge.py --base-url http://localhost:7777
uv run scripts/manage_knowledge.py --base-url http://localhost:7777 \
--search "What is Agno?" --limit 5
uv run scripts/manage_knowledge.py --base-url http://localhost:7777 \
--upload README.md
uv run scripts/manage_knowledge.py --base-url http://localhost:7777 \
--upload-text "Agno is an AI agent framework" --name "Agno Intro"
uv run scripts/manage_knowledge.py --base-url http://localhost:7777 \
--status content-id-123
uv run scripts/manage_knowledge.py --base-url http://localhost:7777 \
--delete content-id-123
uv run scripts/manage_knowledge.py --help
Only write ad-hoc Python when the CLI script cannot handle your use case:
| Method | Path | Description |
|---|---|---|
| GET | /knowledge/config | Get knowledge config |
| GET | /knowledge/content | List all content (paginated) |
| GET | /knowledge/content/{content_id} | Get content by ID |
| GET | /knowledge/content/{content_id}/status | Get content status |
| POST | /knowledge/search | Search knowledge base |
| POST | /knowledge/content | Upload content |
| PATCH | /knowledge/content/{content_id} | Update content metadata |
| DELETE | /knowledge/content | Delete all content |
| DELETE | /knowledge/content/{content_id} | Delete content by ID |
import asyncio
from agno.client import AgentOSClient
async def main():
client = AgentOSClient(base_url="http://localhost:7777")
config = await client.get_knowledge_config()
print(f"Readers: {config.readers if hasattr(config, 'readers') else 'N/A'}")
print(f"Chunkers: {config.chunkers if hasattr(config, 'chunkers') else 'N/A'}")
asyncio.run(main())
async def main():
client = AgentOSClient(base_url="http://localhost:7777")
content = await client.list_knowledge_content()
print(f"Found {len(content.data)} content items")
for item in content.data:
print(f" {item.id}: {item.name} ({item.status})")
Supports pagination via limit and page parameters, and sorting via sort_by and sort_order.
updated = await client.update_content(
content_id="content-id-here",
name="Updated Name",
description="Updated description",
)
await client.delete_all_content()
import asyncio
from agno.client import AgentOSClient
async def main():
client = AgentOSClient(base_url="http://localhost:7777")
# Upload
result = await client.upload_knowledge_content(
text_content="""
# Agno Framework Guide
Agno is a powerful framework for building AI agents.
Key features: agent creation, team coordination, workflows.
""",
name="Agno Guide",
description="A guide to the Agno framework",
)
print(f"Uploaded: {result.id}")
# Check status
status = await client.get_content_status(result.id)
print(f"Status: {status.status}")
# Search
results = await client.search_knowledge(query="What is Agno?", limit=5)
for r in results.data:
print(f" {str(r.content)[:100]}...")
# List
content = await client.list_knowledge_content()
print(f"Total items: {len(content.data)}")
asyncio.run(main())
contents_db= on Knowledge — required for upload/management endpointsknowledge=[...] on AgentOS — registers knowledge API endpointsFor advanced knowledge API patterns, read references/api-patterns.md.
npx claudepluginhub ajshedivy/agno-cookbook --plugin agno-agentos-apiInjects relevant prior knowledge from .agents context into the current session. Deprecated legacy adapter; prefer `ao lookup` for on-demand retrieval.
Adds public websites, SharePoint sites, or custom APIs as knowledge sources to Copilot Studio agents by parsing URLs, normalizing SharePoint paths, and generating YAML configs.
Queries the knowledge base with a question, synthesizes answers from relevant KB files using keyword matching and indexes, and optionally files results as new KB articles.