RAG brain. Structured prompts. Agent chains.
All agent tasks are issued as JSON-structured prompts — enforcing context, output format, and constraints. Reduces hallucination and enables pipeline chaining across agents.
Graph / RAG
Knowledge base · graphified across notes, ADRs, and code. Vector index refreshed nightly.
Claude Code
Primary dev assistant — feature scaffolds, refactors, code review, and architecture sketches.
Codex · MCP
Codegen via MCP delegation. Handles boilerplate, tests, and well-scoped diffs in parallel.
// agents/housing_etl.json { "task": "housing_etl_ingest", "context": { "sources": ["zillow_api", "fred_api"], "target": "postgresql.housing_timeseries", "schedule": "celery-beat nightly 02:00 UTC" }, "output_format": { "type": "pandas_dataframe → db_upsert", "validate": ["no_nulls", "date_range_check"] }, "constraints": ["idempotent", "redis_cache_1h"], "budget": { "tokens": 8000, "retries": 2 } }
Every agent task is wrapped in this structure instead of free-text instructions. 'context' tells the agent exactly what it's working with. 'output_format' tells it what to produce and how to validate it. 'budget' hard-caps token and retry spend — without it, a misbehaving agent can run indefinitely and rack up cost.
| Time | Agent | Task | Tokens | Status |
|---|---|---|---|---|
| 14:42 | claude | refactor.candle_renderer | 4,218 | ok |
| 14:21 | codex | test.gen.orderbook_ws | 2,104 | ok |
| 13:58 | claude | adr.draft.018 | 6,884 | ok |
| 13:32 | codex | migration.diff.user_acl | 1,948 | ok |
| 12:14 | claude | review.pr.842 | 8,012 | ok |
| 11:48 | codex | boilerplate.celery_task | 1,204 | ok |
| 11:01 | claude | refactor.lstm_pipeline | 9,640 | retry |
| 10:34 | codex | test.gen.fred_client | 1,812 | ok |
Token count is cost — 8,000 tokens for a code review is normal; watch for tasks that balloon past 10K without producing output. The retry on the LSTM refactor means the agent hit a validation error on its first attempt and re-ran with the error injected as context — a feature, not a bug.
The six principles that prevent the agent pipeline from going off the rails. RAG-first prevents guessing. Schema enforcement means outputs are always machine-parseable. Celery tasks means agents are resumable and observable. Budget caps prevent runaway spend. Eval sets catch regressions before model upgrades ship. PRs not commits keeps a human in the loop.