Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
39 changes: 19 additions & 20 deletions CLAUDE.md
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@ This file provides context for Claude Code when working with this repository.

## Project Overview

Agentic Investment Committee (AIC) — A multi-agent system built with Agno that simulates a professional investment committee deploying $10M into public equities. Demonstrates 5 multi-agent architectures, three-layer knowledge, and institutional learning.
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

Expand All @@ -17,7 +17,7 @@ AgentOS (app/main.py)
│ ├── 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 (Opus 4.6)
│ └── Committee Chair — final decisions, capital allocation (Gemini 3.1 Pro)
├── Teams (4 architectures)
│ ├── Coordinate Team — Chair orchestrates analysts dynamically
Expand All @@ -37,14 +37,14 @@ AgentOS (app/main.py)
```

All specialist agents use:
- Claude Sonnet 4.6 model (`claude-sonnet-4-6`)
- 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:
- Claude Opus 4.6 model (`claude-opus-4-6`)
- Gemini 3.1 Pro model (`gemini-3.1-pro-preview`)

## Key Files

Expand All @@ -60,7 +60,7 @@ Committee Chair and team leaders use:
| `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 — Opus 4.6, no tools |
| `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) |
Expand Down Expand Up @@ -98,17 +98,17 @@ All agents follow this structure:

```python
from agno.agent import Agent
from agno.models.anthropic import Claude
from agno.models.google import Gemini
from agno.learn import LearningMachine, LearnedKnowledgeConfig, LearningMode

from context import COMMITTEE_CONTEXT
from agents.settings import committee_knowledge, committee_learnings
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 committee.
You are the [Role] on a $10M investment team.

## Committee Rules (ALWAYS FOLLOW)

