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 a lightweight memory management system that provides persistent memory capabilities for AI agents and applications. Built on top of the robust memg-core foundation, MEMG adds enhanced APIs, integration tools, and seamless development experience for structured memory operations.
🚀 Quick Start
pip install memg
import memg
# Add memories with structured data
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")
# Search memories with keywords
results = memg.search("authentication", user_id="your_user_id")
# Create memory configuration from YAML
memory_config = memg.create_memory_from_yaml("config/my_config.yaml")
✨ Key Features
🎯 Structured Memory Management
- Vector Search: Semantic search capabilities with relevance scoring
- Graph Storage: Efficient relationship tracking between memories
- Schema Validation: YAML-based memory schemas with type safety
🏗️ 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 enhanced features
🔌 Flexible Integration
- Python SDK: Clean Python API built on memg-core
- YAML Configuration: Flexible schema definition and management
- Cross-platform: Works on all major operating systems
🛠️ 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) # Enhanced APIs and utilities
Core Components
memg.core
: Integration layer with memg-corememg.search
: Search orchestration and utilitiesmemg.api
: High-level API interfacesmemg.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 memories by keyword
results = memg.search("API design", user_id="your_user_id")
# Delete memories when no longer needed
memg.delete_memory(memory.memory_id, user_id="your_user_id")
Configuration and Schema Management
import memg
# Get current memory configuration
config = memg.get_config()
# Load configuration from YAML file
memory_system = memg.create_memory_from_yaml("config/custom_schema.yaml")
# Work with memory objects
for result in memg.search("project tasks", user_id="your_user_id"):
print(f"Memory: {result.payload['statement']}")
print(f"Score: {result.score}")
Working with Search Results
import memg
# Search returns structured results
results = memg.search("authentication tasks", user_id="your_user_id")
for result in results:
print(f"Type: {result.memory_type}")
print(f"Content: {result.payload['statement']}")
print(f"Relevance Score: {result.score}")
print(f"Memory ID: {result.memory_id}")
🏁 Getting Started
Installation
# Install MEMG
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 development and testing:
# Install in development mode
pip install -e ".[dev]"
# Run tests to verify installation
python -m pytest tests/
🔧 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:
- Fork & Clone: Fork the repository and clone locally
- Setup:
pip install -e ".[dev]"
for development dependencies - Quality: Run
make quality-check
before committing - Test: Ensure
make test-all
passes - 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: Coming soon
- 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
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
Built Distribution
File details
Details for the file memg-0.5.4.tar.gz
.
File metadata
- Download URL: memg-0.5.4.tar.gz
- Upload date:
- Size: 33.3 kB
- Tags: Source
- Uploaded using Trusted Publishing? Yes
- Uploaded via: twine/6.1.0 CPython/3.12.9
File hashes
Algorithm | Hash digest | |
---|---|---|
SHA256 |
1fbd4a567a53175a78df18145adca689c00b73848aeed0ddb0e9c81c58667e0a
|
|
MD5 |
ae9730e50e0c07b23819104bfcb98aa6
|
|
BLAKE2b-256 |
ffaea62c3ed9bd2ecd022c7ee2afd41b3468c402152340e3d027007a10c5e55f
|
Provenance
The following attestation bundles were made for memg-0.5.4.tar.gz
:
Publisher:
release.yml
on genovo-ai/memg
-
Statement:
-
Statement type:
https://in-toto.io/Statement/v1
-
Predicate type:
https://docs.pypi.org/attestations/publish/v1
-
Subject name:
memg-0.5.4.tar.gz
-
Subject digest:
1fbd4a567a53175a78df18145adca689c00b73848aeed0ddb0e9c81c58667e0a
- Sigstore transparency entry: 403826065
- Sigstore integration time:
-
Permalink:
genovo-ai/memg@0ceab0bd5ec97a94ef3b4087e6435d27c729c1a6
-
Branch / Tag:
refs/tags/v0.5.4
- Owner: https://github.com/genovo-ai
-
Access:
private
-
Token Issuer:
https://token.actions.githubusercontent.com
-
Runner Environment:
github-hosted
-
Publication workflow:
release.yml@0ceab0bd5ec97a94ef3b4087e6435d27c729c1a6
-
Trigger Event:
push
-
Statement type:
File details
Details for the file memg-0.5.4-py3-none-any.whl
.
File metadata
- Download URL: memg-0.5.4-py3-none-any.whl
- Upload date:
- Size: 13.3 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 |
b97138163a2ae59e523b66f3bfd0590e4d1f77efe9055f11af1774a63d1948f7
|
|
MD5 |
c0e1d4f35a330e21ce0c8a9a8c094089
|
|
BLAKE2b-256 |
a7d80b7f894538ef310a482872a5d98990fa7279851c7077a83cb55cba24f14d
|
Provenance
The following attestation bundles were made for memg-0.5.4-py3-none-any.whl
:
Publisher:
release.yml
on genovo-ai/memg
-
Statement:
-
Statement type:
https://in-toto.io/Statement/v1
-
Predicate type:
https://docs.pypi.org/attestations/publish/v1
-
Subject name:
memg-0.5.4-py3-none-any.whl
-
Subject digest:
b97138163a2ae59e523b66f3bfd0590e4d1f77efe9055f11af1774a63d1948f7
- Sigstore transparency entry: 403826092
- Sigstore integration time:
-
Permalink:
genovo-ai/memg@0ceab0bd5ec97a94ef3b4087e6435d27c729c1a6
-
Branch / Tag:
refs/tags/v0.5.4
- Owner: https://github.com/genovo-ai
-
Access:
private
-
Token Issuer:
https://token.actions.githubusercontent.com
-
Runner Environment:
github-hosted
-
Publication workflow:
release.yml@0ceab0bd5ec97a94ef3b4087e6435d27c729c1a6
-
Trigger Event:
push
-
Statement type: