Case Study · Chatbot Admin Console

Adhikar Admin — the library behind the chatbot

A chatbot is only as good as the documents behind it. This console lets a non-technical admin edit the library, test any question against it, tune the ranking and see which questions go unanswered.

Project
Chatbot admin console
Scope
Documents · Lab · Tuning · Insights
Stack
React · BM25 retrieval
Status
Interactive prototype
Adhikar Admin retrieval lab with search terms, weights and ranked passages in a browser window on a teal gradient
Try It Live

Run the library

A working version of the admin console, running right here.

Open Documents and edit a passage, or add a new document. In the Retrieval lab, type a question and see which terms were used and which passages rank first. Change the minimum match score in Tuning and watch the lab verdict flip between answered and declined. Insights shows example data. Everything runs in your browser and nothing is sent anywhere.

adhikar admin · live demo
The Brief

Make retrieval something you can see

Most chatbot problems are retrieval problems, and they are invisible without the right tools.

When a chatbot gives a poor answer, the cause is usually that the right passage was missing, split badly or ranked too low. The admin console makes each of those visible: the text of every document, how it is split into passages, and how a question ranks them.

It pairs with the chatbot through a workspace file. An admin edits documents and settings here, exports the workspace, and the chatbot imports it, so the knowledge base can be updated without touching code.

Fix the library, not the prompt.
What We Built

What the admin gets

01

Document editor

Create, edit, upload (.txt or .md), switch off or delete documents. Headings in the text become sections, and each document shows its word and passage counts.

02

Retrieval lab

Test any question. See the cleaned search terms, how rare each one is, the ranked passages with scores and a verdict on whether it would be answered.

03

Tuning

Passage size and overlap, how many passages to use, the ranking weights and the minimum match score, with a plain-language note on each.

04

Insights

Questions per day, answered versus declined, average best match, content gaps and most cited documents.

05

Workspace export and import

Documents, settings and the question log move between the chatbot and this console as one JSON file.

06

Reset to sample

One button restores the sample library, so it is safe to experiment.

The Product

Inside Adhikar Admin

The same navy and teal as the chatbot, with dense but calm layouts for working through documents and scores.

Select any screen to view it full size.

Design Thinking

Decisions that mattered

Show the evidence

The lab lists every search term with its weight and the passages it matched, so a bad result can be diagnosed in seconds.

Gaps are the roadmap

Declined questions are grouped as content gaps. The next document to write is the one people already asked for.

Safe to experiment

Edits stay on the device until exported, and one click restores the sample library.

Plain language settings

Each setting says what it changes and what happens when it goes too high or too low.

4
Admin pages: documents,
lab, tuning, insights
6
Retrieval settings
to tune
2
Apps linked by one
workspace file
0
Outside requests
made by the demo
Where It Stands

What is real, and what is simulated

The tools work. The library and the question history are samples.

In the demo: document editing and upload, passage splitting, the retrieval lab, all six tuning settings, the insights page and workspace export and import, all on the same BM25 engine as the chatbot.

Not yet: a login, a server, shared editing and version history. The page warns that anyone with the link can open it, so a login is needed before real use. The Insights figures include labelled example data.

Part of the Adhikar project: see Adhikar Desk →

How It Works

From question to cited answer

The demo uses keyword search on purpose. A production build adds a vector database.

The demo keeps everything in the browser: no server, no API key and no outside requests. That makes every score explainable, and it is why there is no vector database here. The trade-off is that keyword search matches words, not meaning, so a question phrased differently from the document can miss. A production system fixes that with embeddings.

In this demo · runs in your browser
  1. 1Split

    Documents are cut at headings into passages of about 80 words with a sentence of overlap.

  2. 2Clean

    Lowercase, remove stop words, stem. “Requests” and “request” become the same term.

  3. 3Rank

    BM25 scores each passage. Rare words count more, and very long passages are not favoured.

  4. 4Decide

    Below a minimum score the app declines. Otherwise it keeps the top 4 passages.

  5. 5Answer

    Extractive: quote the best sentences. Inside Claude: hand the passages to Claude to write a cited answer.

