PdfSearchAI is a local RAG (Retrieval-Augmented Generation) service that indexes a PDF into Qdrant and answers user queries using Ollama.
- Python 3.10+
- Docker (for Qdrant + Valkey/Redis)
- Ollama running locally
indexing-pdf.py: LoadsResume.pdf, splits text into chunks, builds embeddings, and stores vectors in Qdrant collectionlearning_rag.main.py: Starts the FastAPI application with Uvicorn on0.0.0.0:8000.server.py: Defines API routes to enqueue chat jobs and check job status/results.queues/worker.py: RQ worker logic (process_query) that performs vector search and calls Ollama chat.clients/rq_client.py: Creates the Redis-backed RQ queue client.docker-compose.yml: Starts Qdrant (6333) and Valkey/Redis (6379).
- Create and activate a virtual environment.
python3 -m venv .venv
source .venv/bin/activate- Install dependencies.
pip install -r requirements.txt- Start infrastructure services.
docker compose up -d- Pull required Ollama models.
ollama pull nomic-embed-text
ollama pull llama3.2:1bPlace your PDF at ./Resume.pdf (or update the path in indexing-pdf.py) and run:
python3 indexing-pdf.pyStart the API server:
python3 main.pyStart the RQ worker (in a separate terminal):
export OBJC_DISABLE_INITIALIZE_FORK_SAFETY=YES && rq worker --with-schedulerGET /returns health message.POST /chat?query=...enqueues a background job and returns ajob_id.GET /job?job_id=...returns processing status or final result.
PDF -> chunking -> nomic-embed-text embeddings -> Qdrant (learning_rag)
User query -> queued job (RQ) -> similarity search -> context -> llama3.2:1b -> response