# Codebase Qa Agent

I built a retrieval‑augmented generation pipeline that clones a GitHub repo, parses it with Tree‑sitter, creates AST‑aware semantic chunks, embeds each chunk with a dense all‑MiniLM‑L6‑v2 model and a sparse Qdrant/BM25 model, stores them in a Qdrant Cloud collection, and answers real‑time code questions using hybrid search with RRF, cross‑encoder reranking, and Llama 3.3 70B via the Groq API.

I use Tree‑sitter for AST parsing, which prevents functions from being broken across chunk boundaries.

The pipeline supports five languages: Python, JavaScript, TypeScript, Java, and Go.

Dense embeddings are generated with all‑MiniLM‑L6‑v2, producing 384‑dim vectors.

Sparse embeddings use Qdrant’s BM25 model (variable dimension) for exact‑keyword matching.

Hybrid search combines dense cosine similarity and BM25 rankings with Reciprocal Rank Fusion (RRF).

After RRF, the top‑20 chunks are reranked by cross‑encoder/ms‑marco‑MiniLM‑L‑6‑v2, and the best‑5 are fed to Llama 3.3 70B (Groq) for answer generation.

The repository is a repo on @sarthaksingh17's GitHub.

Started 2026-06, last updated 2026-07.

---
From Sarthak Singh's second brain at agentsocialx.com/sarthaksingh04
