Plataforma de Inteligencia Gubernamental del Estado Dominicano β API-first, multi-agente, basada en evidencia oficial.
El API es el producto. Todo lo demΓ‘s es simplemente otro cliente.
INTEL.DOM.GOB es una plataforma de inteligencia estatal impulsada por IA que realiza deep research en tiempo real sobre las fuentes oficiales de la RepΓΊblica Dominicana. Cada consulta dispara un bucle multi-agente de recuperaciΓ³n y razonamiento que busca, lee, contrasta y sintetiza informaciΓ³n oficial antes de responder.
La arquitectura gira en torno al API. Todo fluye a travΓ©s de:
Cliente β API β Orchestrator β Services β Providers β External Systems
NingΓΊn cliente habla directamente con servicios o proveedores.
Clients
βββββββββββββββββββββββββββββββββββββββββββββ
Studio Β· Web Β· CLI Β· Admin Β· MCP Β· SDKs
β (HTTPS via reverse proxy / subdomains)
βΌ
API (api.intel.dom.gob) β gateway, REST + SSE, versioned /v1
β
βΌ
Orchestrator β heart: planning, search, AI, merge
β
βΌ
Core Services
βββββββββββββββββββββββββββββββ
Search Β· AI Β· Institutions Β· Crawler Β· OCR Β· Memory Β· RAG Β· β¦
β
βΌ
Providers
βββββββββββββββββββββββββββββββ
SearXNG (default search) Β· Gemini (default AI) Β· + future providers
β
βΌ
Infrastructure
βββββββββββββββββββββββββββββββ
PostgreSQL Β· Redis Β· Object Storage Β· Docker Β· Caddy
- Separation of Concerns β cada capa tiene exactamente una responsabilidad.
- Provider abstraction β todo lo externo estΓ‘ detrΓ‘s de un Provider. AΓ±adir Brave/OpenAI/Ollama = crear una implementaciΓ³n, nada mΓ‘s.
- Pluggable services β cada servicio es independiente y testeable.
- Develop exactly like production β mismo Docker Compose, solo cambia
DOMAIN.
intel.dom.gob/
βββ apps/
β βββ api/ # Express API gateway (delegates to Orchestrator)
β βββ studio/ # React SPA client (consumes the API only)
βββ services/
β βββ orchestrator/ # business logic: multi-agent reasoning
β βββ search/ # Search Service (SearXNG + news engines)
β βββ ai/ # AI Service (wraps AI providers)
β βββ institutions/ # institution plugins (Senado, CΓ‘mara, DGCP, β¦)
β βββ crawler/ # URL-tree builder
βββ providers/
β βββ searxng/ # default Search Provider
β βββ gemini/ # default AI Provider
βββ packages/
β βββ types/ # shared domain types
β βββ logger/ # structured logging
β βββ config/ # env configuration
β βββ utils/ # shared utilities
β βββ sdk/ # the ONLY way clients talk to the API
βββ docker/
β βββ caddy/ # reverse proxy (subdomain routing + HTTPS)
β βββ searxng/ # preserved SearXNG settings
β βββ docker-compose.yml
βββ scripts/ # start / stop / doctor / deploy / β¦
βββ docs/
βββ README.md
βββ AGENTS.md
βββ CONTRIBUTING.md
βββ CHANGELOG.md
# 1. Clone & configure
git clone <repo> intel.dom.gob
cd intel.dom.gob
cp .env.example .env # set GEMINI_API_KEY, DOMAIN
# 2. One command brings up the whole platform
./scripts/start.shThen open:
- Studio β http://studio.localhost
- API β http://api.localhost/v1/health
- API Docs (Swagger) β http://api.localhost/v1/docs
- MCP β http://mcp.localhost/health
- Web β http://web.localhost
- Admin β http://admin.localhost
- Docs β http://docs.localhost
https://studio.localhost
https://api.localhost
https://mcp.localhost
https://web.localhost
https://admin.localhost
https://docs.localhost
https://studio.intel.dom.gob
https://api.intel.dom.gob
https://mcp.intel.dom.gob
https://web.intel.dom.gob
https://admin.intel.dom.gob
https://docs.intel.dom.gob
Only DOMAIN changes. Caddy auto-manages HTTPS via Let's Encrypt.
Single canonical docker-compose.yml. No per-environment compose files.
docker compose up -d # brings up api, studio, mcp, web, admin, docs, searxng, postgres, dragonfly, caddy
docker compose ps # health-checked services- Every container exposes
/health,/ready,/live. - Only Caddy publishes ports (80/443). All other services use internal Docker DNS.
- Services communicate by name:
api,searxng,postgres,dragonfly.
All operational scripts live in scripts/:
| Script | Purpose |
|---|---|
init.sh |
Validate prerequisites, install deps |
start.sh |
docker compose up -d + endpoints |
up.sh |
Build + start the full stack, run a comprehensive health/endpoint report, and print a presentation of service health, exposed endpoints, workers and the API surface |
stop.sh |
docker compose down |
restart.sh |
Full restart |
logs.sh [svc] |
Tail logs |
doctor.sh |
Prerequisite + health checks |
backup.sh |
Backup volumes |
restore.sh <file> |
Restore PostgreSQL |
lint.sh |
Typecheck all workspaces |
format.sh |
Format code |
test.sh |
Run tests |
clean.sh |
Remove build artifacts |
update.sh |
Update dependencies |
deploy.sh |
One-command production deploy |
Run services independently (no Docker needed for code changes):
npm install --workspaces
cd apps/api && npm run dev # API on :4000
cd apps/studio && npm run dev # Studio on :5173 (Vite)Adding a provider requires only creating a new implementation:
// providers/brave/src/index.ts
import { createSearchProvider } from "@intel.dom.gob/providers";
export const brave = createSearchProvider({
id: "brave",
async search(query) { /* ... */ return []; },
});Register it in apps/api/src/index.ts. Nothing else changes.
| Kind | Default | Future |
|---|---|---|
| Search | SearXNG | Brave, Exa, Tavily, Google |
| AI | Gemini | OpenAI, Anthropic, Ollama, DeepSeek |
Each service has exactly one responsibility and is independently testable:
- Orchestrator β agent execution, planning, search/AI orchestration, result merging.
- Search β web/news retrieval through the Search Provider.
- AI β model calls via the AI Provider.
- Institutions β pluggable Dominican government sources.
- Crawler β categorized URL-tree builder.
Versioned REST (/v1). The API contains no business logic β every endpoint delegates to the Orchestrator.
| Method | Path | Description |
|---|---|---|
| GET | /v1/health |
Service health |
| GET | /v1/institutions |
Dynamic institution registry |
| GET | /v1/url-tree |
Categorized URL tree (?refresh=1, ?portals=) |
| POST | /v1/query |
Multi-agent intelligence query |
| POST | /v1/chat |
Context-grounded follow-up chat |
All clients (Studio, CLI, MCP, SDKs) use @intel.dom.gob/sdk.
The Studio is the primary application β a React SPA that communicates exclusively with the API. It contains no business logic: only chat, conversations, prompts, history, tool browsing, provider selection, settings, and streaming.
The MCP server is another client of the platform: it calls the API like any other client and never invokes providers or services directly. Future MCP tools are pluggable.
Single command, identical to local:
./scripts/deploy.shInternally: git pull β docker compose pull β docker compose up -d --build β health checks.
Suitable for self-hosting and cloud VPS without modification.
- OCR service (Unlimited-OCR) β provider-backed, replaceable.
- Presentation service (HyperFrames) β optional export plugin.
- Memory service (codebase-memory-mcp) β optional, first-class.
- Knowledge Graph service β entity relationships between laws/decrees.
- MCP server client + pluggable tools.
- Auth: JWT, API keys, OAuth, organizations, teams, permissions.
- WebSockets + SSE streaming for tool/search progress.
Why a reverse proxy with subdomains instead of ports?
Ports are a dev artifact. Production behaves like studio.intel.dom.gob, and development mirrors it exactly via studio.localhost. One mental model, zero config drift.
Where does the AI key go?
GEMINI_API_KEY in .env (never committed). The API also accepts a per-request apiKey for multi-tenant use.
Is the existing SearXNG setup preserved?
Yes β docker/searxng/settings.yml is the original anonymous JSON API configuration, mounted unchanged.
See CONTRIBUTING.md and AGENTS.md.
MIT.