This project provides a vector search API built with LangChain, Qdrant, and Ollama for embedding-based retrieval. The API allows users to create collections, add documents, and perform similarity searches using vector embeddings.
Ensure you have the following installed:
-
Clone this repository:
git clone [<repository-url>](https://github.com/ana3A/OllamaQVector.git) cd OllamaQVector
-
Start the services using Docker Compose:
docker-compose up -d --build
This will initialize the following services:
- App (Express server running the API)
- Qdrant (Vector database for storage and retrieval)
- Ollama (Embeddings model server)
-
Pull the embedding model: After the containers are running, you need to pull the required embedding model. Run:
docker exec -it ollama ollama pull nomic-embed-textIf using a different Ollama embedding model, update
embeddings.service.tswith the correct model name and pull it using the same command.
- Create a collection:
POST /collections/create - List collections:
GET /collections/list - Delete a collection:
DELETE /collections/:collectionName - Get collection metadata:
GET /collections/:collectionName/metadata
- Add a document:
POST /documents/add - Add multiple documents:
POST /documents/add-multiple - Delete a document:
DELETE /documents/:collectionName/:documentId - Update a document:
PUT /documents/update
- Perform similarity search:
POST /search/search
| Variable | Default Value | Description |
|---|---|---|
PORT |
3000 |
API server port |
QDRANT_HOST |
http://qdrant:6333 |
Qdrant service URL |
OLLAMA_URL |
http://ollama:11434 |
Ollama service URL |
├── controllers/
├── routes/
│ ├── collection.router.ts
│ ├── document.router.ts
│ ├── search.router.ts
├── services/
│ ├── document.service.ts
│ ├── embeddings.service.ts
│ ├── qdrant.service.ts
│ ├── vectorStore.service.ts
├── Dockerfile
├── docker-compose.yaml
└── README.md
To stop the running containers, execute:
docker-compose down- The
ollama pullcommand must be run after the container is initialized for the first time. - If using a different embedding model, ensure you modify the
EmbeddingServiceclass inembeddings.service.tsto reflect the correct model name.
MIT License