investment-team
CLAUDE.md168 starsChanged 9 months agoApache-2.0View on GitHub
This file provides context for Claude Code when working with this repository. Agentic Investment Team — A multi-agent system built with Agno that simulates a professional investment team deploying $10M into public equities. Demonstrates 5 multi-agent architectures, three-layer knowledge, and institutional learning. All specialist agents use: - Gemini 3 Flash model (gemini-3-flash-preview) - PostgreSQL database (pgvector) for persistence - Committee context (Layer 1) in system prompt - Shared knowledge base (Layer 2) for RAG - Shared learnings (institutional learning) Committee…
- Reads credentials
We split this CLAUDE.md into the rules it gives an agent
3 rules. About 0 are common, 2 are distinctive, and 1 is very specific to this project.
≈0
Common · estimate
Many files like this have a rule of this kind.
≈2
Distinctive · estimate
This author's own choices. Worth a look.
1
Very specific
Tied to their project's names, files or tools. Probably skip.
- Common
- Distinctive
- Very specific
- Distinctive: line 39
All specialist agents use:
- Distinctive: line 97
All agents follow this structure:
- Very specific: line 158
Use get_postgres_db() from db module
≈ “Common” is an estimate: at least 1 in 5 of the 25,680 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.
Files
CLAUDE.md
This file provides context for Claude Code when working with this repository.
Project Overview
Agentic Investment Team — A multi-agent system built with Agno that simulates a professional investment team deploying $10M into public equities. Demonstrates 5 multi-agent architectures, three-layer knowledge, and institutional learning.
Architecture
AgentOS (app/main.py)
├── Agents (7 reusable specialists)
│ ├── Market Analyst — macro trends, sector analysis, news (Exa + YFinance)
│ ├── Financial Analyst — fundamentals, valuation, financials (YFinance)
│ ├── Technical Analyst — price action, momentum, entry/exit (YFinance)
│ ├── Risk Officer — downside scenarios, portfolio exposure (YFinance)
│ ├── Knowledge Agent — research library (RAG) + memo archive (FileTools)
│ ├── Memo Writer — synthesizes analysis into formal memos (FileTools)
│ └── Committee Chair — final decisions, capital allocation (Gemini 3.1 Pro)
│
├── Teams (4 architectures)
│ ├── Coordinate Team — Chair orchestrates analysts dynamically
│ ├── Route Team — routes questions to the right specialist
│ ├── Broadcast Team — all analysts evaluate simultaneously
│ └── Task Team — autonomous task decomposition
│
├── Workflows (1 architecture)
│ └── Investment Workflow — deterministic pipeline with parallel steps
│
├── Three-Layer Knowledge
│ ├── Layer 1: Static Context — mandate, risk policy, process (always in prompt)
│ ├── Layer 2: Research Library — company profiles, sector analysis (PgVector RAG)
│ └── Layer 3: Memo Archive — past investment memos (FileTools)
│
└── Institutional Learning — patterns, corrections, insights (LearningMachine)All specialist agents use:
- Gemini 3 Flash model (
gemini-3-flash-preview) - PostgreSQL database (pgvector) for persistence
- Committee context (Layer 1) in system prompt
- Shared knowledge base (Layer 2) for RAG
- Shared learnings (institutional learning)
Committee Chair and team leaders use:
- Gemini 3.1 Pro model (
gemini-3.1-pro-preview)
Key Files
| File | Purpose |
app/main.py | AgentOS entry point, registers all agents/teams/workflows |
app/load_knowledge.py | Loads research documents into PgVector (run once) |
app/config.yaml | Quick prompts for each agent, team, and workflow |
agents/settings.py | Shared instances: knowledge, learnings, paths, URLs |
agents/market_analyst.py | Market Analyst — Exa MCP + YFinance |
agents/financial_analyst.py | Financial Analyst — YFinance |
agents/technical_analyst.py | Technical Analyst — YFinance |
agents/risk_officer.py | Risk Officer — YFinance |
agents/knowledge_agent.py | Knowledge Agent — RAG + FileTools |
agents/memo_writer.py | Memo Writer — FileTools (save) |
agents/committee_chair.py | Committee Chair — Gemini 3.1 Pro, no tools |
teams/coordinate_team.py | Coordinate team (dynamic orchestration) |
teams/route_team.py | Route team (single dispatch) |
teams/broadcast_team.py | Broadcast team (parallel evaluation) |
teams/task_team.py | Task team (autonomous decomposition) |
workflows/investment_workflow.py | Deterministic 5-step pipeline |
context/loader.py | Loads *.md context files into COMMITTEE_CONTEXT |
context/mandate.md | Fund rules: $10M, public equities, limits |
context/risk_policy.md | Position sizing, portfolio risk, rebalancing |
context/process.md | 6-step evaluation pipeline |
db/session.py | get_postgres_db() and create_knowledge() helpers |
db/url.py | Builds database URL from environment |
compose.yaml | Local development with Docker |
Development Setup
Virtual Environment
./scripts/venv_setup.sh
source .venv/bin/activateFormat & Validation
source .venv/bin/activate && ./scripts/format.sh
source .venv/bin/activate && ./scripts/validate.shConventions
Agent Pattern
All agents follow this structure:
from agno.agent import Agent
from agno.models.google import Gemini
from agno.learn import LearningMachine, LearnedKnowledgeConfig, LearningMode
from context import COMMITTEE_CONTEXT
from agents.settings import team_knowledge, team_learnings
from db import get_postgres_db
agent_db = get_postgres_db()
instructions = f"""\
You are the [Role] on a $10M investment team.
## Committee Rules (ALWAYS FOLLOW)
{COMMITTEE_CONTEXT}
## Your Role
[Role-specific instructions...]
"""
my_agent = Agent(
id="my-agent",
name="My Agent",
model=Gemini(id="gemini-3-flash-preview"),
db=agent_db,
instructions=instructions,
tools=[...],
knowledge=team_knowledge,
search_knowledge=True,
learning=LearningMachine(
knowledge=team_learnings,
learned_knowledge=LearnedKnowledgeConfig(
mode=LearningMode.AGENTIC,
namespace="global",
),
),
add_datetime_to_context=True,
add_history_to_context=True,
num_history_runs=5,
markdown=True,
enable_agentic_memory=True,
)Critical Rules
- Never duplicate knowledge instances — always import from
agents.settings - All instructions include
COMMITTEE_CONTEXTvia f-string (Layer 1) - Gemini Pro for Chair/team leaders, Gemini Flash for specialists
- Memos = files (FileTools), Research = vectors (PgVector) — never mix
committee_chairis NOT a member of Coordinate/Broadcast/Task teams (the teammodel=acts as chair). It IS a member of Route team and the final Workflow step.- No learning config on: Memo Writer, Committee Chair, Knowledge Agent, Route team
- Agent IDs are kebab-case and match
config.yamlkeys skip_if_exists=Trueon research loading to prevent re-indexing
Database
- Use
get_postgres_db()fromdbmodule - Knowledge bases use
create_knowledge()fromdbmodule - The
contents_tableparameter is only needed when provided to a Knowledge base
# Shared knowledge instances (import from agents.settings)
from agents.settings import team_knowledge, team_learnings
# Agent database (no contents_table needed)
agent_db = get_postgres_db()Imports
# Database
from db import db_url, get_postgres_db, create_knowledge
# Context
from context import COMMITTEE_CONTEXT
# Shared settings
from agents.settings import team_knowledge, team_learnings, MEMOS_DIR, EXA_MCP_URL
# Agents
from agents import (
market_analyst, financial_analyst, technical_analyst,
risk_officer, knowledge_agent, memo_writer, committee_chair,
)
# Teams
from teams import coordinate_team, route_team, broadcast_team, task_team
# Workflows
from workflows import investment_workflowCommands
# Setup virtual environment
./scripts/venv_setup.sh
source .venv/bin/activate
# Local development with Docker
docker compose up -d --build
# Load research into knowledge base
python -m app.load_knowledge
python -m app.load_knowledge --recreate # Drop and reload
# Format & validation
./scripts/format.sh
./scripts/validate.sh
# Generate requirements
./scripts/generate_requirements.shEnvironment Variables
Required:
GOOGLE_API_KEY— for Gemini models and embeddingsEXA_API_KEY— for Exa web search
Optional:
PARALLEL_API_KEY— for ParallelTools web searchRUNTIME_ENV— set todevfor auto-reloadDB_HOST,DB_PORT,DB_USER,DB_PASS,DB_DATABASE
Ports
- API: 8000
- Database: 5432
Data Storage
| What | Layer | Storage | Table/Location |
| Investment mandate, risk policy | Layer 1 | Filesystem → prompt | context/*.md |
| Company research, sector analysis | Layer 2 | PgVector | team_knowledge |
| Research document contents | Layer 2 | PostgreSQL | team_knowledge_contents |
| Past investment memos | Layer 3 | Filesystem | memos/*.md |
| Discovered patterns, corrections | Learning | PgVector | team_learnings |
| Learning contents | Learning | PostgreSQL | team_learnings_contents |
| Session history | — | PostgreSQL | Automatic (Agno) |
| Agent memory | — | PostgreSQL | Automatic (Agno) |
Does it work?
Reviews from people and from AI agents that ran it: what they used it for, and whether it worked.
Reviews can't be read right now.
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.

