agentleFS
agno-agiagno-agi/demo-os/CLAUDE.md

demo-os

CLAUDE.md35 starsChanged 6 months agoApache-2.0View on GitHub

This file provides context for Claude Code when working with this repository. AgentOS - A multi-agent demo system built by Agno showcasing Agno framework features (6 agents, 4 teams, 6 workflows, 3 multi-framework agents). All agents share: - PostgreSQL database (pgvector) for persistence - OpenAI GPT-5.4 model (configured in app/settings.py) - Chat history and context management

  • Reads credentials
  • In this repositoryOne other file it gives its agents.

The file

We split this CLAUDE.md into the rules it gives an agent

9 rules. About 0 are common, 5 are distinctive, and 4 are very specific to this project.

  • ≈0

    Common · estimate

    Many files like this have a rule of this kind.

  • ≈5

    Distinctive · estimate

    This author's own choices. Worth a look.

  • 4

    Very specific

    Tied to their project's names, files or tools. Probably skip.

  • Common
  • Distinctive
  • Very specific
  1. Distinctive:

    Use the venv setup script to create the development environment:

    line 79
  2. Distinctive:

    Always run format and lint checks using the venv Python interpreter:

    line 88
  3. Distinctive:

    All Agent, Team, and Workflow constructors follow a strict parameter ordering convention.

    line 99
  4. Distinctive:

    When adding or editing constructors, always follow the group order below.

    line 100
  5. Very specific:

    All agent, team, and workflow files use # --- section headers to separate logical blocks.

    line 184
  6. Distinctive:

    All standalone agents follow this structure:

    line 209
  7. Very specific:

    Use get_postgres_db() from db module

    line 264
  8. Very specific:

    Create agents/new_agent/ directory following the agent pattern above (with agent.py, instructions.py, __init__.py)

    line 310
  9. Very specific:

    Add quick prompts to app/config.yaml using the agent's id

    line 320

≈ “Common” is an estimate: at least 1 in 5 of the 12,729 CLAUDE.md files we read have a rule of the same kind, not the same words. “Very specific” is our guess from the words: it names a file, a command, a setting or the project itself.

Keep what fits and drop the rest. Your version, ready for your agents.
Files
CLAUDE.md

CLAUDE.md

This file provides context for Claude Code when working with this repository.

Project Overview

AgentOS - A multi-agent demo system built by Agno showcasing Agno framework features (6 agents, 4 teams, 6 workflows, 3 multi-framework agents).

Architecture

AgentOS (app/main.py)
├── Agents (7)
│   ├── Agno Expert (agents/mcp/)                                 # Agno documentation agent via MCP
│   ├── Voyager (agents/travel/)                            # Travel booking — HITL + guardrails
│   ├── Operator (agents/infra/)                            # Approvals + Skills + structured output
│   ├── Builder (agents/builder/)                            # Builds you an assistant from a conversation (StudioTool + HITL)
│   ├── Researcher (agents/reporter/)                              # Web research + HTML report generation
│   ├── Media Lab (agents/studio/)                               # Multimodal media (DALL-E, TTS, FAL, Luma)
│   └── Planner (agents/taskboard/)                            # Session state + agentic state
├── Multi-Framework Agents (3)
│   ├── Repo Explainer (frameworks/claude_repo/)                 # Claude Agent SDK — explains GitHub repos
│   ├── Forum (frameworks/langgraph_debate/)                # LangGraph — parallel Pro/Con + Judge
│   └── Abacus (frameworks/dspy_math/)                      # DSPy — ChainOfThought word problems
├── Teams (4)
│   ├── Dash (agents/dash/)                                      # Data analyst (team, coordinate)
│   ├── Newsroom (teams/research/)                    # Research team (coordinate mode)
│   ├── Clinic (teams/clinic/)                     # Patient assistant (context provider + filtered records)
│   └── Mentor (teams/coach/)                      # Learning coach (LearningMachine: profile, memory, session context, knowledge, decisions; followups)
└── Workflows (6)
    ├── AI Digest (workflows/ai_research/)                     # Daily parallel AI research (scheduled)
    ├── Scribe (workflows/content_pipeline/)           # Parallel + loop + condition
    ├── Code Scout (workflows/repo_walkthrough/)                 # Code → script → narrated audio
    ├── Classifier (workflows/classifier/)                       # Router + condition + multi-source intake
    └── Support Bot (workflows/support_bot/)             # Step-level HITL troubleshooting

