How antonaios/anton works
1. Overall shape
- This is a local-first, operator-driven system for M&A/investment workflows.
- The repository is split into four main runtime areas: routines/ as the FastAPI bridge and orchestration core, dashboard/ as the React cockpit, engine/ as the deterministic valuation layer, and vault/ as the canonical Markdown memory store.
- The key architectural rule is boundary separation: components communicate through the filesystem, HTTP, or subprocesses, not by importing each other across layers.
2. The vault is the system of record
- vault/ is an Obsidian-style Markdown repository with YAML frontmatter.
- It holds the operator’s memory, project notes, templates, decisions, and source registers.
- Writes to the vault are treated as governed, append-oriented memory updates rather than silent database mutations.
3. routines/ is the bridge and control plane
- This is the central Python backend, exposing many HTTP routes and also hosting CLI-driven automation.
- It owns dispatch, routing, budgets, telemetry, session locking, credentials management, and the sensitivity guard.
- It is the only layer that touches most other subsystems, making it the main architectural hub.
4. Governance is a first-class subsystem
- The system is built around pre-dispatch control: sensitivity, plan tier, and budget checks happen before a model or crew runs.
- The governance core enforces lane eligibility, cost ceilings, and audit logging, and it fails closed when sensitivity is unclear.
- This is what keeps confidential or MNPI work from leaking into a cloud path.
5. The four execution lanes
- The backend supports distinct lanes: chat, single skill, composite actions, and autonomous crews.
- Chat is a direct conversational path; single skills are governed route-to-action workflows; composite actions are multi-step DAG-like workflows; crews are multi-role subprocess agents.
- The lanes differ in determinism, latency, and audit shape, but all pass through the same governance boundary.
6. Deterministic valuation is isolated in engine/
- engine/ is a separate Python package for valuation workflows like LBO, comps, and related Excel-driven templates.
- It uses a registry/cell-map style model to drive versioned spreadsheet templates cell-by-cell.
- The important architectural point is that the LLM does not compute the numbers; it only supplies or narrates inputs, while Python executes the math deterministically.
7. The dashboard is a thin operator cockpit
- dashboard/ is a React + TypeScript + Vite application.
- It renders the operator workspace: chat, project panels, workflow drawers, budget/status cards, and tabs for skills, runs, inbox items, and governance views.
- Its job is presentation and command entry; the actual business logic stays in the backend.
8. Routines are organized by business capability
- Under routines/routines/, the code is split into domains such as budgets, credentials, daily digest, earnings, intake, project chat, recall, sectors, skills, vault graph, vault health, scheduler, and more.
- This structure indicates a service-oriented monolith rather than many deployed microservices.
- Each capability has its own data model, CLI entry points, and often one or more API routes.
9. Skills and crews provide the AI execution model
- routines/routines/skills/ contains governed skill packages, each with references, scripts, test inputs/outputs, and runtime wrappers.
- routines/crews_src/ contains heavier autonomous agent workflows such as triage, explore, debate, and digest.
- The runtime layer includes caps, deduping, guardrails, and gateway logic so model calls are centrally governed.
10. Ingestion and synthesis flow into the vault
- Multiple subsystems pull in external or operator-provided material: PDFs, newsletters, meeting notes, market data, research, and daily briefs.
- These pipelines usually parse or extract source material, synthesize a structured output, and then write governed Markdown artifacts back into the vault.
- The flow is typically source material → extraction/synthesis in routines → approved write to vault.
11. Search, recall, and knowledge health are separate from generation
- The repo includes recall, vault graph, vault health, and lessons/learning modules that analyze existing content rather than generate new deal outputs.
- These subsystems index, query, cluster, deduplicate, and propose improvements to the operator’s knowledge base.
- This separates memory inspection and system improvement from live deal execution.
12. Budgets, telemetry, and sessions are operational controls
- Budget enforcement is explicit and scoped globally, per model, or per project.
- Telemetry and audit routes record structured run metadata such as provider, model, sensitivity tier, and cost.
- Session and lock management prevent conflicting operator actions and keep each engagement’s state coherent.
13. External dependencies matter, but are compartmentalized
- The system is designed to work with local LLMs via Ollama for sensitive work, and can also route to cloud providers when policy allows.
- The valuation engine expects Excel automation support on the host, which is why the project is Windows-first in practice.
- Some optional market/news routines integrate with external data providers, but these are clearly separated from core vault and valuation logic.
14. What an architecture diagram should emphasize
- Put routines/ in the center as the governing hub.
- Show vault/ as the canonical data store and engine/ as a separate deterministic compute island.
- Place dashboard/ as the user-facing client over HTTP.
- Draw distinct lanes for ingest, governed model calls, deterministic valuation, and autonomous crews, all constrained by the same sensitivity and budget controls.
Main entry points: routes Route Layer · 00 Brief.md Markdown Vault · __init__.py Valuation Engine · app.py HTTP API
Components 21
Dashboard
React operator cockpit
- Operator UI · Thin client for chat, runs, projects, and governance
dashboard/src/App.tsx - API Client · Browser-side wiring for backend routes and sessions
dashboard/src/lib/api.ts - Workspace Panels · Chat, project, budget, routing, and workflow surfaces
dashboard/src/components
Routines
Python control plane and workflows
- HTTP API · Main backend entrypoint for routes and middleware
routines/routines/api/app.py - Route Layer · Business capability endpoints for skills, vault, budgets, and operations
routines/routines/api/routes - Governance · Sensitivity, budget, session lock, and security checks before execution
routines/routines/api/middleware/security.py - Budgets · Cost ceilings, incidents, and enforcement rules
routines/routines/budgets/gate.py - Sessions · Session locks and operator state coherence
routines/routines/api/middleware/session_lock.py - Skills Runtime · Registry, caps, dedupe, guardrails, and LLM gateway
routines/routines/skills/_runtime/llm_gateway.py - Crew Flows · Autonomous multi-role workflows for triage, debate, explore, and digest
routines/crews_src/triage_crew.py - Ingestion · Pull, parse, synthesize, and write source material
routines/routines/intake/dispatch.py - Recall · Index, rerank, and synthesize existing vault content
routines/routines/recall/retrieve.py - Vault Health · Freshness, links, speculation, and constitution checks
routines/routines/vault_health/constitution.py - Vault Graph · Graph extraction and query layer over vault notes
routines/routines/vault_graph/graph.py - Scheduler · Scheduled jobs, suspension, and timed orchestration
routines/routines/scheduler/scheduler.py
Engine
Deterministic valuation package
- Valuation Engine · Deterministic spreadsheet-driven finance computation
engine/valuation/__init__.py - Template Registry · Versioned template metadata and cell references
engine/valuation/registry.py - Excel Driver · Applies workbook operations and runs model math
engine/valuation/excel_engine.py
Vault
Canonical Markdown memory store
- Markdown Vault · System of record for projects, notes, templates, and decisions
vault/Projects/_template/00 Brief.md - Templates · Reusable note and project templates
vault/Templates/company.md - Project Skeleton · Canonical deal workspace layout and registers
vault/Projects/_template/01 Source Register.md
Connections 24
- Operator UI → API Client: calls · Client issues HTTP requests and receives state
- Operator UI → Workspace Panels: renders · UI assembles operator workspace from panels
- API Client → HTTP API: HTTP · Browser talks to backend control plane
- HTTP API → Route Layer: mounts · FastAPI exposes business capability routes
- HTTP API → Governance: wraps · Middleware enforces policy before execution
- Governance → Budgets: checks · Fails closed on spend and sensitivity limits
- Governance → Sessions: locks · Prevents conflicting operator actions
- Route Layer → Skills Runtime: dispatches · Governed routes invoke single skills
- Route Layer → Crew Flows: spawns · Routes can launch autonomous crew subprocesses
- Route Layer → Ingestion: runs · Routes trigger source capture and synthesis pipelines
- Route Layer → Recall: queries · Routes retrieve and rerank existing knowledge
- Route Layer → Vault Health: audits · Routes inspect vault freshness and integrity
- Route Layer → Vault Graph: inspects · Routes query relationships across the vault
- Route Layer → Scheduler: schedules · Routes create and manage background jobs
- Ingestion → Markdown Vault: writes · Approved outputs become governed markdown artifacts
- Recall → Markdown Vault: reads · Retrieval searches canonical memory
- Vault Health → Markdown Vault: checks · Health tools evaluate vault content
- Vault Graph → Markdown Vault: parses · Graph layer extracts structure from notes
- Skills Runtime → Valuation Engine: supplies inputs · Skills can hand off deterministic valuation work
- Valuation Engine → Template Registry: uses · Registry binds templates to cells and versions
- Valuation Engine → Excel Driver: executes · Excel driver performs the actual math and workbook writes
- Valuation Engine → Markdown Vault: exports · Results and artifacts can be stored back to memory
- Templates → Project Skeleton: defines · Template collection includes canonical project structure
- Markdown Vault → Templates: contains · Vault stores reusable note templates