Local-first AI memory system with semantic search. Built in Rust.
Store anything you want to remember, search it semantically, and generate user profiles — all running locally on your machine. No cloud, no subscriptions, no data leaving your box.
- Semantic Search — Find memories by meaning, not just keywords
- REST API — Full HTTP API for integration with any app
- CLI — Command-line interface for quick access
- Profile Builder — Auto-generate user profiles from stored memories
- Bulk Import — Import many memories at once
- Embedded Database — SurrealDB runs inside the binary, no separate server
- Local Embeddings — Uses Ollama for embeddings, everything stays on your machine
# Install Ollama and pull the embedding model
curl -fsSL https://ollama.com/install.sh | sh
ollama pull mxbai-embed-large
# Optional: pull a chat model for profile generation
ollama pull qwen2.5:14bgit clone https://github.com/iamngoni/memorai.git
cd memorai
cargo build --release
# The binary is at ./target/release/memorai
# Optionally, copy it to your PATH:
sudo cp target/release/memorai /usr/local/bin/memorai serveServer starts at http://localhost:8484 by default.
# Add a memory
memorai add "Rust is my favorite programming language" --tags "tech,preferences" --source "conversation"
# Search memories
memorai search "what programming languages do I like?" --limit 5
# View stats
memorai stats
# Generate a profile
memorai profileAll configuration is via environment variables:
| Variable | Default | Description |
|---|---|---|
MEMORAI_PORT |
8484 |
API server port |
MEMORAI_OLLAMA_URL |
http://localhost:11434 |
Ollama API URL |
MEMORAI_EMBED_MODEL |
mxbai-embed-large |
Ollama embedding model |
MEMORAI_CHAT_MODEL |
qwen2.5:14b |
Ollama chat model (for profiles) |
MEMORAI_DATA_DIR |
~/.memorai/data |
Database storage path |
curl http://localhost:8484/healthcurl -X POST http://localhost:8484/v1/memories \
-H "Content-Type: application/json" \
-d '{
"text": "I love building CLI tools in Rust",
"tags": ["rust", "cli", "preferences"],
"source": "conversation"
}'curl "http://localhost:8484/v1/search?q=programming+languages&limit=5"# All memories (paginated)
curl "http://localhost:8484/v1/memories?page=1&per_page=20"
# Filter by tag
curl "http://localhost:8484/v1/memories?tag=rust"
# Filter by source
curl "http://localhost:8484/v1/memories?source=conversation"curl -X DELETE http://localhost:8484/v1/memories/{id}curl -X POST http://localhost:8484/v1/memories/bulk \
-H "Content-Type: application/json" \
-d '{
"memories": [
{"text": "First memory", "tags": ["test"]},
{"text": "Second memory", "tags": ["test"], "source": "import"}
]
}'curl http://localhost:8484/v1/statscurl http://localhost:8484/v1/profilememorai
├── Axum HTTP server (REST API)
├── SurrealDB embedded (storage + indexing)
├── Ollama client (embeddings + chat)
└── Cosine similarity (vector search)
- Storage: SurrealDB in embedded/RocksDB mode — the database lives inside your binary. No external database server needed.
- Embeddings: Generated via Ollama's local API using mxbai-embed-large (1024-dim vectors).
- Search: Cosine similarity computed in Rust over stored embedding vectors.
- Profiles: Generated using Ollama's chat model (qwen2.5:14b by default).
MIT — see LICENSE