A NotebookLM-inspired AI research assistant. Upload a document β from any field of life (business, legal, medical, academic, personal, technical, etc.) β and ask questions about it. Answers are generated only from the content of your uploaded files using Retrieval-Augmented Generation (RAG).
- Multi-format ingestion: PDF, Word (
.docx), Excel (.xlsx/.xls), CSV, TXT, and images (.jpg/.png, via OCR). - Semantic search:
fastembed(ONNX, no PyTorch) embeddings +FAISSvector index. - Grounded answers:
Groq(openai/gpt-oss-20b) generates answers strictly from retrieved context, with source attribution. - Modern, modular UI: three-column NotebookLM-style layout (Sources & History / Chat / Studio) built with Streamlit + custom CSS.
- Clean, scalable codebase: parsing, chunking, embeddings, vector store, LLM calls, and UI are all separated into their own modules.
- Upload a file β
file_parsers.pyextracts raw text (OCR for images). - Chunk the text into overlapping ~220-word pieces (
text_chunker.py). - Embed each chunk with
all-MiniLM-L6-v2(embeddings.py). - Index the vectors in a FAISS
IndexFlatIPstore (vector_store.py). - Ask a question β the question is embedded and the top-K most similar chunks are retrieved.
- Generate β retrieved chunks are passed as context to Groq's
openai/gpt-oss-20bmodel, which is instructed to answer only from that context.
git clone https://github.com/<Kamran-31>/knowledge-assistant.git
cd knowledge-assistant
python -m venv venv
source venv/bin/activate # Windows: venv\Scripts\activatepip install -r requirements.txtGet a free key at console.groq.com, then:
cp .streamlit/secrets.toml.example .streamlit/secrets.tomlEdit .streamlit/secrets.toml:
GROQ_API_KEY = "gsk_your_real_key_here"(Alternatively, paste the key into the βοΈ Settings popover inside the running app β useful for quick testing without touching secrets.)
streamlit run app.pyOpen the local URL Streamlit prints (usually http://localhost:8501).
- Answers are grounded strictly in uploaded content β if the document doesn't contain the answer, the assistant says so instead of guessing.
- Image OCR quality depends on image clarity; scanned/handwritten text may extract poorly.
- The in-app "Notebook History" and "Studio" tools reflect the current browser session only (no database is wired up) β everything resets on a full app restart. Swap in a persistent store (SQLite/Postgres/S3) if you need durability across sessions.
- Vector index is in-memory per session; very large documents will use
more RAM β trim
CHUNK_SIZE_WORDS/file size if you hit Streamlit Cloud's free-tier memory limits.