SAAD-DEV

saad-dev.com / work / ai_knowledge_bot

RAG · cited answers

ai_knowledge_bot

Point it at a codebase, ask it how onboarding works. Every answer carries file:line citations, so a wrong answer is falsifiable in one click.

$ kb ask "how does auth work?"
  1. [ingest] 1,204 files → chunks 18.3s
  2. [embed] voyage-code-3 · pgvector
  3. [retrieve] top-k 8 · graded
  4. [answer] grounded · 2 citations 2.2s
  5. ✓ auth.py:42 · middleware.py:118 · 3 claude calls

What it does

A retrieval-augmented (RAG) app for getting up to speed on an unfamiliar codebase: ingest a repository, ask questions in plain English, and get answers grounded in the code with clickable file:line citations. When the code does not answer the question, it says so instead of guessing.

How it works

  • Ingests a local folder or a public GitHub repo, chunked with a line-window chunker.
  • Two retrieval modes: Postgres full-text search, or voyage-code-3 embeddings with pgvector.
  • A LangGraph flow rewrites the question, grades the retrieved chunks, then answers with citations.
  • At most three Claude calls per question.
  • An explicit 'not found' path, and every retrieved chunk and grade visible in the UI.

By the numbers

  • ≤3 Claude calls per question
  • file:line citations
  • 2 retrieval modes

Stack

  • Python
  • LangGraph
  • Anthropic Claude
  • Voyage AI
  • PostgreSQL
  • pgvector
  • Streamlit
  • Docker

Questions

Can I run ai_knowledge_bot myself?

Yes. It is open source at https://github.com/s-wasim/ai_knowledge_bot, and the README walks through running it locally.

Can Saad Waseem build something like ai_knowledge_bot for my team?

Yes. He builds production AI agents and automations like this one, remotely from Lahore for teams in the US and EU, at $40/hr for build work. Book 20 minutes from the CV, or email saad@saad-dev.com.