Skip to main content

True memory for AI - lightweight, generalist, AI-made, AI-focused

Project description

MEMG 🧠⚡

True memory for AI - lightweight, generalist, AI-made, AI-focused

MEMG is an AI-enhanced memory management system that provides intelligent, persistent memory capabilities for AI agents and applications. Built on top of the robust memg-core foundation, MEMG adds sophisticated AI-powered features for enhanced search, intelligent processing, and seamless integration.

🚀 Quick Start

pip install memg
import memg

# Add memories with intelligent processing
memory = memg.add_memory("task", {
    "statement": "Implement user authentication system",
    "details": "Need to add JWT-based auth with role management",
    "priority": "high"
}, user_id="your_user_id")

# AI-enhanced search with natural language
results = memg.search_enhanced("authentication tasks with high priority", user_id="your_user_id")

# Access AI utilities for text generation
ai = memg.GenAI(system_instruction="You are a helpful assistant")
response = ai.generate_text("Analyze this user requirement: implement authentication")

✨ Key Features

🎯 AI-Enhanced Memory

  • Intelligent Search: Natural language queries with semantic understanding
  • Smart Processing: AI-powered content analysis and categorization
  • Enhanced Retrieval: Context-aware memory retrieval with relevance scoring

🏗️ Built on Solid Foundation

  • memg-core Integration: Leverages battle-tested core memory management
  • Production Ready: Comprehensive testing, quality tools, and CI/CD
  • Modern Architecture: Clean separation between core storage and AI enhancements

🔌 Flexible Integration

  • MCP Server: Memory Context Protocol server for tool integration
  • RESTful API: Standard HTTP endpoints for web applications
  • Python SDK: Rich Python API with async/sync support

🛠️ Developer Experience

  • Rich Configuration: YAML-based schemas and flexible setup
  • Comprehensive Testing: Unit and integration test suites
  • Quality Tools: Ruff, MyPy, Bandit for code quality
  • Type Safety: Full type hints and runtime validation

📦 Architecture

MEMG Ecosystem
├── memg-core (PyPI)          # Foundation: storage, search, schemas
├── MEMG (this package)       # AI enhancements, processing, utilities
└── integrations/             # MCP server, APIs, external tools

Core Components

  • memg.core: Integration layer with memg-core
  • memg.ai: AI-powered processing and analysis
  • memg.search: Enhanced search orchestration
  • memg.api: High-level API interfaces
  • memg.utils: Utilities and schema management

🎮 Usage Examples

Basic Memory Operations

import memg

# Create and store memories
memory = memg.add_memory("note", {
    "statement": "API design patterns research",
    "details": "Investigated REST vs GraphQL for user management API",
    "project": "web-app"
}, user_id="your_user_id")

# Search with natural language
results = memg.search("API design research for web applications")

# Enhanced AI-powered search
ai_results = memg.search_enhanced("show me notes about web development", user_id="your_user_id")

AI-Enhanced Processing

from memg import GenAI

# Initialize with system instruction
ai = GenAI(system_instruction="You are a software architecture expert")

# Generate structured JSON responses
schema = {
    "type": "object",
    "properties": {
        "summary": {"type": "string"},
        "key_patterns": {"type": "array", "items": {"type": "string"}},
        "recommendations": {"type": "array", "items": {"type": "string"}}
    },
    "required": ["summary", "key_patterns", "recommendations"]
}

analysis = ai.generate_json(
    "Analyze this document about software architecture patterns...",
    schema
)

# Generate free-text responses
insights = ai.generate_text("Provide insights on these architecture patterns")

MCP Server Integration

# Run the MCP server for tool integration
cd integrations/mcp/
./build_and_run.sh

# Server runs on localhost:8787 with full MEMG capabilities
curl http://localhost:8787/health

🏁 Getting Started

Installation

# Install MEMG with AI features
pip install memg

# For development setup
git clone https://github.com/genovo-ai/memg.git
cd memg
pip install -e ".[dev]"

