- Document pipeline
- Upload → text extraction → classification → field extraction → record creation → chunk + embed for search.
backend/app/documents/pipeline.pydocuments/extraction.pydocuments/classification.pyrag/indexer.py - Data layer
- PostgreSQL 16 with pgvector. Tables for documents and chunks, purchases, bills, subscriptions, warranties, deadlines, tasks, reminders, action proposals, agent runs, tool calls, and an audit log.
- Agent (LangGraph)
- StateGraph with intent detection, context detection, tool selection, tool execution, optional RAG retrieval, evidence validation, answer generation, and action detection. Tool selection is rule-based and inspectable.
backend/app/agents/graph.pyagents/runner.pyservices/evidence.py - Tool registry
- 20 tools with typed arguments and a `mutates` flag. Read-only tools run immediately; mutating tools only create proposals. Every call is logged.
- Human-in-the-loop
- Proposals move through pending → approved / rejected → executed / failed. Execution happens only via the approve endpoint.
- LLM providers (optional)
- None (extractive, default), Anthropic, OpenAI, or AWS Bedrock.
- Security & privacy
- bcrypt passwords, JWT auth, self-registration off by default, login rate limiting, security headers, upload validation, per-account data isolation, redacted logs.
- Frontend & deployment
- Next.js (App Router) + React + TypeScript UI. Docker Compose with Postgres, API, background worker, and frontend.