All agents share:

  • PostgreSQL database (pgvector) for persistence
  • OpenAI GPT-5.4 model (configured in app/settings.py)
  • Chat history and context management

Key Files

FilePurpose
app/main.pyAgentOS entry point, registers all agents, teams, workflows
app/config.yamlQuick prompts for each agent
app/settings.pyShared MODEL, agent_db, and environment flags
app/usage.pyPer-user usage limits (burst rate limit, daily quota, absolute cap; PostHog flag overrides) on REST run endpoints and the workflow WebSocket, plus the admin /usage inspect/reset API
app/registry.pyShared tools, models, and database connections
agents/mcp/agent.pyAgno Expert - Agno documentation agent via live MCP tools
agents/travel/agent.pyVoyager - HITL + guardrails (moderation, PII, injection, output)
agents/infra/agent.pyOperator - infra change agent (blocking approvals + Skills + structured output)
agents/reporter/agent.pyResearcher - web research (Exa) + HTML report generation
agents/studio/agent.pyMedia Lab - multimodal media generation (DALL-E, FAL, ElevenLabs, Luma)
agents/taskboard/agent.pyPlanner - session state + agentic state demo
frameworks/claude_repo/agent.pyRepo Explainer - Claude Agent SDK with WebSearch/WebFetch
frameworks/langgraph_debate/graph.pyForum - LangGraph graph with parallel branches
frameworks/langgraph_debate/agent.pyForum - LangGraphAgent wrapper
frameworks/dspy_math/agent.pyAbacus - DSPyAgent with typed ChainOfThought signature
agents/dash/team.pyDash team (Analyst, Engineer)
teams/research/team.pyNewsroom (coordinate mode)
teams/clinic/team.pyClinic — patient assistant (context provider + filtered records, fallback)
teams/coach/team.pyMentor — learning coach (LearningMachine: user profile, memory, session context, learned knowledge, decision log; followups)
workflows/ai_research/workflow.pyAI Digest (4 parallel researchers → synthesize)
workflows/content_pipeline/workflow.pyScribe (router, parallel, loop, HITL)
workflows/repo_walkthrough/workflow.pyCode Scout (analyze → script → narrate)
workflows/classifier/workflow.pyClassifier (classify source → route to specialist → deep-dive)
workflows/support_bot/workflow.pySupport Bot (capture error → step-level HITL env → search docs/web/GitHub)
db/session.pyget_postgres_db() and create_knowledge() helpers
db/url.pyBuilds database URL from environment
compose.yamlLocal development with Docker

Development Setup

Virtual Environment

Use the venv setup script to create the development environment:

./scripts/venv_setup.sh
source .venv/bin/activate

Format & Validation

Always run format and lint checks using the venv Python interpreter:

source .venv/bin/activate && ./scripts/format.sh
source .venv/bin/activate && ./scripts/validate.sh

Conventions

Parameter Ordering

All Agent, Team, and Workflow constructors follow a strict parameter ordering convention. When adding or editing constructors, always follow the group order below. Omit groups that don't apply — but never reorder within or across groups.

Agent parameter order:

# Identity
id, name, role                          # role for team members only

# Model
model, reasoning, reasoning_min_steps,  # reasoning params if applicable
reasoning_max_steps, fallback_models

# Data
db, knowledge, search_knowledge

# Capabilities
tools, skills,                          # what the agent can do
learning, add_learnings_to_context      # how the agent improves

# Instructions
instructions                            # what to do with all the above

# Hooks
pre_hooks, post_hooks

# Feature-specific (group by feature)
dependencies, add_dependencies_to_context
session_state, enable_agentic_state, add_session_state_to_context
compress_tool_results, compression_manager

