QueryMind is an AI-powered Retrieval-Augmented Generation (RAG) application that enables users to query unstructured data using natural language. The system ingests documents, generates vector embeddings, stores them in Qdrant, retrieves semantically relevant information, and uses a Large Language Model (LLM) to generate accurate, context-aware responses.
- Document ingestion pipeline
- Automatic text chunking
- Embedding generation
- Vector similarity search using Qdrant
- Retrieval-Augmented Generation (RAG)
- Natural language question answering
- Metadata storage and retrieval
- Dockerized deployment
- Modular LLM provider architecture
- Python
- SQLAlchemy
- Alembic
- PostgreSQL
- Qdrant (Vector Database)
- Ollama
- Embedding Models
- Retrieval-Augmented Generation (RAG)
- Docker
- Docker Compose
Documents
│
▼
Document Ingestion
│
▼
Text Chunking
│
▼
Embedding Generation
│
▼
Qdrant Vector Database
│
Vector Similarity Search
│
▼
Retrieved Context
│
▼
Ollama LLM
│
▼
Natural Language Answer
Documents are read and processed before being stored.
Large documents are divided into smaller chunks suitable for embedding generation.
Each chunk is converted into a dense vector representation using an embedding model.
Embeddings are stored inside Qdrant along with references to the original documents and associated metadata.
When a user asks a question:
- The question is converted into an embedding.
- A similarity search retrieves the most relevant document chunks.
- Retrieved context is sent to the LLM.
The LLM generates an answer grounded in the retrieved context instead of relying solely on its pre-trained knowledge.
User Question
│
▼
Generate Query Embedding
│
▼
Qdrant Similarity Search
│
▼
Retrieve Top-k Chunks
│
▼
Send Context + Question to LLM
│
▼
Generate Answer
│
▼
Return Response
- Hybrid Search (Vector + Keyword)
- Multi-document retrieval
- Streaming responses
- Conversation memory
- User authentication
- Web interface
- Knowledge graph integration
- API endpoints for external applications
- These instructions assume you already have Docker, Git, and Python installed on your host.
git clone https://github.com/siddharth-57/QueryMind.git
cd QueryMind
Create a virtual environment using Python 3.11:
python3.11 -m venv venv
Activate the virtual environment:
source venv/bin/activate
pip install -r requirements.txt
Copy the example environment file:
cp .env.example .env
Fill the .env file with the required credentials.
Use Ollama to run open-source models locally on your host.
brew install ollama
ollama serve
Note: Keep this terminal window open.
Pull the embedding model:
ollama pull qwen3-embedding:4b
Pull the LLM model:
ollama pull qwen3:8b
Note: You can replace these model names with other models available on Ollama or even use an API to access any other model.
docker compose up -d
Connect to the PostgreSQL database:
docker exec -it QueryMind-postgres psql -U postgres -d QueryMind
Inside PostgreSQL, enable the extension:
CREATE EXTENSION IF NOT EXISTS vector;
To verify that the extension has been enabled:
\dx
Although the pgvector image includes the extension binaries, PostgreSQL still requires you to enable the extension once per database using
CREATE EXTENSION.
Generate the migration:
alembic revision --autogenerate -m "create tables"
Apply the migration:
alembic upgrade head
Run the following scripts in order.
python3 -m QueryMind.scripts.test_sync_service
python3 -m QueryMind.scripts.test_preprocessing_pipeline
python3 -m QueryMind.scripts.test_qdrant
python3 -m QueryMind.scripts.index_chunks
python3 -m QueryMind.scripts.test_retrieval