Sigrun Multi-Agent RAG Platform
Production RAG platform for Mexican SMBs: graph-aware retrieval over Obsidian knowledge bases, domain-specialized agents, budget-aware LLM routing, and human-in-the-loop actions.
Challenge
Small and mid-size businesses hold valuable operational knowledge scattered across documents, CRM notes, internal processes, chat history, spreadsheets, and the heads of a few key people. Generic chatbot wrappers don't solve that: they lack retrieval quality, domain awareness, cost control, and clear boundaries on what the system is allowed to do on its own.
Sigrun was built to close that gap — a platform that connects business knowledge to useful, grounded answers and carefully bounded actions, built to run in production rather than in a demo.
Solution
I designed Sigrun as a multi-agent RAG platform for ValkymIA client work: a Python/FastAPI async backend (LangGraph orchestration, PostgreSQL + pgvector) fronted by a chat-first Nuxt app on Cloudflare Workers. The focus is knowledge retrieval, cost-aware LLM orchestration, and bounded automation — not one-off prompts.

System architecture — frontend on Cloudflare Workers, FastAPI/LangGraph backend, pgvector retrieval, and budget-aware routing between local and hosted models.
Key capabilities:
- Graph-aware retrieval: Ingests Obsidian-based knowledge bases, chunks on document structure, and embeds locally with BGE-M3. Retrieval runs in two stages — vector similarity followed by wikilink graph expansion — so answers pull in linked context that a flat vector search would miss. Responses are grounded with structured citations.
- Domain-specialized agents: Five agent personas (sales, marketing, admin, operations, strategy), each with its own scope, retrieval filters, and plan gating, running over a shared LangGraph workflow. The caller selects the agent; over WhatsApp, users switch with slash commands.
- Budget-aware model routing: Every paid inference passes through an inference gateway that estimates worst-case cost, checks per-tenant and per-workflow budget policies, and routes to a hosted model (OpenRouter), a local model (Ollama), or refuses — with kill switches and admin overrides. Local models handle embeddings and light work; hosted models are reserved for where quality justifies the spend.
- Human-in-the-loop actions: External side effects (e.g. drafting a social post) run through a separate checkpointed graph that drafts, pauses for explicit approval, then executes or rejects. No autonomous actions by default.
- Multi-tenant and observable: Row-level org isolation across the vector store and knowledge base, Prometheus metrics for retrieval quality, latency, token cost, budget state, and knowledge gaps, plus a database audit trail of every answer and action.

Grounded answer with citations — placeholder screenshot.

Graph-aware retrieval — Stage 1 vector similarity, then Stage 2 wikilink graph expansion, assembled with per-domain grounding into a cited answer.

Human-in-the-loop approval — placeholder screenshot.
Integrations are deliberately narrow and honest about their boundaries: WhatsApp (via Twilio) as a read channel, approval-gated social drafting (draft-only by default), and transactional email. General LLM tool-calling is scaffolded for a later phase rather than claimed as done.
Impact
- Moves AI beyond chat by connecting retrieval, domain reasoning, and bounded actions into one workflow layer
- Improves knowledge access for teams whose operational knowledge lives in fragmented documents and a few people's heads
- Keeps AI delivery cost-aware through budget-checked routing between local and hosted models, with hard spend boundaries per tenant
- Provides a reusable architecture for ValkymIA client systems built on RAG, agents, and integrations — multi-tenant from day one

Cost and retrieval observability — placeholder; optional.
Why It Matters
Sigrun is the core of my current AI engineering work: turning RAG and agentic patterns into a system that holds up in real business environments. The architecture is deliberately pragmatic — retrieval quality, cost governance, human review, tenant isolation, and observability over impressive-looking demos that can't be trusted in production.