Language & Runtime
- Python >=3.11 (uses
X | Y union syntax, asyncio.timeout())
- Package manager: pip / uv — install with
pip install -e ".[dev]" from backend/
Frameworks
- FastMCP >=2.14.0 — MCP server (
@server.tool() decorator)
- Pydantic AI >=0.1.0 — agent framework (
Agent, RunContext, ModelRetry)
- Click >=8.0.0 — CLI (
brain entry point → second_brain.cli:cli)
- Pydantic Settings >=2.0.0 —
BrainConfig reads from .env automatically
Data & Memory
- Supabase >=2.0.0 — PostgreSQL + pgvector (primary storage, 16 migrations in
supabase/migrations/)
- Mem0 >=0.1.0 — semantic memory layer (cloud or local)
- Voyage AI >=0.3.0 — multimodal embeddings (
voyage-multimodal-3.5) + reranking (rerank-2-lite)
- Graphiti (optional) — knowledge graph via FalkorDB or Neo4j
LLM Backends (pluggable via BrainConfig)
- Anthropic API —
primary_model = "anthropic:claude-sonnet-4-5" (default)
- Claude Subscription SDK —
use_subscription = True (OAuth, no API key)
- Ollama —
fallback_model = "ollama:llama3.1:8b" (local fallback)
Testing
- pytest >=8.0.0 + pytest-asyncio >=0.23.0
asyncio_mode = "auto" configured in pyproject.toml
Infrastructure
- Docker +
docker-compose.yml — containerized MCP server
- Tenacity >=8.0.0 — retry logic in
services/retry.py
- Pillow >=10.0.0 — image processing for multimodal ingestion
- python-frontmatter >=1.1.0 — vault markdown parsing