# Memory
enable_agentic_memory,
search_past_sessions, num_past_sessions_to_search

# Context
add_datetime_to_context, add_history_to_context,
read_chat_history, num_history_runs

# Output
markdown

Team parameter order:

# Identity
id, name, mode

# Model
model

# Members
members

# Data
db

# Capabilities
tools,
learning, add_learnings_to_context

# Instructions
instructions

# Collaboration
share_member_interactions, show_members_responses

# Memory
enable_agentic_memory,
search_past_sessions, num_past_sessions_to_search

# Context
add_datetime_to_context, add_history_to_context,
read_chat_history, num_history_runs

# Output
markdown

Workflow parameter order: id, name, steps

Section Headers

All agent, team, and workflow files use # --- section headers to separate logical blocks. Every file must have at least a # Create Agent, # Create Team, or # Create Workflow header before the main constructor. Files with additional code get descriptive headers for each block.

Common headers by file type:

File TypeHeaders
Simple agent# Create Agent
Agent with setup# Tools / # Dependencies / # Create Agent
Agent with hooks# Hooks (or descriptive name) / # Create Agent
Team with members# Members / # Create Team
Team with setup# Team Leader Tools / # Instructions / # Members / # Create Team
Workflow# Agents / # Helpers (if any) / # Create Workflow

Header format (75-char wide):

# ---------------------------------------------------------------------------
# Create Agent
# ---------------------------------------------------------------------------

Agent Pattern

All standalone agents follow this structure:

from agno.agent import Agent

from agents.my_agent.instructions import INSTRUCTIONS
from app.settings import MODEL, agent_db

# ---------------------------------------------------------------------------
# Create Agent
# ---------------------------------------------------------------------------
my_agent = Agent(
    id="my-agent",
    name="My Agent",
    model=MODEL,
    db=agent_db,
    tools=[...],
    instructions=INSTRUCTIONS,
    enable_agentic_memory=True,
    add_datetime_to_context=True,
    add_history_to_context=True,
    read_chat_history=True,
    num_history_runs=5,
    markdown=True,
)

Team Pattern (Dash)

Team-based agents have their own settings.py with specialized knowledge bases and DB engines:

from agno.team import Team, TeamMode

# ---------------------------------------------------------------------------
# Create Team
# ---------------------------------------------------------------------------
team = Team(
    id="my-team",
    name="My Team",
    mode=TeamMode.coordinate,
    model=MODEL,
    members=[agent1, agent2],
    db=agent_db,
    tools=[...],
    instructions=LEADER_INSTRUCTIONS,
    share_member_interactions=True,
    enable_agentic_memory=True,
    add_datetime_to_context=True,
    markdown=True,
)

Database

  • Use get_postgres_db() from db module
  • Important: The knowledge_table parameter is only needed when the database is provided to a Knowledge base as a contents_db.
# Agent WITH a Knowledge base
from db import create_knowledge

knowledge = create_knowledge("My Knowledge", "my_vectors")

# Agent WITHOUT a Knowledge base
agent_db = get_postgres_db()
  • Knowledge bases use PgVector with SearchType.hybrid
  • Embeddings use text-embedding-3-small

Imports

# Database
from db import db_url, get_postgres_db, create_knowledge

# Agents
from agents.mcp import mcp_agent
from agents.travel import travel
from agents.infra import infra
from agents.reporter import reporter
from agents.studio import studio
from agents.taskboard import taskboard

# Teams
from agents.dash import dash
from teams.research import research_coordinate
from teams.clinic import clinic
from teams.coach import coach_team

# Workflows
from workflows.ai_research import ai_research
from workflows.content_pipeline import content_pipeline
from workflows.repo_walkthrough import repo_walkthrough
from workflows.classifier import classifier
from workflows.support_bot import support_bot

Adding a New Agent

  1. Create agents/new_agent/ directory following the agent pattern above (with agent.py, instructions.py, __init__.py)
  2. Register in app/main.py:
    from agents.new_agent import new_agent
    
    agent_os = AgentOS(
        agents=[..., new_agent],
        ...
    )
  3. Add quick prompts to app/config.yaml using the agent's id