In production · what we would build
  1. 1Ingest

    Upload PDFs and files, extract text, chunk with a proper splitter and keep metadata such as document, section and date.

  2. 2Embed and store

    Create an embedding for each passage and store it in a vector database (pgvector, Qdrant or Pinecone), next to a keyword index.

  3. 3Hybrid search

    Run keyword and vector search together, so exact terms and similar meanings both match, then merge the results.

  4. 4Rerank

    A reranker model re-orders the top 20 passages and keeps the best 4, with the same decline threshold.

  5. 5Generate

    An LLM answers only from those passages, with citations, through a backend API that keeps keys and data off the browser.

Both versions share the parts that make answers trustworthy: passage-level citations, a decline rule for questions the library does not cover, and a log of those questions so the library grows where people actually ask.

In Practice

How the admin should work for real

The console is where a chatbot’s knowledge is governed. Here is how a team would run it.

This section is a design for a production system. It is not built into the live demo above.

01

Add content

Upload documents or paste text. Each carries a category, language, owner and review date.

02

Review and approve

A reviewer checks new and changed documents. Only approved versions are indexed.

03

Test before publishing

Run real questions in the retrieval lab and see which passages rank first and whether the system would answer.

04

Tune with evidence

Adjust passage size, number of passages and the minimum score, then re-run the fixed test set to check nothing got worse.

05

Publish and roll back

Publishing creates a version. If answers get worse, one click returns to the previous version.

06

Watch the gaps

Insights lists declined questions and the most cited documents, so the next document to write is the one people already asked for.

Production Stack

What we would build it with

The admin side adds accounts, history and approvals to the same retrieval engine.

Console
ReactNext.jsThe same interface as the demo, with server-side saving.
API
PythonFastAPIDocuments, versions, settings and the question log.
Database
PostgreSQLpgvectorDocuments, versions, users, audit trail and the passage index in one place.
Files
S3-compatible storageOriginal uploads kept for audit and re-indexing.
Background jobs
CeleryRedisText extraction, OCR and re-indexing run without blocking the admin.
Login and roles
Auth0KeycloakAWS CognitoAdmin, reviewer and read-only roles, with every change logged.
Quality
GitHub ActionsLangfuseThe fixed test set runs automatically on each change to documents or settings.
Governance

What makes it safe to run

The risk in a knowledge base is stale or wrong content, so the console is built around control.

Approval before publishing

No document reaches citizens without a reviewer’s sign-off.

Version history

Every change is recorded with who made it and when, and can be reversed.

Review dates

Documents past their review date are flagged before they go out of date.

An audit trail

Uploads, edits, setting changes and publishes are logged for compliance.

Roles and permissions

Editing, approving and viewing are separate permissions.

Regression tests

A fixed set of questions runs on every change and blocks releases that make answers worse.

See how the chatbot side works in production on Adhikar Desk → To scope a build, tell us about your project →

Under the Hood

Design & stack

Retrieval
BM25StemmingStop wordsThe same engine as the chatbot, so what you test here is what users get.
Interface
React 18htmCSSOne self-contained page with no build step and no outside requests.
Storage
Browser storageJSON exportEdits stay on the device and move to the chatbot as a workspace file.
Production path
LoginDatabaseAPIA backend with accounts and shared storage would replace the file hand-off.

Want something like this for your business?

Tell us a little about your idea. We will tell you honestly what it would take, how long it would take and what it would cost.

  • Free discovery call
  • Reply within 24 hours
  • First working version in 72 hours

Need an admin console for your chatbot or knowledge base?

Document management, retrieval testing and analytics are a focused build. Tell us how your team works and we’ll scope it.

Start a Conversation