Overview
What Configent is, the stack it runs on, and where each design decision is written down.
Configent is a platform for grounded assistants, where a client is a YAML file plus a sources folder, not a codebase. The reference client is a Google Cloud support agent that answers from documentation with citations, searches again when the first attempt falls short, and offers a drafted ticket when it still can’t.
What it has to do
Four requirements, and every design decision below traces back to one of them.
- Answer only from the corpus, with citations. An uncited claim is a failure, not a style choice.
- Know when it cannot answer. The interesting half of a support agent is the refusal, and that decision has to be explainable after the fact.
- Serve many clients from one deployment. Adding a tenant is a config file, a corpus and a prompt, with no Python.
- Leave a record. Every turn has to be auditable, and the record has to survive the process dying mid-turn.
The support agent at a glance
User question
│
▼
┌──────────────────────────────┐ grounded ┌────────────────┐
│ Level 1 · RAG ├──────────────────▶│ Cited answer │
│ search the docs, grade them │ └────────────────┘
└───────────────┬──────────────┘
│ falls short
▼
┌──────────────────────────────┐ grounded ┌────────────────┐
│ Level 2 · Corrective RAG ├──────────────────▶│ Cited answer │
│ rewrite, search again │ └────────────────┘
└───────────────┬──────────────┘
│ falls short
▼
┌──────────────────────────────┐ user says yes ┌────────────────┐
│ Level 3 · Human ├──────────────────▶│ Ticket filed │
│ draft a ticket, offer it │ └────────────────┘
└──────────────────────────────┘
Each level answers if it can and hands down only what it can’t. A Python function chooses every arrow; the model chooses none. The walkthrough is The Support Graph.
The shape
Next.js (chat UI) apps/web
│ SSE
FastAPI apps/api
├─ config registry one YAML per client, validated at startup
├─ support graph three tiers, every route a Python function
│ ├─ retrieval Voyage embed → pgvector cosine, + Postgres full-text at Level 2
│ ├─ Anthropic Messages API: citations, structured output
│ ├─ LangGraph checkpoints and the ticket pause
│ └─ cost priced per model from config/pricing/claude.yaml
└─ Postgres conversations · messages · chunks · runs · checkpoints · traces
│ HTTP
mock ticket service apps/mockticket
One Postgres holds the relational data, the vectors, the full-text index and the graph checkpoints. One process serves every tenant. The only external calls are Anthropic, Voyage and the ticket service.
A graph, not a tool loop
The reference client runs the support graph. A client chooses one template with agent.template; the second is text-to-SQL, and adding one is code behind a stable seam. The alternative, a model looping over tools until it stops, shipped beside it until D11.
| Tool-use loop (retired) | Support graph | |
|---|---|---|
| Control flow | The model picks tools until it stops | Three tiers of nodes, routed by Python functions |
| Escalation decided by | The model | decide_level1 and decide_level2 |
| Good for | Open-ended, multi-hop work | A decision you have to justify |
A model holding the ticket tool cannot make this project’s claim, that escalation is not the model’s decision. Why the loop was deleted rather than kept: Retiring the Loop.
The Support Graph is the section to read next. Its hub page follows one question end to end, and each page under it owns one component.
The stack, and why
| Layer | Choice | Why this one |
|---|---|---|
| LLM | Anthropic Claude (Haiku 4.5) | Native citations and structured output are both first-class; Haiku is cheap enough to spend extra calls on grading and rewriting |
| Embeddings | Voyage voyage-3 | Anthropic has no embeddings API, so a third party is required either way. Voyage exposes input_type query/document, a free recall win |
| Vector and keyword search | pgvector + Postgres full-text | Already inside the Postgres we need. A dedicated search service would be a second system for no gain at this scale |
| Backend | FastAPI + async SQLAlchemy | Native async all the way down, which is what makes I/O-bound nodes and SSE cheap |
| Agent runtime | LangGraph, for checkpoints and the ticket pause | Model calls, routing and citations stay plain code. Why a framework · Why the loop was retired |
| Transport | SSE | One-way server push over plain HTTP. WebSockets buy nothing when only the server talks. Details |
| Frontend | Next.js + Tailwind | Client-agnostic; branding comes from the API, not the build |
Where the design decisions live
The questions worth asking about this project, and the page that answers each.
| Question | Page |
|---|---|
| How does one question actually flow through it? | One Question, End to End |
| Why is retrieval a node instead of a tool? | Retrieval |
| Why grade groundedness separately, and how are greetings kept out of the queue? | Grading |
| Why two escalation signals rather than one? | The Guardrail |
| Why search a second time before involving a human, and why not the web? | Corrective Retrieval |
| How do you stop the model from escalating on its own? | Answering |
| How do you avoid filing the same ticket twice? | Handoff & Ticket |
| Why adopt LangGraph after building without it? | From Pipeline to Graph |
| Why delete the free-form agent loop? | Retiring the Loop |
| What happens if the process dies mid-turn? | Runs & Durability |
| How is one tenant’s corpus kept out of another’s? | Multi-Tenancy |
Why voyage-3, and why not a dedicated vector DB? | Ingestion Pipeline |
| Does prompt caching help here, and why not yet? | Prompt Caching |
| What does adding a new client actually take? | Adding a New Use Case |
Vocabulary
The terms the rest of the docs use without re-defining.
- Client / tenant: one assistant (corpus, prompts, branding, thresholds, limits) defined by one YAML file in
config/. - Chunk: a passage of a document (512 tokens for the support agent), embedded and stored as a row in pgvector. Retrieval returns chunks, not documents, so a citation can point at a paragraph.
- Similarity:
1 - cosine_distancebetween the question’s vector and a chunk’s. Ranges 0 to 1; the support agent discards anything below0.3. - Groundedness: a cheap-model score for whether the retrieved passages actually support an answer. Similarity says “close”; groundedness says “sufficient”.
- Node: one unit of the graph:
retrieve,grade,converse,rewrite,hybrid_retrieve,regrade,answer,decline,escalate,ticket. Each commits an audit entry before the next starts. - Level / tier: Level 1 is RAG, Level 2 is corrective RAG, Level 3 is the client’s handoff: a message, or a ticket for a human. A turn only moves down when the level above falls short.
- The two signals: retrieval similarity (is anything in the corpus close?) and groundedness (is it enough?). One catches a corpus with nothing relevant; the other catches a corpus with something close but wrong.
- The routes:
decide_level1anddecide_level2, the plain functions that choose every edge. Nodes do work; only these decide. - Corrective retrieval: Level 2. A rewrite of the question with the conversation in view, then hybrid search.
- Hybrid search: dense vector search per query variant plus Postgres full-text search on exact keywords, fused by reciprocal rank.
- Outcome: how a turn ends:
answer(cited, from the corpus),converse(a greeting, a thank-you or a meta-question; no ticket), orticket(a real support request neither level could answer; a ticket is drafted, offered, and filed on the user’s confirmation). - Triage: the
kindfield on the grade call, which separatesconversefrom everything else. It runs after retrieval, with the passages in view, rather than as an intent classifier in front. - Tool starvation: the answering call is sent no tool definitions at all, so escalation is unreachable from inside the model. A guarantee, not a prompt instruction.
- Run: one graph turn, and the durable step trail it leaves in Postgres.
- Checkpoint: LangGraph’s saved graph state after a node, keyed by the run id. What lets a turn pause on a ticket offer and continue in a later request.
- Tool: a function the model can ask the backend to call. No call in this system is sent one.
Start here: One Question, End to End for the design, or Quickstart to run it locally.