Local-first, single-user research agent. Producer-consumer pipeline:
LangGraph orchestrates DeepAgents-style stage agents (framing →
review → research → synthesis → audit) over your own documents
(Docling-parsed) plus pluggable web search (Tavily / Exa /
Perplexity). Output is a Markdown report with [^src_id] citations
backed by a per-run Evidence table.
- Backend: Python 3.12, FastAPI, SQLAlchemy 2 async, Alembic, Postgres + pgvector.
- Agents: LangGraph state machines +
langchain_corechat models. No LiteLLM. - RAG: Docling for parsing, pgvector for retrieval. No external vector DB.
- Frontend: Next.js 16 (App Router) + React 19 + Tailwind v4 + shadcn-style UI.
- Streaming: Server-Sent Events with replay (
?last_event_id=resume). - Storage of secrets: Fernet-encrypted at rest in Postgres.
backend/ FastAPI app, agents, workers, alembic migrations
frontend/ Next.js 16 app (chat, run workspace, settings)
infra/ docker-compose for Postgres + pgvector
docs/ Plans, ADRs
scripts/ check.sh — run all gates locally
- Python 3.12 +
uv - Node 20+ +
pnpm - Docker (for Postgres)
docker compose -f infra/docker-compose.yml up -dcp .env.example .env
# generate FERNET_KEY (see comment in .env.example) and paste it in
cp backend/.env.example backend/.env # if you prefer per-package envs
cp frontend/.env.example frontend/.env.localcd backend
uv sync
uv run alembic upgrade head
uv run uvicorn app.main:app --reload --port 8000cd frontend
pnpm install
pnpm devOpen http://localhost:3000.
Visit /settings:
- Add at least one LLM provider key (Anthropic / OpenAI / Google / Ollama).
- Pick a search provider (Tavily / Exa / Perplexity) and add its key.
- Optionally override the model used per role
(
framing/review/research/synthesis/audit).
Keys are encrypted with FERNET_KEY before being written to
Postgres.
- Pick a task on the home page (V1 ships Market Entry; M&A skeleton present, full graph pending in M8).
- Enter a goal.
- The framing agent produces a clarifying questionnaire — fill it in.
- The pipeline streams agent messages, gate verdicts, artifact updates, and live token/cost usage to the run workspace.
- The final report renders in the center pane with
[^src_id]chips. Click a chip to scroll its source card into view in the right pane. - Cancel anytime via the "Cancel run" button in the Usage panel.
Four panes:
- Left: chat stream + agent trace (messages, gate verdicts, artifact writes).
- Center: streaming Markdown report with clickable citation chips.
- Right top: usage panel — running token totals + USD cost + cancel.
- Right bottom: sources sidebar — one card per cited source.
bash scripts/check.sh # backend + frontend in one shotor individually:
# backend
cd backend && uv run pytest && uv run ruff check . && uv run mypy app
# frontend
cd frontend && pnpm typecheck && pnpm lint && pnpm builddocs/superpowers/plans/2026-04-25-consulting-research-agent-v1.md— V1 milestone plan.backend/README.md— backend module map and conventions.frontend/README.md— frontend module map.
V1 milestones M0–M7 complete: M0 infra → M1 settings/providers → M2 SSE plumbing → M3 chat shell → M4 ingestion + RAG → M5 run lifecycle + framing schema → M6 market-entry agent pipeline → M7 polish (token/cost tracking, citation chips, evidence sidebar, 4-pane workspace).
M8 (M&A consultant) tracked separately.