This guide summarizes the minimum you need to get productive, based on the project docs and current repo layout.
Prereqs:
- Python 3.12 (see
.python-version) - Postgres
- RPC provider access
- Optional:
uvfor faster env management
Setup:
- Create
.env(see.env.example) - Install deps
- Run migrations
- Start the API
Example (uv):
uv venv
uv pip install -r requirements.txt
alembic upgrade head
uvicorn app.main:app --reloadSmoke test:
curl -s -X POST http://localhost:8000/v1/chat/route \
-H "Content-Type: application/json" \
-d '{"message":"what are the supported tokens?"}' | python -m json.toolOptional UI:
streamlit run streamlit_app.pySettings load from app/config.py with overrides in .env.
Required:
DATABASE_URLRPC_URLS
LLM (if enabled):
LLM_ENABLED,LLM_MODEL,LLM_PROVIDER,OPENAI_API_KEY
Allowlists (safety critical):
ALLOWLIST_TOALLOWLIST_TO_ALL(true/false, disable target allowlist checks for local dev)ALLOWLISTED_TOKENSALLOWLISTED_ROUTERS
See docs/config/08-config-and-env.md for formats and defaults.
API surface:
app/main.pywires FastAPI, middleware, and/v1routers.api/v1/holds request/response endpoints for runs and chat.
Core run pipeline (LangGraph):
graph/graph.pydefines the step graph.graph/nodes/contains each step implementation.graph/state.pydefinesRunStateand shared artifacts.
Persistence:
db/models/SQLAlchemy models (run,run_step,tool_call)db/repos/data access patterns used by services and endpointsalembic/migrations andalembic.ini
Chat + LLM:
app/chat/routing, prompts, and toolsllm/provider client and prompt templates
Web3 / chain access:
chain/RPC client, ABIs, snapshots, and helpers
Policy + safety:
policy/rules and engine used during graph execution
Observability:
tools/tool_runner.pylogs tool callsapp/core/logging.py,app/core/middleware.pyhandle logs and run context
Run lifecycle:
- The
/v1/runsendpoints create and execute runs. - The graph enforces simulation, policy checks, and a human approval gate.
- Each run stores step-by-step audit artifacts in the DB.
Chat routing:
/v1/chat/routeclassifies intents into QUERY/ACTION/CLARIFY.- Only one ACTION intent is allowed at a time.
Safety invariants (do not break):
- Backend never signs or broadcasts transactions.
- All actions are allowlisted.
- Simulation is required before approval.
- Human approval is mandatory.
Reference docs: docs/architecture/03-run-lifecycle.md,
docs/backend/04-chat-router.md, docs/security/12-security-safety.md.
Run all tests:
pytestNote: LLM and RPC calls are mocked in unit tests. Set LLM_ENABLED=false
unless explicitly mocked.
More details: docs/tests/10-testing.md.
- Work on feature branches; do not commit directly to
main. - Use Conventional Commits (e.g.
feat:,fix:,chore:).
See docs/process/git-workflow.md for the naming conventions.
- In-memory chat state is not shared across instances.
- Simulation uses guarded assumptions for approvals in stateless
eth_call. - Only one ACTION intent supported per conversation.
Details: docs/ops/14-known-issues.md.
Docs are now categorized under docs/ (design, product, architecture, backend,
config, setup, security, ops, UI, tests). Start with docs/README.md for the
current index, then follow the reading order:
docs/README.md(categorized doc index)docs/product/00-product-brief.mddocs/architecture/01-architecture-overview.mddocs/architecture/02-backend-architecture.mddocs/backend/05-api-reference.mddocs/backend/06-data-models.mddocs/backend/07-llm-prompts.mddocs/ops/11-ops-deploy.mddocs/ui/13-frontend-integration.md
Supplemental:
docs/design/architecture-overview.mddocs/design/ui-demo-spec.md