Evidence-only RAG corpus + MCP server for Southeast-Asian banking & financial regulation and cross-cutting technology law — one codebase, one corpus per country.
Docs · Architecture · Plan
banhmi crawls official government sources, extracts legal documents into a citable RAG corpus, and serves evidence over MCP — exact citations, validity, amendment relations, provenance, and coverage gaps. It does not answer questions: your agent/model connects, retrieves evidence, and decides the answer.
Remote MCP (Streamable HTTP), public, HTTPS, no signup or API key:
| Jurisdiction | Endpoint | Ask in | Official sources |
|---|---|---|---|
| Vietnam | https://banhmi.danny.vn/mcp |
Vietnamese | VBPL · Cong Bao · vanban.chinhphu · SBV |
| Malaysia | https://laksa.danny.vn/mcp |
English | AGC Laws of Malaysia · Bank Negara Malaysia · Securities Commission |
| Indonesia | https://rendang.danny.vn/mcp |
Indonesian | BPK JDIH · Bank Indonesia · OJK |
| Singapore | https://kaya.danny.vn/mcp |
English | SSO · MAS · PDPC · CSA |
| Thailand | https://tomyum.danny.vn/mcp |
Thai | OCS · BOT · SEC · ETDA |
| Cambodia | https://amok.danny.vn/mcp |
English | NBC · ODC · CDC |
Add as a custom connector (pick an endpoint above):
- Claude (Pro/Max/Team/Enterprise) → Settings → Connectors → Add custom connector → paste URL, no auth.
- ChatGPT (Plus/Pro/Team/Edu) → Developer mode → Settings → Apps & Connectors → Add → paste URL, no auth.
- Grok → Settings → Connectors → Add MCP server → paste URL.
- Gemini CLI → add under
mcpServersin~/.gemini/settings.json(httpUrl= endpoint).
Ask e.g. "What are the technology risk management requirements for banks?" — you get ranked provisions with citation, validity badge, and official source link.
Tools: search · document · corpus_status · quality_gaps · guide.
- Scope-filtered discovery of banking & financial regulation and cross-cutting technology law (cybersecurity, data protection, AI, cloud, e-transactions, payments, digital banking).
- Verbatim authoritative text — extracted from official government sources, never paraphrased.
- High-fidelity extraction — go-fitz (MuPDF) for DOCX/HTML/born-digital PDF; Google Vision OCR (batched, cached) for scanned PDFs.
- Evidence, not answers — exact native citations (VN Dieu/Khoan, MY Section/Subsection, ID Pasal/ayat), validity badges, confirmed relations, provenance, and gaps.
- Change tracking — amendments, repeals, subsidiary legislation, validity over time.
Sources are pluggable — see docs/design/SOURCES.md and
docs/design/jurisdictions/.
flowchart TB
subgraph LOCAL["Write path: cmd/pipeline (local, CPU)"]
DISC["Discover"] --> FETCH["Fetch official files"]
FETCH --> EXT["Extract (go-fitz / Vision OCR)"]
EXT --> NORM["Normalize (structure,<br/>validity, relations)"]
NORM --> IDX["Index (chunk + embed)"]
end
KAGGLE["Kaggle T4 GPU<br/>Qwen3-Embedding ONNX FP16<br/>bulk embed offload"]
IDX <-->|"dataset I/O"| KAGGLE
subgraph RDS["AWS RDS PostgreSQL 17 + pgvector (Singapore)"]
DB[("one database per country<br/>banhmi | laksa | rendang<br/>kaya | tomyum | amok")]
end
IDX -->|"write corpus over TLS"| DB
subgraph ECS["AWS ECS on EC2 Graviton ARM64 (same VPC)"]
MCP["ONE MCP server, all countries<br/>in-process Qwen3 embedder<br/>hybrid dense + BM25 (RRF)"]
end
DB --> MCP
CF["CloudFront<br/>*.danny.vn<br/>(6 distributions, ACM TLS)"] --> MCP
USERS["Your agents<br/>Claude | ChatGPT<br/>Gemini | Grok"] -->|"remote MCP<br/>(Streamable HTTP)"| CF
Medallion pipeline (Bronze → Silver → Gold):
- Discover → Fetch (Bronze) — scope-filtered crawl; download raw files.
- Extract → Normalize (Silver) — go-fitz/MuPDF (scanned PDFs via Vision OCR, batched and cached); parse provision tree, validity, relations.
- Index (Gold) — chunk by article + Qwen3-Embedding (ONNX FP16, 1024 dims) into pgvector.
Hybrid retrieval: dense vectors + BM25 sparse vectors (
sparsevec), RRF-fused with a query router, current-law pre-filter. - Serve — CloudFront → one ECS EC2 Graviton process (in-process Qwen3 ONNX query embedder),
same VPC as RDS. Each domain's
GET /serves a guide page;/mcpserves agents.
See docs/ARCHITECTURE.md.
Retrieval quality — golden-set eval per jurisdiction (hybrid retrieval, top-8, measured
2026-07-19 on the deployed corpora; harness in docs/design/RAG.md):
| Jurisdiction | Chunks | Golden cases | Recall@8 | MRR@8 | Current-law precision | Abstention |
|---|---|---|---|---|---|---|
| 🥖 Vietnam | 52,546 | 80 | 92.7% | 69.7% | 100% | 100% |
| 🍜 Malaysia | 11,286 | 72 | 94.3% | 79.6% | 100% | 100% |
| 🍛 Indonesia | 160,142 | 110 | 79.8% | 62.4% | 100% | 100% |
| 🍞 Singapore | 27,951 | 76 | 93.5% | 79.9% | 100% | 97.9% |
| 🍲 Thailand | 29,736 | 58 | 89.5% | 72.0% | 100% | 96.6% |
| 🐟 Cambodia | 2,609 | 42 | 93.1% | 74.4% | 100% | 100% |
Recall@8 = expected citations found in the top-8 evidence; current-law precision = returned primary hits that are in-force law; abstention = out-of-scope questions correctly refused.
See PLAN.md for the roadmap.
Everything runs in podman — full guide in docs/DEVELOPMENT.md.
cp config/config.example.yaml config/config.yaml
export BANHMI_DATABASE_PASSWORD=banhmi
make dev-up # Postgres+pgvector
make migrate # apply schema
go run ./cmd/seed # load config vocabulariesBuild the corpus and serve MCP per docs/DEVELOPMENT.md. A fresh clone reaches
ingesting + serving with no API keys. Deploy via docs/DEPLOYMENT.md.
- Architecture — design, data model, folder layout, interfaces
- Local development — dev stack, migrations, build/run/test
- Deployment — generic 3-part deploy (worker, database, MCP)
- Publishing — listing the MCP servers in agent directories
- Plan — roadmap, phases, open decisions
- Sources · Pipeline · Schema · Extraction · RAG · Workflow Eval
- Jurisdictions — country registry · playbook · Malaysia · Indonesia / Thailand / Singapore
- Documentation index