GeneralBots uses **Qdrant** as the vector database for storing and searching embeddings. The Rust client `qdrant-client` is used to communicate with the service.
## Configuration
The connection is configured via environment variables:
```env
QDRANT_URL=http://localhost:6333
QDRANT_API_KEY=your-api-key # optional
```
These values are read at startup and passed to the `QdrantClient`.
## Collection Mapping
Each `.gbkb` collection maps to a Qdrant collection with the same name. For example, a knowledge base named `company-policies` becomes a Qdrant collection `company-policies`.
## Operations
- **Insert** – Performed during indexing (see Chapter03).
- **Search** – Executed by the `FIND` keyword, which sends a query vector and retrieves the top‑k nearest neighbors.
- **Delete/Update** – When a document is removed or re‑indexed, the corresponding vectors are deleted and replaced.
## Performance Tips
- Keep the number of vectors per collection reasonable (tens of thousands) for optimal latency.
- Adjust Qdrant’s `hnsw` parameters in `QdrantClient::new` if you need higher recall.
- Use the `FILTER` option to restrict searches by metadata (e.g., source file).