Advanced Research Assistant powered by RAG (Retrieval-Augmented Generation)
easyResearch is an AI application that helps you query and ask questions on your own documents. The system uses advanced RAG technology to:
- π Read and analyze documents (PDF, DOCX, TXT, Code)
- π Hybrid Search (Vector + BM25 keyword search)
- π¬ Answer questions based on document content
- π Multi-language support (Vietnamese & English)
- π― Cross-Encoder Reranking for better accuracy
| Feature | Description |
|---|---|
| π Workspace Management | Organize documents by project/topic separately |
| π₯ Multi-format Import | Support PDF, DOCX, TXT, Python code |
| π§ Parent Document | Small chunks for search, large chunks for context |
| β‘ GPU Acceleration | Optimized for NVIDIA GPU (CUDA) |
| π Multi-LLM Support | Groq (LLaMA 3.3) or Google Gemini |
| π RESTful API | Easy integration via FastAPI |
| π¨ AnythingLLM Theme | Dark zinc UI inspired by AnythingLLM |
| π Workspace Stats | Mini stat cards (docs, vectors, storage size) |
| π Auto-Summarizer | Automatic summary generation after document upload |
| π Smart Context | Only contextualize when needed (faster response) |
| π¬ Chat Persistence | Auto-save/load chat history per workspace |
| ποΈ Context Depth | Fast / Accurate / Detailed search modes |
| ποΈ File Management | Delete individual files from workspace |
| π Recent Questions | Quick access to recent queries in sidebar |
easyResearch/
βββ app.py # Streamlit Interface (Web UI)
βββ main.py # FastAPI Server (REST API)
βββ core/
β βββ loader.py # Parent Document Retrieval & Smart Splitter
β βββ embedder.py # Vectorization & ChromaDB Management
β βββ generator.py # Advanced RAG Pipeline
β βββ summarizer.py # Auto-Summarization
βββ database/
β βββ chroma_db/ # Vector Database Storage
β βββ chat_history/ # Persistent Chat History (JSON per workspace)
βββ uploads/ # Temporary File Storage
- LLM: Groq (LLaMA 3.3 70B) or Google Gemini 2.0 Flash
- Embedding: HuggingFace
paraphrase-multilingual-MiniLM-L12-v2 - Reranker: CrossEncoder
ms-marco-MiniLM-L-6-v2 - Vector DB: ChromaDB
- Keyword Search: BM25 (rank-bm25)
- Framework: LangChain, Streamlit, FastAPI
Question β Smart Contextualization β Vector Search
β
BM25 Scoring
β
Cross-Encoder Reranking
β
Hybrid Score (0.7ΓRerank + 0.3ΓBM25)
β
Parent Document Retrieval β LLM Answer
| Component | Benefit |
|---|---|
| Hybrid Search | Combines semantic + keyword matching |
| Parent Document | Small chunks (400) for search, large (2000) for context |
| Smart Contextualization | Only calls LLM when pronouns/references detected |
| Cross-Encoder | Local reranking (no API calls) |
- Python 3.10+
- NVIDIA GPU with CUDA (recommended) or CPU
-
Clone repository
git clone https://github.com/your-username/easyResearch.git cd easyResearch -
Create virtual environment
python -m venv venv # Windows venv\Scripts\activate # Linux/Mac source venv/bin/activate
-
Install dependencies
pip install -r requirements.txt
-
Configure API Key
Create a
.envfile in the root directory:GROQ_API_KEY=your_groq_api_key_here GOOGLE_API_KEY=your_gemini_api_key_here # Optional
π‘ Get Groq API Key at console.groq.com π‘ Get Gemini API Key at aistudio.google.com/apikey
streamlit run app.pyAccess: http://localhost:8501
uvicorn main:app --reloadAccess Swagger UI: http://localhost:8000/docs
{
"question": "Your question here",
"collection_name": "notebook_name",
"k_target": 10,
"api_key": "your_api_key_here"
}Response:
{
"answer": "AI generated answer",
"sources": ["file1.pdf", "file2.docx"]
}curl -X POST "http://localhost:8000/upload?collection_name=my_research" \
-F "file=@document.pdf"| File Type | Parent Size | Child Size | Notes |
|---|---|---|---|
| PDF, DOCX | 2500 | 500 | Preserve long text context |
| Code (.py, .js) | 1500 | 400 | Split by function/class |
| JSON, CSV | 1000 | 300 | Don't split mid-object |
| Default Text | 2000 | 400 | Balanced |
- Hybrid Score:
0.7 Γ Rerank + 0.3 Γ BM25 - Min Score Threshold: 0.1 (filter low relevance)
| Mode | k (documents) | Use Case |
|---|---|---|
| β‘ Fast | 5 | Quick answers, low latency |
| π― Accurate | 10 | Balanced (default) |
| π Detailed | 18 | Deep research, comprehensive info |
- Create New: Select "β New workspaceβ¦" from dropdown and name it
- Switch: Select workspace from dropdown β badge shows active workspace
- Delete Workspace: Go to βοΈ Settings tab β "π Delete workspace"
- Delete File: Click β next to any file in the π Files list
- Clear Chat: Go to βοΈ Settings tab β "π Clear chat"
- Chat Persistence: Conversations auto-save per workspace and reload on switch
- Recent Questions: Quick access to last 5 questions in sidebar
- Auto-Summary: Generated automatically after uploading documents
| Tab / Section | Function |
|---|---|
| π Workspace Selector | Select/create workspace with stats cards |
| π Documents Tab | Upload files, view summary, file list with delete |
| π Recent Questions | Quick-access to recent queries (in Documents tab) |
| βοΈ Settings Tab | LLM provider, API key, clear chat, delete workspace |
| ποΈ Context Depth | Fast / Accurate / Detailed radio pills (main area) |
The interface uses an AnythingLLM-inspired dark theme:
| Element | Color | Description |
|---|---|---|
| Sidebar | #111111 |
Deep dark background |
| Main area | #1c1c1f |
Slightly lighter dark |
| Inputs / Cards | #27272a |
Zinc-800 for form elements |
| Borders | #3f3f46 |
Subtle zinc-700 borders |
| Accent (buttons) | #4f46e5 |
Indigo primary buttons |
| Chat input | #303034 |
Unified single-color box |
| Font | Inter | Clean sans-serif via Google Fonts |
Note: CSS targets specific selectors (not
*) to preserve Streamlit's Material Symbols Rounded icons.
| Issue | Solution |
|---|---|
| Missing API Key | Create .env file or enter key in sidebar |
| CUDA Error | Check NVIDIA driver or run on CPU |
| VRAM Overflow | Reduce batch size in embedder.py |
| Slow Response | Already optimized (1-2 LLM calls only) |
MIT License - See LICENSE file for more details.
Made with β€οΈ by easyResearch