Skip to content

About

No description, website, or topics provided.

Resources

Stars

0 stars

Watchers

0 watching

Forks

Repository files navigation

Constitutional Accountability Platform

A "government digital twin": a continuously-updated, evidence-first knowledge graph of a government's budgets, laws, courts, parliament, elections, procurement, companies, and public statements — built and maintained by a pack of Hermes agents, and explored through a web UI with an AI copilot alongside every view.

The core idea is evidence over assertion: no agent or copilot answer is shown to a user without first passing through a verification pipeline (retrieval → source verification → entity resolution → timeline construction → citation validation), and every claim is tagged by how much to trust it — Tier 1 (official record), Tier 2 (media), or Tier 3 (social/unverified) — rather than presented as flat fact. See Master_Prompt.md for the original vision this was built from, and agents.md for the full agent roster.

Repository map

Path What it is
backend/ FastAPI backend: REST + WebSocket API, the polyglot data layer (Postgres, Neo4j, ScyllaDB, OpenSearch, DuckDB, MinIO, Redis, NATS), document ingestion/OCR, and the background workers that do embedding, NER, graph-building, timelines, financial analysis, and analytics. See backend/README.md.
frontend/ Next.js "Command Center" UI — knowledge graph explorer, timeline, universal search, and the citizen copilot chat panel. See frontend/README.md.
.hermes/ Hermes agent configuration: the 32 agent profiles and skill files that actually crawl, parse, and cross-reference government data. See .hermes/README.md for setup, including how to fold this into an existing global Hermes install.
docker-compose.yml The full stack — every database, the API, every worker, and Ollama for local model inference — wired together for local/self-hosted deployment.
Master_Prompt.md, agents.md, Update_plan.md, IMPLEMENTATION_SUMMARY.md Design docs: the original brief, the agent roster and evidence tiers, and running notes on what's built vs. planned.

Quick start

cp .env.example .env    # fill in secrets; defaults work for local dev
docker compose up -d    # brings up every database, the API, all workers, and Ollama

The API comes up on http://localhost:8000 (docs at /docs) and the frontend on http://localhost:3000. First boot takes a while — Postgres/Neo4j/OpenSearch/ScyllaDB all need to initialize, and worker-ocr will pull its Unlimited-OCR model from Ollama on first use (see backend/README.md's Background Workers section — after that first pull, restarts reuse the cached model, they don't re-download it).

Running backend or frontend outside Docker for development is covered in their own READMEs (backend/README.md, frontend/README.md).

Architecture at a glance

Different data gets stored where it's actually a good fit for, rather than forcing everything into one database:

Data Store Why
Entities, bills, laws, structured records PostgreSQL Strong consistency, relational queries
Original PDFs, gazettes, reports, speeches MinIO (S3-compatible) Immutable object storage
Relationships (minister → bill → committee → speech) Neo4j Graph traversal, GDS algorithms
Full-text + semantic (hybrid/kNN) search OpenSearch Keyword and vector search over the same index
Event timelines, telemetry ScyllaDB High write throughput, time-series access
Budget/financial analytics DuckDB Fast OLAP queries over large ledgers
Background jobs, caching Redis + NATS JetStream Queues, pub/sub, ephemeral state

backend/README.md covers this in full, including the API surface, the background worker pipeline, and the document-parsing stack (MinerU/Marker for born-digital PDFs, Unlimited-OCR for scanned ones).

License

MIT — see LICENSE.

About

No description, website, or topics provided.

Resources

Stars

0 stars

Watchers

0 watching

Forks

Releases

Packages

Contributors

Languages