Metadata-Version: 2.4
Name: memg
Version: 0.5.1
Summary: True memory for AI - lightweight, generalist, AI-made, AI-focused
Author-email: MEMG Team <team@genovo.ai>
License: MIT
Project-URL: Homepage, https://github.com/yasinsalimibeni/memg
Project-URL: Repository, https://github.com/yasinsalimibeni/memg.git
Project-URL: Issues, https://github.com/yasinsalimibeni/memg/issues
Project-URL: Documentation, https://github.com/yasinsalimibeni/memg#readme
Keywords: ai,memory,agents,search,memg,artificial-intelligence,knowledge-management,semantic-search
Classifier: Development Status :: 4 - Beta
Classifier: Intended Audience :: Developers
Classifier: Intended Audience :: Science/Research
Classifier: License :: OSI Approved :: MIT License
Classifier: Operating System :: OS Independent
Classifier: Programming Language :: Python :: 3
Classifier: Programming Language :: Python :: 3.11
Classifier: Programming Language :: Python :: 3.12
Classifier: Programming Language :: Python :: 3.13
Classifier: Topic :: Scientific/Engineering :: Artificial Intelligence
Classifier: Topic :: Software Development :: Libraries :: Python Modules
Classifier: Topic :: Database :: Database Engines/Servers
Classifier: Typing :: Typed
Requires-Python: >=3.11
Description-Content-Type: text/markdown
License-File: LICENSE
Requires-Dist: memg-core>=0.5.1
Requires-Dist: google-genai==1.30.0
Requires-Dist: python-dotenv>=1.1.0
Requires-Dist: pydantic>=2.11.0
Requires-Dist: pandas>=2.3.1
Requires-Dist: tabulate>=0.9.0
Provides-Extra: dev
Requires-Dist: pytest>=8.4.1; extra == "dev"
Requires-Dist: pytest-cov>=6.2.1; extra == "dev"
Requires-Dist: pytest-asyncio>=0.23.8; extra == "dev"
Requires-Dist: psutil>=5.9.8; extra == "dev"
Requires-Dist: ruff>=0.12.0; extra == "dev"
Requires-Dist: mypy>=1.17.0; extra == "dev"
Requires-Dist: bandit[toml]>=1.8.0; extra == "dev"
Requires-Dist: pre-commit>=4.0.0; extra == "dev"
Provides-Extra: mcp
Requires-Dist: fastmcp>=2.10.6; extra == "mcp"
Provides-Extra: all
Requires-Dist: memg[dev,mcp]; extra == "all"
Dynamic: license-file

# 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](https://pypi.org/project/memg-core/) foundation, MEMG adds sophisticated AI-powered features for enhanced search, intelligent processing, and seamless integration.

## 🚀 Quick Start

```bash
pip install memg
```

```python
import memg

# Initialize with AI-enhanced features
memory = memg.Memory()

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

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

# Access AI utilities
ai = memg.GenAI()
analysis = ai.analyze_text("Complex user requirements document...")
```

## ✨ 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

```python
import memg

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

# 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")
```

### AI-Enhanced Processing

```python
from memg import GenAI

ai = GenAI()

# Analyze content with AI
analysis = ai.analyze_text("""
Long document about software architecture patterns...
""")

# Smart categorization and insights
insights = ai.extract_insights(analysis)
```

### MCP Server Integration

```bash
# 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

```bash
# 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:

```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
memg.create_memory_from_yaml("config/my_config.yaml")
```

### Memory Server

For persistent memory with web access:

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

# Or use the convenience script
./build_and_run.sh
```

## 🔧 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**: 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](LICENSE) file for details.

## 🌟 Related Projects

- **[memg-core](https://pypi.org/project/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* 🧠✨
