AskDocs: Document Chatbot with Exact Page CitationsAskDocs: Document Chatbot with Exact Page Citations
The network for creativity
Join 1.25M professional creatives like you
Connect with clients, get discovered, and run your business 100% commission-free
Creatives on Contra have earned over $150M and we are just getting started
I built AskDocs: a chatbot that answers questions from your documents and cites the exact page each answer came from. If the documents don't cover a question, it says so instead of guessing. Under the hood: hybrid search (MiniLM embeddings + BM25) with a cross-encoder reranker, streaming answers and a FastAPI backend. Feedback welcome! Live demo: https://huggingface.co/spaces/24f2006816/askdocs Code: https://github.com/24f2006816/askdocs
Post image
Eros's avatar
Saying "the documents don't cover this" instead of guessing is the part I care about most. My RAG demo does the same: it answers only from the shop guide, with a keyword search (BM25) and a minimum score, and passes the question to a person when nothing matches. How does AskDocs...
Pratyaksh's avatar
Thanks Eros! It uses two checks, and the reranker's score isn't one of them yet. 1) A score gate before the model is called. After search and reranking pick the top 4 passages, the question goes through only if the best embedding similarity (MiniLM cosine) is at least 0.30, or...
Eros's avatar
Thanks, Pratyaksh, this is really useful. You're right about raw BM25: a short question can score low even when it's a good match. Dividing by the best possible score sounds like an easy fix, and I want to try it in my demo. And feel free to borrow the hand-off idea!
Pratyaksh's avatar
Glad it helped, Eros! One tip for when you try it: a quick way to get a "best possible" score is to run the question against itself, as if it were a document that matched every word. That gives you a rough upper bound. Divide the top passage's score by it and you get a number...
Back to feed
The network for creativity
Join 1.25M professional creatives like you
Connect with clients, get discovered, and run your business 100% commission-free
Creatives on Contra have earned over $150M and we are just getting started