A lightweight vector search library for Rust
Memista combines SQLite for metadata storage with USearch for vector similarity search. It's designed for developers who need a simple, self-contained vector search solution without the complexity of dedicated vector databases.
- Zero infrastructure - Single binary, no external services required
- Familiar storage - SQLite for metadata means easy debugging and backups
- Simple API - REST endpoints that just work
- Rust library - Embed directly in your application
- Multi-tenant ready - Isolated databases via
database_id
Note: Memista is experimental and best suited for prototypes, small-to-medium datasets, and applications where simplicity matters more than scale.
cargo install memista
memistaServer starts at http://127.0.0.1:8083
curl -X POST http://localhost:8083/v1/insert \
-H "Content-Type: application/json" \
-d '{
"database_id": "my_app",
"chunks": [{
"embedding": [0.1, 0.2],
"text": "Hello world",
"metadata": "{\"source\": \"readme\"}"
}]
}'curl -X POST http://localhost:8083/v1/search \
-H "Content-Type: application/json" \
-d '{
"database_id": "my_app",
"embeddings": [[0.1, 0.2]],
"num_results": 5
}'Add to your Cargo.toml:
[dependencies]
memista = "0.1"use memista::{AppState, ChunkData, InsertChunkRequest};
use async_sqlite::{PoolBuilder, JournalMode};
use std::sync::Arc;
#[tokio::main]
async fn main() -> Result<(), Box<dyn std::error::Error>> {
let db_pool = PoolBuilder::new()
.path("memista.db")
.journal_mode(JournalMode::Wal)
.open()
.await?;
let app_state = Arc::new(AppState { db_pool });
// Now use app_state with Memista's functions
Ok(())
}| Endpoint | Method | Description |
|---|---|---|
/v1/insert |
POST | Store chunks with embeddings |
/v1/search |
POST | Find similar chunks |
/v1/drop |
DELETE | Remove a database |
/openapi.json |
GET | OpenAPI specification |
/swagger-ui/ |
GET | Interactive API docs |
# Environment variables (or use .env file)
DATABASE_PATH=memista.db # SQLite file location
SERVER_HOST=127.0.0.1 # Bind address
SERVER_PORT=8083 # Listen port
LOG_LEVEL=info # debug|info|warn|errormemista/
├── src/ # Core library and server
├── examples/ # Usage examples
├── benchmarks/ # Performance scripts
├── documentation/ # MkDocs site
├── scripts/ # Dev utilities
└── config/ # Sample configurations
cargo run --example basic_usage # Start server programmatically
cargo run --example library_usage # Direct library usage
cargo run --example advanced_usage # Document processing pipeline
cargo run --example http_client # HTTP client demoLocal docs:
cd documentation && pip install -r requirements.txt && mkdocs serve- User Guide - Getting started & examples
- API Reference - Rust documentation
Be aware of these constraints:
- Embedding dimensions: Currently hardcoded to 2D (demo purposes)
- Scale: Not tested beyond ~100k vectors
- Persistence: Index rebuilds on dimension changes
- No auth: Add a reverse proxy for production
Contributions welcome! This is an experimental project, so:
- Open an issue first for major changes
- Keep PRs focused and small
- Add tests for new functionality
GPL-3.0 - Free to use, modify, and distribute with same license.
Built with SQLite + USearch + Actix-web