Retrieva Labs

Case study Government & public sector

National Political RAG AssistantA national-scale AI assistant serving citizens and field teams from one knowledge base.

A dual-endpoint RAG assistant for public and field audiences, with temporal query routing and namespace retrieval, built for 10,000+ queries a day.

Client
National political organization, West Africa
Sector
Government & public sector
Engagement
End-to-end design and build
Our role
Architecture, retrieval design and backend engineering

Interface recreation · client data anonymized

queries a day, by design
10,000+
queries a day, by design
audience-specific endpoints
2
audience-specific endpoints
routing: past vs planned programs
Temporal
routing: past vs planned programs

(01) The challenge

What needed solving.

A national political organization in West Africa needed one AI assistant that could speak accurately to two very different audiences: members of the public asking about the organization's record and programs, and field teams who need precise, operational answers.

The same question can have different correct answers depending on time: what was delivered in the past versus what is planned for the future. A generic chatbot blurred the two, and at national scale the system had to stay fast and consistent across thousands of daily conversations.

(02) The solution

What we built.

We designed a dual-endpoint architecture, public and field, on a single governed knowledge base. Namespace-based retrieval in Pinecone keeps each audience's content and depth separate while sharing common sources.

A temporal query router classifies each question as being about past achievements or future programs and retrieves from the right time-scoped namespace before generation. Claude and OpenAI models are orchestrated behind a Flask API sized for more than 10,000 queries a day.

(03) Architecture

How the system fits together.

  1. 01 · Audiences

    • Public endpoint
    • Field-team endpoint
  2. 02 · Route

    • Temporal classifier
    • Past vs future
    • Audience namespace
  3. 03 · Retrieve

    • Pinecone namespaces
    • Governed sources
  4. 04 · Generate

    • Claude & OpenAI
    • Grounded answer
  5. 05 · Scale

    • Flask API
    • 10,000+ queries/day

(04) Engineering decisions

The choices that made it work.

  1. 01

    Temporal routing

    Questions are classified by time orientation, so answers about past results never mix with future commitments.

  2. 02

    Namespace isolation

    Audience-specific namespaces deliver context-appropriate answers from one source of truth.

  3. 03

    Multi-model orchestration

    Claude and OpenAI models are each used where they perform best, behind one API.

(05) Results

What the client got.

  • Dual public and field endpoints served from a single knowledge base
  • Temporal routing that separates past achievements from future programs
  • Architecture sized for more than 10,000 queries a day
  • Context-appropriate answers for two very different audiences

Technology

  • Claude (Anthropic)
  • OpenAI
  • Pinecone
  • Python
  • Flask

Services involved

Go deeper

Next case study Digital health SaaSAI Sponsor

Taking on new projects

Let’sbuild.

Want results like these? Let's talk.

Book a free 30-minute strategy call with our founder. You’ll leave with a clear view of the right architecture, timeline and next step, whether or not we work together.

  • Reply within 24 hours
  • NDA before you share anything confidential
  • You own the code, prompts and documentation
  • Hours overlap with US, UK, EU and Gulf teams
Or get an instant AI plan with the Project Scoper
Book a free strategy call