Commands

# Setup virtual environment
./scripts/venv_setup.sh
source .venv/bin/activate

# Local development with Docker
docker compose up -d --build

# Load knowledge for Dash
python -m agents.dash.scripts.load_knowledge

# Seed the Clinic team data (operational DB + patient records)
python -m teams.clinic.scripts.seed_clinic
python -m teams.clinic.scripts.load_records

# Format & validation (run from activated venv)
./scripts/format.sh
./scripts/validate.sh

# Run evals — smoke tests (fast, no LLM cost)
python -m evals smoke
python -m evals smoke --group agents
python -m evals smoke --group security
python -m evals smoke --group hitl
python -m evals smoke --entity agno-expert
python -m evals smoke --output --compare

# Run evals — reliability (tool call validation, no LLM cost)
python -m evals reliability
python -m evals reliability --entity voyager

# Run evals — Agno evals (AgentAsJudgeEval, AccuracyEval — LLM cost)
python -m evals
python -m evals --category security
python -m evals --category accuracy
python -m evals --category quality
python -m evals --verbose

# Run evals — performance baselines
python -m evals perf --update-baselines
python -m evals perf

# Auto-improvement loop (see docs/EVALS.md for full workflow)
python -m evals improve --entity agno-expert
python -m evals improve --failures
python -m evals improve --entity agno-expert --json

Environment Variables

Required:

  • OPENAI_API_KEY

Optional (model providers — each enables registry models in Studio):

  • ANTHROPIC_API_KEY - Claude Opus 4.7, Sonnet 4.6, Haiku 4.5
  • GOOGLE_API_KEY - Gemini 3 Flash, Gemini 2.5 Pro
  • GROQ_API_KEY - Llama 3.3 70B
  • DEEPSEEK_API_KEY - DeepSeek Chat, DeepSeek Reasoner
  • XAI_API_KEY - Grok 3
  • MISTRAL_API_KEY - Mistral Large

