←All projects

RAG/Case StudyShipped/ 2026

Atlas RAG

Knowledge-aware retrieval over private docs.

PythonFastAPIVector DBLangChain
/atlas-rag
atlas rag / onlinePython · FastAPI · Vector DB · LangChain

Problem and solution

01/Problem

Most RAG systems either lose their grounding on long documents or surface confident-but-wrong answers with no way to tell the two apart. Knowledge teams needed something they could actually put in front of customers.

02/Solution

Atlas RAG combines hybrid retrieval (BM25 + dense), a cross-encoder reranker, and a citation-locked generator that refuses to answer when retrieval confidence is low. Every response ships with line-level citations and a calibrated confidence score.

03/How it works

The system, end to end.

  1. 01next →

    Query

    User question + optional filters.

  2. 02next →

    Retrieve

    Hybrid BM25 + dense recall, top-50.

  3. 03next →

    Rerank

    Cross-encoder narrows to top-8.

  4. 04next →

    Compose

    Citation-locked prompt assembly.

  5. 05loop

    Generate

    Grounded answer + citations + score.

04/Architecture

Components and data flow.

How the moving parts fit together. Solid arrows are synchronous calls; dashed arrows are queued or batched.

  1. 01

    Client (web/SDK)

  2. 02

    API gateway

  3. 03

    Query router

  4. 04

    Hybrid retriever (BM25 + dense)

  5. 05

    Reranker (cross-encoder)

  6. 06

    Citation-locked LLM

  7. 07

    Postgres + vector store

  8. 08

    Telemetry pipeline

↓ flow continues

05/Technology

The stack.

AI / ML
OpenAI / Anthropic modelsBGE embeddingsCross-encoder reranker
Frontend
Next.jsTailwind
Backend
PythonFastAPILangChain
Database
PostgreSQLpgvectorRedis
Infrastructure
GitHub Actions
APIs
OpenAIAnthropicCohere rerank

06/Engineering decisions

What we picked, and why.

  1. 01

    Hybrid retrieval instead of dense-only

    Choice

    BM25 + dense with reciprocal-rank fusion

    Alternatives

    • Dense-only retrieval
    • Graph retrieval

    Why

    Lexical recall catches identifiers and rare terms that dense embeddings flatten; fusion keeps both signals honest.

  2. 02

    Citation-locked generation

    Choice

    Force the model to cite, refuse when unsupported

    Alternatives

    • Free-form generation + post-hoc citations

    Why

    Locking citations into the decoding loop removed the 'confident but ungrounded' failure mode we saw in early evals.

  3. 03

    pgvector instead of a dedicated vector DB

    Choice

    Postgres + pgvector

    Alternatives

    • Pinecone
    • Weaviate
    • Qdrant

    Why

    Customers already ran Postgres. One fewer system to operate, transactional consistency for free.

07/Evaluation

What we measured.

  • 01

    94%

    Grounded

  • 02

    91%

    Citation precision

  • 03

    1.4s

    p95 latency

  • 04

    6%

    Refusal rate

08/Challenges

What almost broke us.

  • 01

    Long-document retrieval drift

    What happened

    Answers slowly drifted as corpus grew.

    What we did

    Introduced per-chunk metadata anchors + cross-encoder reranker.

  • 02

    Citation hallucination

    What happened

    Model cited plausible-but-wrong passages.

    What we did

    Switched to citation-locked decoding and required refusal when no support.

09/Results

Reduced ungrounded answers from ~22% to ~6% on the internal eval set. Three enterprise teams moved from pilot to production within a quarter.

10/Future improvements

  • ›Multimodal retrieval over diagrams and tables
  • ›Streaming answers with progressive citations
  • ›Tenant-aware evals as a managed service

Have an interesting AI problem?

Let's build something.

If you're working on something that needs real AI engineering — not just a demo — let's talk.

© 2026
Motion-Y

Hello, I'm your Motion-Y Assistant. How can I help you today?