Lightweight memory system for AI agents with vector search and graph storage
Project description
MEMG Core
Lightweight memory system for AI agents with dual storage (Qdrant + Kuzu)
Features
- Vector Search: Fast semantic search with Qdrant
- Graph Storage: Optional relationship analysis with Kuzu
- Offline-First: 100% local embeddings with FastEmbed - no API keys needed
- MCP Compatible: Ready-to-use MCP server for AI agents
- Lightweight: Minimal dependencies, optimized for performance
Quick Start
Option 1: Docker (Recommended)
# 1. Create configuration (no API key needed!)
cp env.example .env
# 2. Run MEMG MCP Server (359MB)
docker run -d \
-p 8787:8787 \
--env-file .env \
ghcr.io/genovo-ai/memg-core-mcp:latest
# 3. Test it's working
curl http://localhost:8787/health
Option 2: Python Package (Core Library)
pip install memg-core
# Set up environment variables for storage paths
export QDRANT_STORAGE_PATH="/path/to/qdrant"
export KUZU_DB_PATH="/path/to/kuzu.db"
# Use the core library in your app
# Example usage shown below in the Usage section
Development setup
# 1) Create virtualenv and install slim runtime deps for library usage
python3 -m venv .venv && source .venv/bin/activate
pip install -r requirements.txt
# 2) For running tests and linters locally, install dev deps
pip install -r requirements-dev.txt
# 3) Run tests
export MEMG_TEMPLATE="software_development"
export QDRANT_STORAGE_PATH="$HOME/.local/share/qdrant"
export KUZU_DB_PATH="$HOME/.local/share/kuzu/memg.db"
mkdir -p "$QDRANT_STORAGE_PATH" "$HOME/.local/share/kuzu"
PYTHONPATH=$(pwd)/src pytest -q
Usage
from memg_core.api.public import add_note, add_document, add_task, search
# Add a note
note = add_note(
text="Set up Postgres with Docker for local development",
user_id="demo_user",
title="Docker Postgres Setup",
tags=["docker", "postgres", "dev"],
)
# Search (GraphRAG-first pipeline)
results = search("postgres performance", user_id="demo_user", limit=5)
for r in results:
print(f"[{r.memory.memory_type.value}] {r.memory.title} - Score: {r.score:.2f}")
YAML registries (optional)
Core ships with three tiny registries under integration/config/:
core.minimal.yaml: basic typesnote,document,taskwith anchors and generic relationscore.software_dev.yaml: addsbug+solutionandbug_solutionrelationcore.knowledge.yaml:concept+documentwithmentions/derived_from
Enable:
export MEMG_ENABLE_YAML_SCHEMA=true
export MEMG_YAML_SCHEMA=$(pwd)/integration/config/core.minimal.yaml
Embedding Configuration
MEMG Core uses FastEmbed for 100% offline, local embeddings. By default, it uses the highly efficient Snowflake Arctic model:
# Optional: Configure a different FastEmbed model
export EMBEDDER_MODEL="Snowflake/snowflake-arctic-embed-xs" # Default
# Other options: intfloat/e5-small, BAAI/bge-small-en-v1.5, etc.
Evaluation
Use the built-in scripts to generate a synthetic dataset that covers all entity and memory types, and then run repeatable evaluations each iteration.
1) Generate dataset
python scripts/generate_synthetic_dataset.py \
--output ./data/memg_synth.jsonl \
--num 200 \
--user eval_user
This creates JSONL rows containing a memory plus associated entities and relationships, exercising:
- All
EntityTypevalues (TECHNOLOGY, DATABASE, COMPONENT, ERROR, SOLUTION, FILE_TYPE, etc.) - Multiple
MemoryTypes: document, note, conversation, task - Basic
MENTIONSrelationships
2) Offline validation (no external services)
Validates schema and database compatibility quickly without embeddings or storage.
python scripts/evaluate_memg.py --data ./data/memg_synth.jsonl --mode offline
Output summary includes rows, counts, and error/warning totals to track across iterations.
3) Live processing (embeddings + storage)
No API keys needed! Just ensure storage paths are set.
python scripts/evaluate_memg.py --data ./data/memg_synth.jsonl --mode live
Tip: Commit the dataset and compare results over time in CI to catch regressions.
Configuration
Configure via .env file (copy from env.example):
# Core settings
MEMORY_SYSTEM_MCP_PORT=8787
MEMG_TEMPLATE=software_development
# Embeddings (optional)
EMBEDDER_MODEL=Snowflake/snowflake-arctic-embed-xs
# Storage
BASE_MEMORY_PATH=$HOME/.local/share/memory_system
QDRANT_COLLECTION=memories
EMBEDDING_DIMENSION_LEN=384
Requirements
- Python 3.11+
- No API keys required!
Links
License
MIT License - see LICENSE file for details.
Project details
Release history Release notifications | RSS feed
Download files
Download the file for your platform. If you're not sure which to choose, learn more about installing packages.
Source Distribution
Built Distribution
Filter files by name, interpreter, ABI, and platform.
If you're not sure about the file name format, learn more about wheel file names.
Copy a direct link to the current filters
File details
Details for the file memg_core-0.3.7.dev1.tar.gz.
File metadata
- Download URL: memg_core-0.3.7.dev1.tar.gz
- Upload date:
- Size: 85.6 kB
- Tags: Source
- Uploaded using Trusted Publishing? Yes
- Uploaded via: twine/6.1.0 CPython/3.12.9
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
111674335724bc71518c2337a612f0b3ebc94cd47e7c72290123462ff071a8b0
|
|
| MD5 |
ad128a46f5e9e87af194ae82305e11a2
|
|
| BLAKE2b-256 |
02b708d9dba223a4b0c937f8f3d72242c0f6e5991f50d9484c2142a0f14219c2
|
Provenance
The following attestation bundles were made for memg_core-0.3.7.dev1.tar.gz:
Publisher:
workflow.yml on genovo-ai/memg-core
-
Statement:
-
Statement type:
https://in-toto.io/Statement/v1 -
Predicate type:
https://docs.pypi.org/attestations/publish/v1 -
Subject name:
memg_core-0.3.7.dev1.tar.gz -
Subject digest:
111674335724bc71518c2337a612f0b3ebc94cd47e7c72290123462ff071a8b0 - Sigstore transparency entry: 393502069
- Sigstore integration time:
-
Permalink:
genovo-ai/memg-core@3c9c3aa6124dbf7e1c2e4afdc5586480a1b96389 -
Branch / Tag:
refs/heads/main - Owner: https://github.com/genovo-ai
-
Access:
public
-
Token Issuer:
https://token.actions.githubusercontent.com -
Runner Environment:
github-hosted -
Publication workflow:
workflow.yml@3c9c3aa6124dbf7e1c2e4afdc5586480a1b96389 -
Trigger Event:
push
-
Statement type:
File details
Details for the file memg_core-0.3.7.dev1-py3-none-any.whl.
File metadata
- Download URL: memg_core-0.3.7.dev1-py3-none-any.whl
- Upload date:
- Size: 31.1 kB
- Tags: Python 3
- Uploaded using Trusted Publishing? Yes
- Uploaded via: twine/6.1.0 CPython/3.12.9
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
06dfc1232275725f468892141f8bad1184bb7a519b4776b0cda581e8bb6561f7
|
|
| MD5 |
a4f19bdc89a38cb852e86657c2b724f0
|
|
| BLAKE2b-256 |
796322c143be87d9a5edbef91ab24f4dc18d32e27566e9e5531d37c48b75d947
|
Provenance
The following attestation bundles were made for memg_core-0.3.7.dev1-py3-none-any.whl:
Publisher:
workflow.yml on genovo-ai/memg-core
-
Statement:
-
Statement type:
https://in-toto.io/Statement/v1 -
Predicate type:
https://docs.pypi.org/attestations/publish/v1 -
Subject name:
memg_core-0.3.7.dev1-py3-none-any.whl -
Subject digest:
06dfc1232275725f468892141f8bad1184bb7a519b4776b0cda581e8bb6561f7 - Sigstore transparency entry: 393502072
- Sigstore integration time:
-
Permalink:
genovo-ai/memg-core@3c9c3aa6124dbf7e1c2e4afdc5586480a1b96389 -
Branch / Tag:
refs/heads/main - Owner: https://github.com/genovo-ai
-
Access:
public
-
Token Issuer:
https://token.actions.githubusercontent.com -
Runner Environment:
github-hosted -
Publication workflow:
workflow.yml@3c9c3aa6124dbf7e1c2e4afdc5586480a1b96389 -
Trigger Event:
push
-
Statement type: