Upload any PDF. Ask anything. Get instant, cited answers β powered by Groq's
openai/gpt-oss-120band hybrid retrieval.
Scribe is a production-grade RAG (Retrieval-Augmented Generation) application that lets you have a real conversation with your documents. Upload one or more PDFs, and Scribe will:
- Auto-summarise every document the moment it's uploaded
- Answer questions grounded strictly in your document content β no hallucinations
- Retrieve with hybrid search β combining exact keyword matching (BM25) and semantic search (FAISS), then reranking with a cross-encoder for precision
- Cite every answer with the exact source file and page number
- Stream responses token-by-token like a real chat interface
- Export your conversation as a formatted Markdown file
| Feature | Details |
|---|---|
| β‘ Fast inference | Groq's LPU delivers openai/gpt-oss-120b responses in ~2s |
| π Hybrid retrieval | BM25 (lexical) + FAISS (semantic) fused via Reciprocal Rank Fusion β catches exact terms and numbers that pure embedding search often misses |
| π― Cross-encoder reranking | Top candidates from hybrid retrieval are rescored with a cross-encoder for higher precision before generation |
| π Auto-summary | Each uploaded PDF is summarised in 3β4 sentences before you ask anything |
| π Page citations | Every answer shows filename Β· page N chips so you know exactly where the answer came from |
| π¬ Multi-turn memory | Conversation context is preserved across turns via ConversationBufferMemory |
| β¬οΈ Chat export | Download the full conversation with sources as a .md file |
| π¨ Polished UI | Custom dark theme with DM Sans, streaming cursor, document cards, and status indicators |
| Layer | Technology |
|---|---|
| LLM | Groq Β· openai/gpt-oss-120b |
| Embeddings | sentence-transformers/all-MiniLM-L6-v2 via HuggingFace |
| Lexical Retrieval | BM25Retriever (rank_bm25) |
| Vector Store | FAISS (in-memory, CPU) |
| Retrieval Fusion | EnsembleRetriever (Reciprocal Rank Fusion) |
| Reranking | CrossEncoderReranker β cross-encoder/ms-marco-MiniLM-L-6-v2 |
| RAG Framework | LangChain ConversationalRetrievalChain |
| PDF Parsing | PyPDF2 with per-page metadata extraction |
| Frontend | Streamlit with custom CSS |
| Memory | ConversationBufferMemory |
flowchart TD
A[/PDF Upload/]
B[Per-page text extraction<br/>PyPDF2]
C[Recursive chunking<br/>1000 tokens, 150 overlap]
D[Embedding<br/>all-MiniLM-L6-v2]
E[FAISS dense index]
F[BM25 lexical index]
Q[/User Question/]
G[Reciprocal Rank Fusion<br/>EnsembleRetriever]
H[Cross-encoder reranking<br/>top-4 chunks]
I[OpenAI/gpt-oss-120b via Groq<br/>streaming generation]
J[/Answer + page-level citations/]
A --> B --> C
C --> D --> E
C --> F
E --> G
F --> G
Q --> G
G --> H --> I --> J
git clone https://github.com/Sanya003/Scribe
cd Scribepip install -r requirements.txtCreate a .env file in the root directory:
GROQ_API_KEY=your_groq_api_key_herestreamlit run app.py- Upload one or more PDF files using the sidebar
- Click β‘ Analyse Documents β Scribe will index and summarise your files
- Ask any question in the chat input
- Answers stream in real time with page-level source citations
- Click β¬οΈ Export Chat to download your conversation
Scribe/
βββ app.py # Main Streamlit app
βββ requirements.txt # Dependencies
βββ .env # API keys
βββ README.md