Optional (tools & integrations):

  • EXA_API_KEY - Web search for Researcher, AI Digest
  • PARALLEL_API_KEY - Parallel web search
  • ELEVEN_LABS_API_KEY - TTS for Media Lab, Code Scout
  • FAL_KEY - Image-to-image for Media Lab
  • LUMAAI_API_KEY - Video generation for Media Lab (LumaLab)
  • DUFFEL_API_TOKEN - Live flight search for Voyager (falls back to sample data if unset)
  • RESEND_API_KEY - Itinerary email for Voyager
  • VOYAGER_FROM_EMAIL - Sender address for Voyager's itinerary email (verified Resend domain; default onboarding@resend.dev)
  • DB_DRIVER - Database driver (default: postgresql+psycopg)
  • PORT - API server port (default: 8000)
  • DB_HOST, DB_PORT, DB_USER, DB_PASS, DB_DATABASE
  • RUNTIME_ENV - Set to dev for auto-reload, prd for RBAC auth
  • USAGE_LIMITS_ENABLED - Per-user usage limits on run endpoints (default: true)
  • USER_RATE_LIMIT_RPM - Max run requests per user per minute (default: 10)
  • USER_DAILY_RUN_LIMIT - Max runs per user per UTC day, persisted in Postgres (default: 20)
  • USER_TOTAL_RUN_LIMIT - Absolute cap on runs per user, ever (default: 200)
  • POSTHOG_API_KEY, POSTHOG_HOST - PostHog usage-limits feature flag: per-user JSON payload overrides for the limits (e.g. {"daily": 100}, {"enabled": false})
  • AGENTOS_URL - Scheduler callback URL (default: http://127.0.0.1:8000)
  • SLACK_TOKEN, SLACK_SIGNING_SECRET - Optional Slack interface (see docs/SLACK_CONNECT.md)

Documentation

  • docs/EVALS.md - Eval framework: smoke tests, reliability, accuracy, performance, improvement loop
  • docs/SLACK_CONNECT.md - Slack setup: app manifest, scopes, credentials, SlackTools vs Interface

Deployment

# Build Docker image
./scripts/build_image.sh

# Deploy to Railway (first time)
./scripts/railway_up.sh

# Redeploy to Railway
./scripts/railway_redeploy.sh

# Sync env vars to Railway
./scripts/railway_env.sh

Ports

  • API: 8000
  • Database: 5432

Feature Coverage

FeatureWhere
RAG / hybrid searchDash
MCP toolsAgno Expert, Dash, AI Digest
HITL — confirmationVoyager, Operator
HITL — user inputVoyager, Builder
HITL — external executionVoyager
Guardrails (moderation, PII, injection)Voyager
Output guardrailsVoyager
Pre/post hooksVoyager
User feedback (ask_user)Voyager, Builder
Approval — blockingOperator, Builder
Skills (LocalSkills, SKILL.md)Operator
Agent composition (StudioTool)Builder
Reasoning toolsDash
Structured output (Pydantic)Researcher, Operator
File generation (HTML)Researcher
Web research (Exa: search, company, crawl, fetch)Researcher
Learning (LearningMachine)Dash, Mentor
Learning — user profile + memoryMentor
Learning — session contextMentor
Learning — learned knowledge (playbooks)Mentor, Dash
Learning — decision logMentor
SQL toolsDash
Coding toolsCode Scout
Image generation (DALL-E)Media Lab
Image generation (Gemini NanoBanana)Registry
Image-to-image (FAL)Media Lab
Text-to-speech (ElevenLabs)Media Lab, Code Scout
Video generation (LumaLab)Media Lab
Sound effectsMedia Lab
Flight search (Duffel)Voyager
Email (Resend)Voyager
Team — coordinateDash, Newsroom, Builder
Context provider (live DB)Clinic
Knowledge filtering (per-patient)Clinic
Followups (suggested questions)Mentor
Fallback modelsClinic
Workflow — parallelAI Digest, Scribe
Workflow — loopScribe
Scheduling (cron)AI Digest
Parallel executionAI Digest, Scribe
Workflow — routerClassifier
Workflow — conditionClassifier
Document parsing (Docling)Classifier
Workflow — step-level HITL (user input)Support Bot
Workflow — HITL output reviewSupport Bot
Session state + agentic statePlanner, Builder
Cross-modal chainingCode Scout

Agno Framework Reference

Model Providers

from agno.models.openai import OpenAIResponses

model = OpenAIResponses(id="gpt-5.5")

from agno.models.anthropic import Claude

model = Claude(id="claude-sonnet-4-6")

from agno.models.google import Gemini

model = Gemini(id="gemini-3-flash-preview")

Knowledge & RAG

from agno.knowledge import Knowledge
from agno.knowledge.embedder.openai import OpenAIEmbedder
from agno.vectordb.pgvector import PgVector, SearchType

knowledge = Knowledge(
    name="My Knowledge Base",
    vector_db=PgVector(
        db_url=db_url,
        table_name="my_vectors",
        search_type=SearchType.hybrid,
        embedder=OpenAIEmbedder(id="text-embedding-3-small"),
    ),
    contents_db=get_postgres_db(knowledge_table="my_contents"),
)

Documentation Links

Download now (ZIP)

Does it work?

Reviews from people and from AI agents that ran it: what they used it for, and whether it worked.

No reviews yet

People and AI agents can review whether this works in practice. Say what you used it for, and whether it worked.

  • It worked
  • Partly
  • It didn't
What did you use it for? e.g. Reviewing pull requests in a Rails app

Using an agent? It can post a review for you after it has run the file: the MCP tool registry_write, action report. How to connect one.

Your trail

Files you open will collect here, so you can find them again.

Open two or more, and you can remix the rules you like from each into one list. Kept in this browser only.

Now do this for your own.

Bring your CLAUDE.md, AGENTS.md or skills. agentleFS shows which of your rules are common, which are yours and which only fit one project, and keeps one version your agents read everywhere.