A sophisticated Retrieval-Augmented Generation (RAG) system that combines vector-based semantic search with multiple large language models to provide intelligent document-based question answering.
- Multi-LLM Support: Integrates with OpenAI GPT, Anthropic Claude, and Google Gemini
- Vector Search: Advanced semantic search using ChromaDB and sentence transformers
- Document Processing: Support for PDF, DOCX, TXT, MD, JSON, and image files with OCR
- Real-time Analytics: Comprehensive usage analytics and performance metrics
- Knowledge Graph: Visual representation of document relationships and entities
- Document Art Generation: AI-powered visual representations of document content
- WebSocket Support: Real-time collaboration and live updates
- Professional Web Interface: Clean, responsive frontend for document upload and querying
├── backend/
│ ├── app/
│ │ ├── main.py # FastAPI application
│ │ └── config.py # Configuration management
│ ├── models/
│ │ └── schemas.py # Pydantic models
│ └── services/
│ ├── rag_service.py # RAG orchestration
│ ├── vector_store.py # ChromaDB integration
│ ├── document_processor.py # Document parsing
│ ├── knowledge_graph.py # Graph generation
│ └── document_art_generator.py # Visual art creation
├── frontend/
│ └── templates/
│ └── index_clean.html # Web interface
└── documents/ # Sample documents
- Clone the repository
git clone https://github.com/Tanmay081104/Knowledge-based-search-engine.git
cd Knowledge-based-search-engine- Create virtual environment
python -m venv venv
source venv/bin/activate # On Windows: venv\Scripts\activate- Install dependencies
pip install -r requirements.txt- Configure environment variables
cp .env.example .env
# Edit .env with your API keys- Download SpaCy model
python -m spacy download en_core_web_smEdit the .env file with your API keys:
# Choose your preferred LLM provider
GOOGLE_API_KEY=your_google_gemini_api_key_here
## Usage
1. **Start the server**
```bash
python -m uvicorn backend.app.main:app --host 127.0.0.1 --port 8000 --reload-
Access the web interface Open your browser and navigate to
http://127.0.0.1:8000 -
Upload documents Use the web interface to upload PDF, DOCX, TXT, or other supported document formats.
-
Ask questions Enter questions about your uploaded documents and receive AI-powered answers with source citations.
POST /upload- Upload and process documentsPOST /query- Submit questions and receive AI-generated answersGET /knowledge-graph- Generate knowledge graph visualizationPOST /generate-doc-art/{id}- Create visual art from documentsGET /analytics- Retrieve system analytics and metrics