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, enhances user queries for improved retrieval, retrieves semantically relevant information, and uses a configurable Large Language Model (LLM) to generate accurate, context-aware responses.
- Document ingestion pipeline
- Automatic text preprocessing and chunking
- Embedding generation
- Vector similarity search using Qdrant
- Query enhancement for improved retrieval
- Retrieval-Augmented Generation (RAG)
- Natural language question answering
- Metadata storage and retrieval
- Configurable embedding providers
- Configurable LLM providers
- Modular provider architecture
- Dockerized deployment
- Python
- SQLAlchemy
- Alembic
- PostgreSQL
- Qdrant (Vector Database)
- Ollama
- OpenAI
- Anthropic
- Gemini
- Voyage AI
- Embedding Models
- Retrieval-Augmented Generation (RAG)
- Docker
- Docker Compose
Documents
│
▼
Document Ingestion
│
▼
Text Preprocessing
│
▼
Text Chunking
│
▼
Embedding Generation
│
▼
Embedding Provider
┌──────────┼──────────┐
│ │ │
Ollama OpenAI Voyage
│ │ │
└──────────┼──────────┘
│
▼
Qdrant Vector Database
│
│
User Question
│
▼
Query Enhancement
│
▼
Multiple Search Queries
│
▼
Embedding Generation
│
▼
Vector Similarity Search
│
▼
Retrieved Context
│
▼
Prompt Builder
│
▼
LLM Service
│
▼
LLM Provider
┌──────────┼──────────┬──────────┐
│ │ │ │
Ollama OpenAI Anthropic Gemini
│ │ │ │
└──────────┼──────────┼──────────┘
│
▼
Natural Language Answer
Documents are read and processed before being stored.
Large documents are processed and divided into smaller chunks suitable for embedding generation and semantic retrieval.
Each chunk is converted into a dense vector representation using the configured embedding provider.
QueryMind supports multiple embedding providers:
- Ollama
- OpenAI
- Voyage AI
The active provider and model are configured through environment variables.
Embeddings are stored inside Qdrant along with the original document chunks and associated metadata.
When a user asks a question, the query is first passed through the query enhancement component.
The LLM generates search-oriented queries that can improve semantic retrieval.
Each generated search query is converted into an embedding.
The embeddings are used to perform similarity searches against Qdrant.
The retrieved results are combined and duplicate contexts are removed before being passed to the LLM.
The original user question and the retrieved context are combined using the Prompt Builder to construct the final prompt.
The final prompt is passed to the configured LLM through the LLM Service.
QueryMind supports multiple LLM providers:
- Ollama
- OpenAI
- Anthropic
- Gemini
The provider is selected through environment variables, allowing the underlying LLM to be changed without modifying the RAG pipeline.
User Question
│
▼
Query Enhancement
│
▼
Generate Search Queries
│
▼
Generate Query Embeddings
│
▼
Qdrant Similarity Search
│
▼
Retrieve Relevant Chunks
│
▼
Remove Duplicate Context
│
▼
Build Prompt
│
▼
Send Prompt 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
- Retrieval and answer evaluation
- RAG quality and performance monitoring
- These instructions assume you already have Docker, Git, and Python installed on your host.
- Ollama is required if you are using Ollama as an LLM or embedding provider.
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
Configure the .env file with the required provider, model, database, and API key settings.
Example:
#################################################
# Embedding Configuration
#################################################
EMBEDDING_PROVIDER=ollama
EMBEDDING_MODEL=qwen3-embedding:4b
EMBEDDING_DIMENSION=2560
#################################################
# LLM Configuration
#################################################
LLM_PROVIDER=ollama
LLM_MODEL=qwen3:8b
#################################################
# API Keys
#################################################
OPENAI_API_KEY=
ANTHROPIC_API_KEY=
GOOGLE_API_KEY=
VOYAGE_API_KEY=
API keys are only required when using the corresponding provider.
Use Ollama to run open-source models locally on your host.
brew install ollama
ollama serve
Note: Keep this terminal window open when using Ollama providers.
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 by updating the corresponding values in
.env.
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 from the QueryMind project root.
python3 -m scripts.test_sync_service
python3 -m scripts.test_preprocessing_pipeline
python3 -m scripts.test_qdrant
python3 -m scripts.index_chunks
python3 -m scripts.test_search
python3 -m scripts.test_llm
python3 -m scripts.test_prompt_builder
python3 -m scripts.test_retrieval