Configuration

Create a memory configuration:

# config/my_config.yaml
entities:
  task:
    required: [statement]
    optional: [assignee, priority, status, due_date]
  note:
    required: [statement, details]
    optional: [project, tags]
import memg

# Initialize with custom configuration
memory = memg.create_memory_from_yaml("config/my_config.yaml")

Memory Server

For persistent memory with web access:

# Start the MCP server
cd integrations/mcp/
docker-compose up -d

# Or use the convenience script
./build_and_run.sh

🔧 Development

Quality Tools

# Run all quality checks
make quality-check

# Individual tools
make lint          # Ruff linting
make typecheck     # MyPy type checking
make security      # Bandit security scan
make test          # Full test suite

Testing

# Run tests
make test-all

# Fast tests only
make test-fast

# Integration tests
make test-integration

# Coverage report
make test-coverage

🤝 Contributing

We welcome contributions! Please see our development workflow:

  1. Fork & Clone: Fork the repository and clone locally
  2. Setup: pip install -e ".[dev]" for development dependencies
  3. Quality: Run make quality-check before committing
  4. Test: Ensure make test-all passes
  5. PR: Submit a pull request with clear description

Development Standards

  • Code Quality: Ruff formatting and linting
  • Type Safety: MyPy type checking required
  • Security: Bandit security scanning
  • Testing: Comprehensive test coverage
  • Documentation: Clear docstrings and examples

📚 Documentation

  • API Reference: Coming soon
  • Architecture Guide: See src/memg/ for component structure
  • Integration Guide: Check integrations/mcp/README.md
  • Configuration: Explore config/ directory for examples

🛡️ Security

  • Bandit Scanning: Automated security vulnerability detection
  • Dependency Management: Regular security updates
  • Input Validation: Comprehensive data validation
  • Safe Defaults: Secure-by-default configuration

📄 License

MIT License - see LICENSE file for details.

🌟 Related Projects

  • memg-core: Foundation memory management system
  • MCP Tools: Memory Context Protocol integrations

Built with ❤️ by the MEMG Team

True memory for AI - making intelligent agents truly intelligent 🧠✨

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-0.5.3.tar.gz (50.0 kB view details)

Uploaded Source

Built Distribution

memg-0.5.3-py3-none-any.whl (13.7 kB view details)

Uploaded Python 3

File details

Details for the file memg-0.5.3.tar.gz.

File metadata

  • Download URL: memg-0.5.3.tar.gz
  • Upload date:
  • Size: 50.0 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? Yes
  • Uploaded via: twine/6.1.0 CPython/3.12.9

File hashes

Hashes for memg-0.5.3.tar.gz
Algorithm Hash digest
SHA256 1a73542044f2982efa805da3afb45736f8af5113e058a94e637cdc96baf0a59e
MD5 2bf97cb3e9f2fb4a9741fa187b639b02
BLAKE2b-256 2e2d39b1e91e0f9cf7459413b84ccedf70fa64082aadebf96091c0983916e15d

See more details on using hashes here.

Provenance

The following attestation bundles were made for memg-0.5.3.tar.gz:

Publisher: release.yml on genovo-ai/memg

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-0.5.3-py3-none-any.whl.

File metadata

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

File hashes

Hashes for memg-0.5.3-py3-none-any.whl
Algorithm Hash digest
SHA256 357b89c8a7f6665a8f93ccefc87a35ce814ba026c27806ad74bc43acf0b37bc3
MD5 bbf257aa7106ab56e62a22b711e56993
BLAKE2b-256 1a26300d30135ef0dabb13494885d5f2b8a142952b8f55f64c7fb7f0e12979c2

See more details on using hashes here.

Provenance

The following attestation bundles were made for memg-0.5.3-py3-none-any.whl:

Publisher: release.yml on genovo-ai/memg

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 Fastly CDN Google Download Analytics Pingdom Monitoring Sentry Error logging StatusPage Status page