This file provides guidance to Claude Code (claude.ai/code) when working with code in this repository.
ValueCell is a multi-agent platform for financial applications. It provides investment agents for stock research, trading strategies, and market analysis. The system stores sensitive data locally and supports multiple LLM providers and exchange integrations.
Tech Stack:
- Backend: Python 3.12+, FastAPI, Agno agents, A2A protocol
- Frontend: React 19, React Router 7, Bun, TypeScript, TailwindCSS
- Desktop: Tauri
- Database: PostgreSQL (conversations, tasks, strategies), LanceDB (knowledge)
./start.sh # Start both frontend and backend (auto-installs deps)
./start.sh --no-frontend # Backend only
./start.sh --no-backend # Frontend onlycd python
uv sync --group dev # Install dependencies (run first)
uv run pytest # Run all tests
uv run pytest ./path/to/test.py # Run specific test
python -m valuecell.server.main # Run API server directly
# Format and lint
make format
make lintcd frontend
bun install # Install dependencies
bun run dev # Start dev server
bun run build # Production build
bun run typecheck # Type check
bun run check:fix # Auto-fix lint/format issues
bun run check # Check lint/format without fixingvaluecell/
├── core/ # Orchestration: super_agent, planner, task executor
├── agents/ # Agent implementations: research, strategy, news, grid
├── adapters/ # Exchange integrations (Binance, OKX, Hyperliquid)
├── server/ # FastAPI server, routers, database, services
└── utils/ # Shared utilities (model config, logging)
- SuperAgent triages user input - either answers directly or enriches for planning
- Planner creates execution plan (with HITL for clarifications)
- TaskExecutor runs tasks via A2A protocol to remote agents
- ResponseBuffer streams annotated responses to UI
Key modules:
core/coordinate/orchestrator.py- Main orchestration entry pointcore/super_agent/- Initial query triagecore/plan/- Intent-to-plan conversioncore/task/- Task execution via A2Acore/event/- Response routing and buffering
- Create agent class extending
BaseAgentwithstream()method - Create agent card in
python/configs/agent_cards/ - Use
create_wrapped_agent()decorator for A2A serving
Example:
from valuecell.core.types import BaseAgent, StreamResponse
from valuecell.core.agent.responses import streaming
class MyAgent(BaseAgent):
async def stream(self, query, conversation_id, task_id, dependencies=None):
yield streaming.message_chunk("Thinking...")
yield streaming.message_chunk(f"Result: {query}")
yield streaming.done()Events defined in core/types:
MESSAGE_CHUNK,TOOL_CALL_STARTED,TOOL_CALL_COMPLETED- streaming responsesTASK_STARTED,TASK_COMPLETED,TASK_FAILED- task lifecyclePLAN_REQUIRE_USER_INPUT- HITL checkpoint
Emit via streaming.* helpers from core.agent.responses.
Models configured via .env and python/configs/providers/. Use get_model("MODEL_ID") where MODEL_IDs include:
RESEARCH_AGENT_MODEL_IDSTRATEGY_AGENT_MODEL_IDEMBEDDING_MODEL_ID
- Linter: Ruff (configured in
pyproject.toml) - Import sorting: isort
- Async-first: Use async/await for I/O, httpx for HTTP
- Logging: loguru with
{}placeholders; avoid logging sensitive data - Models: Pydantic
BaseModelfor contracts
- Linter/Formatter: Biome (
biome.json) - Styling: TailwindCSS with shadcn/ui components
- State: Zustand, TanStack Query
- Forms: TanStack Form, Zod validation
start.sh- App launcher (installs deps, starts services)python/pyproject.toml- Python dependencies and lint configfrontend/package.json- Frontend dependencies and scriptsdocs/CORE_ARCHITECTURE.md- Detailed architecture documentationdocs/CONTRIBUTING_AN_AGENT.md- Agent development guideAGENTS.md- Development guidelines (imports, async, logging)
Configuration loaded from system app directory:
- macOS:
~/Library/Application Support/ValueCell/.env - Linux:
~/.config/valuecell/.env - Windows:
%APPDATA%\ValueCell\.env
Run ./start.sh to auto-generate from .env.example.
The application uses PostgreSQL as the primary database. Configure via VALUECELL_DATABASE_URL:
# Full PostgreSQL connection string
VALUECELL_DATABASE_URL=postgresql://user:password@localhost:5432/valuecell
# Or use individual PostgreSQL environment variables
PGHOST=localhost
PGPORT=5432
PGUSER=postgres
PGPASSWORD=your_password
PGDATABASE=valuecell- Python tests:
uv run pytest ./python - Frontend: No test framework configured yet
- Run
make testfrom project root for Python tests