Expand All @@ -121,14 +121,14 @@ You are the [Role] on a $10M investment committee.
my_agent = Agent(
id="my-agent",
name="My Agent",
model=Claude(id="claude-sonnet-4-6"),
model=Gemini(id="gemini-3-flash-preview"),
db=agent_db,
instructions=instructions,
tools=[...],
knowledge=committee_knowledge,
knowledge=team_knowledge,
search_knowledge=True,
learning=LearningMachine(
knowledge=committee_learnings,
knowledge=team_learnings,
learned_knowledge=LearnedKnowledgeConfig(
mode=LearningMode.AGENTIC,
namespace="global",
Expand All @@ -146,7 +146,7 @@ my_agent = Agent(

1. **Never duplicate knowledge instances** — always import from `agents.settings`
2. **All instructions include `COMMITTEE_CONTEXT`** via f-string (Layer 1)
3. **Opus for Chair/team leaders, Sonnet for specialists**
3. **Gemini Pro for Chair/team leaders, Gemini Flash for specialists**
4. **Memos = files (FileTools), Research = vectors (PgVector)** — never mix
5. **`committee_chair` is NOT a member** of Coordinate/Broadcast/Task teams (the team `model=` acts as chair). It IS a member of Route team and the final Workflow step.
6. **No learning config** on: Memo Writer, Committee Chair, Knowledge Agent, Route team
Expand All @@ -161,7 +161,7 @@ my_agent = Agent(

```python
# Shared knowledge instances (import from agents.settings)
from agents.settings import committee_knowledge, committee_learnings
from agents.settings import team_knowledge, team_learnings

# Agent database (no contents_table needed)
agent_db = get_postgres_db()
Expand All @@ -177,7 +177,7 @@ from db import db_url, get_postgres_db, create_knowledge
from context import COMMITTEE_CONTEXT

# Shared settings
from agents.settings import committee_knowledge, committee_learnings, MEMOS_DIR, EXA_MCP_URL
from agents.settings import team_knowledge, team_learnings, MEMOS_DIR, EXA_MCP_URL

# Agents
from agents import (
Expand Down Expand Up @@ -217,8 +217,7 @@ python -m app.load_knowledge --recreate # Drop and reload
## Environment Variables

Required:
- `ANTHROPIC_API_KEY` — for Claude models
- `OPENAI_API_KEY` — for embeddings
- `GOOGLE_API_KEY` — for Gemini models and embeddings
- `EXA_API_KEY` — for Exa web search

Optional:
Expand All @@ -236,10 +235,10 @@ Optional:
| What | Layer | Storage | Table/Location |
|------|-------|---------|----------------|
| Investment mandate, risk policy | Layer 1 | Filesystem → prompt | `context/*.md` |
| Company research, sector analysis | Layer 2 | PgVector | `committee_knowledge` |
| Research document contents | Layer 2 | PostgreSQL | `committee_knowledge_contents` |
| 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 | `committee_learnings` |
| Learning contents | Learning | PostgreSQL | `committee_learnings_contents` |
| Discovered patterns, corrections | Learning | PgVector | `team_learnings` |
| Learning contents | Learning | PostgreSQL | `team_learnings_contents` |
| Session history | — | PostgreSQL | Automatic (Agno) |
| Agent memory | — | PostgreSQL | Automatic (Agno) |
40 changes: 19 additions & 21 deletions README.md
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
# Agentic Investment Committee
# Agentic Investment Team

An AI investment committee built with [Agno](https://docs.agno.com) that demonstrates 5 multi-agent architectures working together to evaluate stocks, manage risk, and make portfolio decisions.
An AI investment team built with [Agno](https://docs.agno.com) that demonstrates 5 multi-agent architectures working together to evaluate stocks, manage risk, and make portfolio decisions.

7 specialist agents collaborate through 4 team configurations and a deterministic workflow — all backed by a three-layer knowledge system and institutional learning.

Expand All @@ -15,7 +15,7 @@ AgentOS
│ ├── Risk Officer ── YFinance + mandate enforcement
│ ├── Knowledge Agent ── RAG search + memo file navigation
│ ├── Memo Writer ── Writes investment memos to disk
│ └── Committee Chair ── Final decision-maker (Opus 4.6)
│ └── Committee Chair ── Final decision-maker (Gemini 3.1 Pro)
├── Teams (4)
│ ├── Coordinate Team ── Dynamic multi-agent orchestration
Expand All @@ -40,13 +40,12 @@ AgentOS
### 1. Clone and configure

```sh
git clone https://github.com/agno-agi/investment-committee.git investment-committee
cd investment-committee
git clone https://github.com/agno-agi/investment-team.git investment-team
cd investment-team

cp example.env .env
# Edit .env and add your API keys
# ANTHROPIC_API_KEY=sk-ant-***
# OPENAI_API_KEY=sk-***
# GOOGLE_API_KEY=***
# EXA_API_KEY=*** # Optional -- Exa MCP is free (thank you!)
```

Expand All @@ -61,7 +60,7 @@ This starts PostgreSQL (with pgvector) and the API server.
### 3. Load research into the knowledge base

```sh
docker exec -it aic-api python -m app.load_knowledge
docker exec -it investment-team-api python -m app.load_knowledge
```

This loads company profiles and sector analyses into PgVector for RAG search. Only needs to run once — documents are skipped if they already exist.
Expand Down Expand Up @@ -110,13 +109,13 @@ What does our research say about semiconductors?

| Agent | Model | Tools | Purpose |
|-------|-------|-------|---------|
| Market Analyst | Claude Sonnet 4.6 | Exa MCP, YFinance | Macro environment, news, market conditions |
| Financial Analyst | Claude Sonnet 4.6 | YFinance | Valuation, fundamentals, analyst estimates |
| Technical Analyst | Claude Sonnet 4.6 | YFinance | Price action, indicators, support/resistance |
| Risk Officer | Claude Sonnet 4.6 | YFinance | Position sizing, mandate compliance, risk limits |
| Knowledge Agent | Claude Sonnet 4.6 | FileTools (read-only) | RAG over research library + memo file browsing |
| Memo Writer | Claude Sonnet 4.6 | FileTools (read/write) | Drafts and saves standardized investment memos |
| Committee Chair | Claude Opus 4.6 | None | Final BUY/HOLD/PASS decisions with conviction scores |
| Market Analyst | Gemini 3 Flash | Exa MCP, YFinance | Macro environment, news, market conditions |
| Financial Analyst | Gemini 3 Flash | YFinance | Valuation, fundamentals, analyst estimates |
| Technical Analyst | Gemini 3 Flash | YFinance | Price action, indicators, support/resistance |
| Risk Officer | Gemini 3 Flash | YFinance | Position sizing, mandate compliance, risk limits |
| Knowledge Agent | Gemini 3 Flash | FileTools (read-only) | RAG over research library + memo file browsing |
| Memo Writer | Gemini 3 Flash | FileTools (read/write) | Drafts and saves standardized investment memos |
| Committee Chair | Gemini 3.1 Pro | None | Final BUY/HOLD/PASS decisions with conviction scores |

## Teams

Expand All @@ -142,7 +141,7 @@ Each step's output feeds into the next, producing a complete investment memo wit
## Project Structure

```
investment-committee/
investment-team/
├── agents/ # 7 specialist agents
│ ├── settings.py # Shared knowledge instances (import, never recreate)
│ ├── market_analyst.py
Expand Down Expand Up @@ -200,12 +199,12 @@ railway run python -m app.load_knowledge

**View logs:**
```sh
railway logs --service investment-committee
railway logs --service investment-team
```

**Redeploy after changes:**
```sh
railway up --service investment-committee -d
railway up --service investment-team -d
```

**Open dashboard:**
Expand All @@ -224,7 +223,7 @@ curl -LsSf https://astral.sh/uv/install.sh | sh
source .venv/bin/activate

# Start PostgreSQL (required)
docker compose up -d aic-db
docker compose up -d investment-team-db

# Load research
python -m app.load_knowledge
Expand Down Expand Up @@ -258,8 +257,7 @@ python -m app.load_knowledge --recreate # Drop and reload all

| Variable | Required | Default | Description |
|----------|----------|---------|-------------|
| `ANTHROPIC_API_KEY` | Yes | — | Claude models for all agents |
| `OPENAI_API_KEY` | Yes | — | Embeddings (text-embedding-3-small) |
| `GOOGLE_API_KEY` | Yes | — | Gemini models + embeddings |
| `EXA_API_KEY` | Yes | — | Web search for Market Analyst |
| `PARALLEL_API_KEY` | No | — | ParallelTools for Market Analyst |
| `RUNTIME_ENV` | No | `prd` | Set to `dev` for auto-reload |
Expand Down
14 changes: 7 additions & 7 deletions agents/committee_chair.py
Original file line number Diff line number Diff line change
Expand Up @@ -3,21 +3,21 @@
---------------

Final decision-maker and capital allocator.
Model: Opus 4.6. Tools: None.
Model: Gemini 3.1 Pro. Tools: None.
"""

from agno.agent import Agent
from agno.learn import LearnedKnowledgeConfig, LearningMachine, LearningMode
from agno.models.anthropic import Claude
from agno.models.google import Gemini

from agents.settings import committee_knowledge, committee_learnings
from agents.settings import team_knowledge, team_learnings
from context import COMMITTEE_CONTEXT
from db import get_postgres_db

agent_db = get_postgres_db()

instructions = f"""\
You are the Committee Chair of a $10M investment committee.
You are the Committee Chair of a $10M investment team.

## Committee Rules (ALWAYS FOLLOW)

Expand Down Expand Up @@ -56,13 +56,13 @@
committee_chair = Agent(
id="committee-chair",
name="Committee Chair",
model=Claude(id="claude-opus-4-6"),
model=Gemini(id="gemini-3.1-pro-preview"),
db=agent_db,
instructions=instructions,
knowledge=committee_knowledge,
knowledge=team_knowledge,
search_knowledge=True,
learning=LearningMachine(
knowledge=committee_learnings,
knowledge=team_learnings,
learned_knowledge=LearnedKnowledgeConfig(
mode=LearningMode.AGENTIC,
namespace="global",
Expand Down
12 changes: 6 additions & 6 deletions agents/financial_analyst.py
Original file line number Diff line number Diff line change
Expand Up @@ -8,17 +8,17 @@

from agno.agent import Agent
from agno.learn import LearnedKnowledgeConfig, LearningMachine, LearningMode
from agno.models.anthropic import Claude
from agno.models.google import Gemini
from agno.tools.yfinance import YFinanceTools

from agents.settings import committee_knowledge, committee_learnings
from agents.settings import team_knowledge, team_learnings
from context import COMMITTEE_CONTEXT
from db import get_postgres_db

agent_db = get_postgres_db()

instructions = f"""\
You are the Financial Analyst on a $10M investment committee.
You are the Financial Analyst on a $10M investment team.

## Committee Rules (ALWAYS FOLLOW)

Expand Down Expand Up @@ -49,14 +49,14 @@
financial_analyst = Agent(
id="financial-analyst",
name="Financial Analyst",
model=Claude(id="claude-sonnet-4-6"),
model=Gemini(id="gemini-3-flash-preview"),
db=agent_db,
instructions=instructions,
tools=[YFinanceTools()],
knowledge=committee_knowledge,
knowledge=team_knowledge,
search_knowledge=True,
learning=LearningMachine(
knowledge=committee_learnings,
knowledge=team_learnings,
learned_knowledge=LearnedKnowledgeConfig(
mode=LearningMode.AGENTIC,
namespace="global",
Expand Down
14 changes: 7 additions & 7 deletions agents/knowledge_agent.py
Original file line number Diff line number Diff line change
Expand Up @@ -2,24 +2,24 @@
Knowledge Agent
---------------

Committee librarian with two retrieval modes:
Team librarian with two retrieval modes:
- Research Library (vector search / RAG) for company and sector research
- Memo Archive (file navigation) for past investment memos
"""

from agno.agent import Agent
from agno.models.anthropic import Claude
from agno.models.google import Gemini
from agno.tools.file import FileTools

from agents.settings import MEMOS_DIR, committee_knowledge
from agents.settings import MEMOS_DIR, team_knowledge
from context import COMMITTEE_CONTEXT
from db import get_postgres_db

agent_db = get_postgres_db()

instructions = f"""\
You are the Knowledge Agent on a $10M investment committee. You serve as the
committee's librarian with two retrieval capabilities.
You are the Knowledge Agent on a $10M investment team. You serve as the
team's librarian with two retrieval capabilities.

## Committee Rules (ALWAYS FOLLOW)

Expand Down Expand Up @@ -57,7 +57,7 @@
knowledge_agent = Agent(
id="knowledge-agent",
name="Knowledge Agent",
model=Claude(id="claude-sonnet-4-6"),
model=Gemini(id="gemini-3-flash-preview"),
db=agent_db,
instructions=instructions,
tools=[
Expand All @@ -70,7 +70,7 @@
enable_delete_file=False,
)
],
knowledge=committee_knowledge,
knowledge=team_knowledge,
search_knowledge=True,
add_datetime_to_context=True,
add_history_to_context=True,
Expand Down
Loading
Loading