MistralVDB
A vector database optimized for Mistral AI embeddings with HNSW indexing. Features include:
- Efficient similarity search using HNSW indexing
- Vector compression for reduced memory usage
- Built-in REST API server
- Secure authentication
- Multiple collection support
- Automatic persistence
Installation
pip install mistralvdb
Quick Start
As a Python Library
from mistralvdb import MistralVDB
# Initialize database
db = MistralVDB(
api_key="your-mistral-api-key",
collection_name="my_collection"
)
# Add documents
texts = [
"The quick brown fox jumps over the lazy dog",
"Python is a versatile programming language"
]
metadata = [
{"type": "example"},
{"type": "programming"}
]
ids = db.add_texts(texts, metadata=metadata)
# Search
results = db.search("programming language", k=4)
for doc_id, score in results:
print(f"Score: {score}")
print(f"Text: {db.get_text(doc_id)}")
print(f"Metadata: {db.get_metadata(doc_id)}\n")
As an API Server
- Start the server:
# Set your API key
export MISTRAL_API_KEY=your-mistral-api-key
# Start server
mistralvdb-server --host 127.0.0.1 --port 8000
- Use the client:
from mistralvdb.client import MistralVDBClient
# Create client
client = MistralVDBClient()
# Login (default credentials)
client.login(username="admin", password="admin-password")
# Add documents
docs = ["Document 1", "Document 2"]
client.add_documents(docs, collection_name="my_collection")
# Search
results = client.search("my query", collection_name="my_collection")
Features
HNSW Indexing
- Efficient approximate nearest neighbor search
- Configurable index parameters (M, ef_construction, ef)
- Thread-safe operations
Vector Compression
- Product Quantization for reduced memory usage
- Configurable compression parameters
- Minimal accuracy loss
API Server
- RESTful API with FastAPI
- JWT authentication
- Collection management
- Swagger UI documentation
Storage Management
- Automatic persistence
- Multiple collections
- Custom storage location
- Collection metadata
Configuration
Environment Variables
MISTRAL_API_KEY: Your Mistral AI API key (required)
Server Options
mistralvdb-server --help
Development
- Clone the repository:
git clone https://github.com/yourusername/mistralvdb.git
cd mistralvdb
- Install development dependencies:
pip install -e ".[dev]"
- Run tests:
pytest tests/
License
MIT License - see LICENSE file for details.
Contributing
Contributions are welcome! Please feel free to submit a Pull Request.
Metadata
Release files for mistralvdb 0.1.0
For a detailed explanation of source distributions (sdists) and built distributions (wheels), please see the package formats documentation.
Source distribution (sdist)
| File | Size | Uploaded | Provenance | |
|---|---|---|---|---|
| mistralvdb-0.1.0.tar.gz | 19.6 kB | Without provenance | Details |
Built distribution (wheel)
| File | Interpreter | ABI | Platform | Reset |
|---|---|---|---|---|
| mistralvdb-0.1.0-py3-none-any.whl | Python 3 | none | any | Details |
Total release size: 33.9 kB
Release files / mistralvdb-0.1.0.tar.gz
| Download URL | mistralvdb-0.1.0.tar.gz |
|---|---|
| Size | 19.6 kB |
| Tags | Source |
|
SHA-256 checksum How to use checksums |
046e0db0ab0373e22e4eda7f7acd91169e6a959dfe548c2f54c24318aef96b77
|
|
BLAKE2b-256 checksum How to use checksums |
ba1bace817dbfcb6679f0bb6a9273cc5d10e55b577d174f4ebc1e76f648e223b
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
No |
| Uploaded via |
twine/6.0.1 CPython/3.12.4
|
Release files / mistralvdb-0.1.0-py3-none-any.whl
| Download URL | mistralvdb-0.1.0-py3-none-any.whl |
|---|---|
| Size | 14.3 kB |
| Tags | Python 3 |
|
SHA-256 checksum How to use checksums |
6e775ec99bf2384dd62e2ce1a83e2a1a7d173549ba285c5c3fc3d8cd2de4353a
|
|
BLAKE2b-256 checksum How to use checksums |
ce438dbfb252fc0346737177f3e5d558e309faea345b13520e73e10295735719
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
No |
| Uploaded via |
twine/6.0.1 CPython/3.12.4
|
Security for mistralvdb 0.1.0
Provenance
Provenance describes where a file came from. On PyPI, provenance is shared via attestations, which provide a verifiable record of the build or publishing details. View details, limitations and caveats.
No provenance found
None of the files in this release were uploaded with provenance metadata.
A note on package security
PyPI is a repository for distributing packages, not a service for auditing them. While third-party security researchers and our staff do their best to detect and remove malicious packages, PyPI cannot guarantee the quality, security or suitability of any given package.
To learn more about protecting yourself from malicious actors, visit our package security documentation.