# 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](https://pypi.org/project/memg-core/) foundation, MEMG adds enhanced APIs, integration tools, and seamless development experience for structured memory operations.
## 🚀 Quick Start
```bash
pip install memg
```
```python
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-core
- **`memg.search`**: Search orchestration and utilities
- **`memg.api`**: High-level API interfaces
- **`memg.utils`**: Utilities and schema management
## 🎮 Usage Examples
### Basic Memory Operations
```python
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
```python
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
```python
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
```bash
# 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:
```yaml
# config/my_config.yaml
entities:
task:
required: [statement]
optional: [assignee, priority, status, due_date]
note:
required: [statement, details]
optional: [project, tags]
```
```python
import memg
# Initialize with custom configuration
memory = memg.create_memory_from_yaml("config/my_config.yaml")
```
### Memory Server
For development and testing:
```bash
# Install in development mode
pip install -e ".[dev]"
# Run tests to verify installation
python -m pytest tests/
```
## 🔧 Development
### Quality Tools
```bash
# 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
```bash
# 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**: 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](LICENSE) file for details.
## 🌟 Related Projects
- **[memg-core](https://pypi.org/project/memg-core/)**: Foundation memory management system
---
**Built with ❤️ by the MEMG Team**
*True memory for AI - making intelligent agents truly intelligent* 🧠✨
Raw data
{
"_id": null,
"home_page": null,
"name": "memg",
"maintainer": null,
"docs_url": null,
"requires_python": ">=3.11",
"maintainer_email": null,
"keywords": "ai, memory, agents, search, memg, artificial-intelligence, knowledge-management, semantic-search",
"author": null,
"author_email": "GenovoAI Team <info@genovoai.com>",
"download_url": "https://files.pythonhosted.org/packages/17/a6/f7cfa9e397c2099bc8895f0ddac351c64c5bf065d30ec522726a86f21f11/memg-0.5.6.tar.gz",
"platform": null,
"description": "# MEMG \ud83e\udde0\u26a1\n\n**True memory for AI - lightweight, generalist, AI-made, AI-focused**\n\nMEMG is a lightweight memory management system that provides persistent memory capabilities for AI agents and applications. Built on top of the robust [memg-core](https://pypi.org/project/memg-core/) foundation, MEMG adds enhanced APIs, integration tools, and seamless development experience for structured memory operations.\n\n## \ud83d\ude80 Quick Start\n\n```bash\npip install memg\n```\n\n```python\nimport memg\n\n# Add memories with structured data\nmemory = memg.add_memory(\"task\", {\n \"statement\": \"Implement user authentication system\",\n \"details\": \"Need to add JWT-based auth with role management\",\n \"priority\": \"high\"\n}, user_id=\"your_user_id\")\n\n# Search memories with keywords\nresults = memg.search(\"authentication\", user_id=\"your_user_id\")\n\n# Create memory configuration from YAML\nmemory_config = memg.create_memory_from_yaml(\"config/my_config.yaml\")\n```\n\n## \u2728 Key Features\n\n### \ud83c\udfaf **Structured Memory Management**\n- **Vector Search**: Semantic search capabilities with relevance scoring\n- **Graph Storage**: Efficient relationship tracking between memories\n- **Schema Validation**: YAML-based memory schemas with type safety\n\n### \ud83c\udfd7\ufe0f **Built on Solid Foundation**\n- **memg-core Integration**: Leverages battle-tested core memory management\n- **Production Ready**: Comprehensive testing, quality tools, and CI/CD\n- **Modern Architecture**: Clean separation between core storage and enhanced features\n\n### \ud83d\udd0c **Flexible Integration**\n- **Python SDK**: Clean Python API built on memg-core\n- **YAML Configuration**: Flexible schema definition and management\n- **Cross-platform**: Works on all major operating systems\n\n### \ud83d\udee0\ufe0f **Developer Experience**\n- **Rich Configuration**: YAML-based schemas and flexible setup\n- **Comprehensive Testing**: Unit and integration test suites\n- **Quality Tools**: Ruff, MyPy, Bandit for code quality\n- **Type Safety**: Full type hints and runtime validation\n\n## \ud83d\udce6 Architecture\n\n```\nMEMG Ecosystem\n\u251c\u2500\u2500 memg-core (PyPI) # Foundation: storage, search, schemas\n\u2514\u2500\u2500 MEMG (this package) # Enhanced APIs and utilities\n```\n\n### **Core Components**\n\n- **`memg.core`**: Integration layer with memg-core\n- **`memg.search`**: Search orchestration and utilities\n- **`memg.api`**: High-level API interfaces\n- **`memg.utils`**: Utilities and schema management\n\n## \ud83c\udfae Usage Examples\n\n### Basic Memory Operations\n\n```python\nimport memg\n\n# Create and store memories\nmemory = memg.add_memory(\"note\", {\n \"statement\": \"API design patterns research\",\n \"details\": \"Investigated REST vs GraphQL for user management API\",\n \"project\": \"web-app\"\n}, user_id=\"your_user_id\")\n\n# Search memories by keyword\nresults = memg.search(\"API design\", user_id=\"your_user_id\")\n\n# Delete memories when no longer needed\nmemg.delete_memory(memory.memory_id, user_id=\"your_user_id\")\n```\n\n### Configuration and Schema Management\n\n```python\nimport memg\n\n# Get current memory configuration\nconfig = memg.get_config()\n\n# Load configuration from YAML file\nmemory_system = memg.create_memory_from_yaml(\"config/custom_schema.yaml\")\n\n# Work with memory objects\nfor result in memg.search(\"project tasks\", user_id=\"your_user_id\"):\n print(f\"Memory: {result.payload['statement']}\")\n print(f\"Score: {result.score}\")\n```\n\n### Working with Search Results\n\n```python\nimport memg\n\n# Search returns structured results\nresults = memg.search(\"authentication tasks\", user_id=\"your_user_id\")\n\nfor result in results:\n print(f\"Type: {result.memory_type}\")\n print(f\"Content: {result.payload['statement']}\")\n print(f\"Relevance Score: {result.score}\")\n print(f\"Memory ID: {result.memory_id}\")\n```\n\n## \ud83c\udfc1 Getting Started\n\n### Installation\n\n```bash\n# Install MEMG\npip install memg\n\n# For development setup\ngit clone https://github.com/genovo-ai/memg.git\ncd memg\npip install -e \".[dev]\"\n```\n\n### Configuration\n\nCreate a memory configuration:\n\n```yaml\n# config/my_config.yaml\nentities:\n task:\n required: [statement]\n optional: [assignee, priority, status, due_date]\n note:\n required: [statement, details]\n optional: [project, tags]\n```\n\n```python\nimport memg\n\n# Initialize with custom configuration\nmemory = memg.create_memory_from_yaml(\"config/my_config.yaml\")\n```\n\n### Memory Server\n\nFor development and testing:\n\n```bash\n# Install in development mode\npip install -e \".[dev]\"\n\n# Run tests to verify installation\npython -m pytest tests/\n```\n\n## \ud83d\udd27 Development\n\n### Quality Tools\n\n```bash\n# Run all quality checks\nmake quality-check\n\n# Individual tools\nmake lint # Ruff linting\nmake typecheck # MyPy type checking\nmake security # Bandit security scan\nmake test # Full test suite\n```\n\n### Testing\n\n```bash\n# Run tests\nmake test-all\n\n# Fast tests only\nmake test-fast\n\n# Integration tests\nmake test-integration\n\n# Coverage report\nmake test-coverage\n```\n\n## \ud83e\udd1d Contributing\n\nWe welcome contributions! Please see our development workflow:\n\n1. **Fork & Clone**: Fork the repository and clone locally\n2. **Setup**: `pip install -e \".[dev]\"` for development dependencies\n3. **Quality**: Run `make quality-check` before committing\n4. **Test**: Ensure `make test-all` passes\n5. **PR**: Submit a pull request with clear description\n\n### Development Standards\n\n- **Code Quality**: Ruff formatting and linting\n- **Type Safety**: MyPy type checking required\n- **Security**: Bandit security scanning\n- **Testing**: Comprehensive test coverage\n- **Documentation**: Clear docstrings and examples\n\n## \ud83d\udcda Documentation\n\n- **API Reference**: Coming soon\n- **Architecture Guide**: See `src/memg/` for component structure\n- **Integration Guide**: Coming soon\n- **Configuration**: Explore `config/` directory for examples\n\n## \ud83d\udee1\ufe0f Security\n\n- **Bandit Scanning**: Automated security vulnerability detection\n- **Dependency Management**: Regular security updates\n- **Input Validation**: Comprehensive data validation\n- **Safe Defaults**: Secure-by-default configuration\n\n## \ud83d\udcc4 License\n\nMIT License - see [LICENSE](LICENSE) file for details.\n\n## \ud83c\udf1f Related Projects\n\n- **[memg-core](https://pypi.org/project/memg-core/)**: Foundation memory management system\n\n---\n\n**Built with \u2764\ufe0f by the MEMG Team**\n\n*True memory for AI - making intelligent agents truly intelligent* \ud83e\udde0\u2728\n",
"bugtrack_url": null,
"license": "MIT",
"summary": "True memory for AI - lightweight, generalist, AI-made, AI-focused",
"version": "0.5.6",
"project_urls": {
"Documentation": "https://github.com/genovo-ai/memg#readme",
"Homepage": "https://github.com/genovo-ai/memg",
"Issues": "https://github.com/genovo-ai/memg/issues",
"Repository": "https://github.com/genovo-ai/memg.git"
},
"split_keywords": [
"ai",
" memory",
" agents",
" search",
" memg",
" artificial-intelligence",
" knowledge-management",
" semantic-search"
],
"urls": [
{
"comment_text": null,
"digests": {
"blake2b_256": "bf00c2fc29f330de99f9b21cf720c1127e28ebbf9f4042ddec1aa1a6bbf8b1e0",
"md5": "1230caeebe53016b51dfe2ea316b36f0",
"sha256": "9bad353de07411f4b8a7315eac79a6c47648a68401219e985bd438a09ee78fe3"
},
"downloads": -1,
"filename": "memg-0.5.6-py3-none-any.whl",
"has_sig": false,
"md5_digest": "1230caeebe53016b51dfe2ea316b36f0",
"packagetype": "bdist_wheel",
"python_version": "py3",
"requires_python": ">=3.11",
"size": 13298,
"upload_time": "2025-08-17T05:46:22",
"upload_time_iso_8601": "2025-08-17T05:46:22.627957Z",
"url": "https://files.pythonhosted.org/packages/bf/00/c2fc29f330de99f9b21cf720c1127e28ebbf9f4042ddec1aa1a6bbf8b1e0/memg-0.5.6-py3-none-any.whl",
"yanked": false,
"yanked_reason": null
},
{
"comment_text": null,
"digests": {
"blake2b_256": "17a6f7cfa9e397c2099bc8895f0ddac351c64c5bf065d30ec522726a86f21f11",
"md5": "5347e66ce79b78ad13c0b9183044daf1",
"sha256": "1facd108099e0b8c3aedcd6669f82c7cb57869577ee39a363de35873d34a2db3"
},
"downloads": -1,
"filename": "memg-0.5.6.tar.gz",
"has_sig": false,
"md5_digest": "5347e66ce79b78ad13c0b9183044daf1",
"packagetype": "sdist",
"python_version": "source",
"requires_python": ">=3.11",
"size": 33298,
"upload_time": "2025-08-17T05:46:23",
"upload_time_iso_8601": "2025-08-17T05:46:23.972787Z",
"url": "https://files.pythonhosted.org/packages/17/a6/f7cfa9e397c2099bc8895f0ddac351c64c5bf065d30ec522726a86f21f11/memg-0.5.6.tar.gz",
"yanked": false,
"yanked_reason": null
}
],
"upload_time": "2025-08-17 05:46:23",
"github": true,
"gitlab": false,
"bitbucket": false,
"codeberg": false,
"github_user": "genovo-ai",
"github_project": "memg#readme",
"github_not_found": true,
"lcname": "memg"
}