Skip to main content

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
  • AI Integration: Automated entity extraction with Google Gemini
  • 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
cp env.example .env
# Edit .env and set your GOOGLE_API_KEY

# 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 (for examples/tests)
cp env.example .env
# Edit .env and set your GOOGLE_API_KEY

# Use the core library in your app; the MCP server is provided via Docker image
# 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 memory_system import MemorySystem

# Initialize system
memory = MemorySystem()

# Add memories
memory.add_note("Python is great for AI development", user_id="user1")

# Search memories
results = memory.search("AI development", user_id="user1")

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 EntityType values (TECHNOLOGY, DATABASE, COMPONENT, ERROR, SOLUTION, FILE_TYPE, etc.)
  • Multiple MemoryTypes: document, note, conversation, task
  • Basic MENTIONS relationships

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)

Requires environment configured (e.g., GOOGLE_API_KEY) and storage reachable. It runs the Unified pipeline and validates the resulting memories.

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):

# Required
GOOGLE_API_KEY=your_google_api_key_here

# Core settings
GEMINI_MODEL=gemini-2.0-flash
MEMORY_SYSTEM_MCP_PORT=8787
MEMG_TEMPLATE=software_development

# Storage
BASE_MEMORY_PATH=$HOME/.local/share/memory_system
QDRANT_COLLECTION=memories
EMBEDDING_DIMENSION_LEN=768

Requirements

  • Python 3.11+
  • Google API key for Gemini

Links

License

MIT License - see LICENSE file for details.

Project details


Download files

Download the file for your platform. If you're not sure which to choose, learn more about installing packages.

Source Distribution

memg_core-0.1.dev68.tar.gz (92.2 kB view details)

Uploaded Source

Built Distribution

If you're not sure about the file name format, learn more about wheel file names.

memg_core-0.1.dev68-py3-none-any.whl (35.4 kB view details)

Uploaded Python 3

File details

Details for the file memg_core-0.1.dev68.tar.gz.

File metadata

  • Download URL: memg_core-0.1.dev68.tar.gz
  • Upload date:
  • Size: 92.2 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? Yes
  • Uploaded via: twine/6.1.0 CPython/3.12.9

File hashes

Hashes for memg_core-0.1.dev68.tar.gz
Algorithm Hash digest
SHA256 44adb4721bcccf9e0e34721ebb62957e7ec27266dcd46ce573836acd4aeaa9a2
MD5 f80adc2d5072ab6cabe4ca2fc2e3350d
BLAKE2b-256 abec21ecb626f1af6f0769d7f483e4ccac27e9bb152cc1781f0f33a82e96d399

See more details on using hashes here.

Provenance

The following attestation bundles were made for memg_core-0.1.dev68.tar.gz:

Publisher: workflow.yml on genovo-ai/memg-core

Attestations: Values shown here reflect the state when the release was signed and may no longer be current.

File details

Details for the file memg_core-0.1.dev68-py3-none-any.whl.

File metadata

  • Download URL: memg_core-0.1.dev68-py3-none-any.whl
  • Upload date:
  • Size: 35.4 kB
  • Tags: Python 3
  • Uploaded using Trusted Publishing? Yes
  • Uploaded via: twine/6.1.0 CPython/3.12.9

File hashes

Hashes for memg_core-0.1.dev68-py3-none-any.whl
Algorithm Hash digest
SHA256 414e368f88e56163a5890d2210ff6d7d0130d1969d24c39b01a69438f311bd66
MD5 f1066ae46b47a90820bf193070e48875
BLAKE2b-256 b1287644e420d22f2d02bf1e8e31dcd751d2fdadca627942ddbcbe2f907ae938

See more details on using hashes here.

Provenance

The following attestation bundles were made for memg_core-0.1.dev68-py3-none-any.whl:

Publisher: workflow.yml on genovo-ai/memg-core

Attestations: Values shown here reflect the state when the release was signed and may no longer be current.

Supported by

AWS Cloud computing and Security Sponsor Datadog Monitoring Depot Continuous Integration Fastly CDN Google Download Analytics Pingdom Monitoring Sentry Error logging StatusPage Status page