mem-llm 1.1.0__tar.gz → 1.2.0__tar.gz
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Potentially problematic release.
This version of mem-llm might be problematic. Click here for more details.
- {mem_llm-1.1.0 → mem_llm-1.2.0}/CHANGELOG.md +49 -0
- {mem_llm-1.1.0/mem_llm.egg-info → mem_llm-1.2.0}/PKG-INFO +82 -109
- {mem_llm-1.1.0 → mem_llm-1.2.0}/README.md +62 -107
- {mem_llm-1.1.0 → mem_llm-1.2.0}/mem_llm/__init__.py +16 -2
- {mem_llm-1.1.0 → mem_llm-1.2.0}/mem_llm/config_manager.py +1 -1
- mem_llm-1.2.0/mem_llm/conversation_summarizer.py +372 -0
- mem_llm-1.2.0/mem_llm/data_export_import.py +640 -0
- {mem_llm-1.1.0 → mem_llm-1.2.0}/mem_llm/mem_agent.py +31 -6
- {mem_llm-1.1.0 → mem_llm-1.2.0}/mem_llm/memory_db.py +7 -1
- {mem_llm-1.1.0 → mem_llm-1.2.0}/mem_llm/thread_safe_db.py +7 -1
- {mem_llm-1.1.0 → mem_llm-1.2.0/mem_llm.egg-info}/PKG-INFO +82 -109
- {mem_llm-1.1.0 → mem_llm-1.2.0}/mem_llm.egg-info/SOURCES.txt +4 -0
- mem_llm-1.2.0/mem_llm.egg-info/requires.txt +39 -0
- {mem_llm-1.1.0 → mem_llm-1.2.0}/pyproject.toml +24 -2
- {mem_llm-1.1.0 → mem_llm-1.2.0}/requirements-optional.txt +3 -2
- mem_llm-1.2.0/tests/test_conversation_summarizer.py +347 -0
- mem_llm-1.2.0/tests/test_data_export_import.py +405 -0
- mem_llm-1.1.0/mem_llm.egg-info/requires.txt +0 -17
- {mem_llm-1.1.0 → mem_llm-1.2.0}/MANIFEST.in +0 -0
- {mem_llm-1.1.0 → mem_llm-1.2.0}/mem_llm/cli.py +0 -0
- {mem_llm-1.1.0 → mem_llm-1.2.0}/mem_llm/config.yaml.example +0 -0
- {mem_llm-1.1.0 → mem_llm-1.2.0}/mem_llm/config_from_docs.py +0 -0
- {mem_llm-1.1.0 → mem_llm-1.2.0}/mem_llm/dynamic_prompt.py +0 -0
- {mem_llm-1.1.0 → mem_llm-1.2.0}/mem_llm/knowledge_loader.py +0 -0
- {mem_llm-1.1.0 → mem_llm-1.2.0}/mem_llm/llm_client.py +0 -0
- {mem_llm-1.1.0 → mem_llm-1.2.0}/mem_llm/logger.py +0 -0
- {mem_llm-1.1.0 → mem_llm-1.2.0}/mem_llm/memory_manager.py +0 -0
- {mem_llm-1.1.0 → mem_llm-1.2.0}/mem_llm/memory_tools.py +0 -0
- {mem_llm-1.1.0 → mem_llm-1.2.0}/mem_llm/prompt_security.py +0 -0
- {mem_llm-1.1.0 → mem_llm-1.2.0}/mem_llm/retry_handler.py +0 -0
- {mem_llm-1.1.0 → mem_llm-1.2.0}/mem_llm.egg-info/dependency_links.txt +0 -0
- {mem_llm-1.1.0 → mem_llm-1.2.0}/mem_llm.egg-info/entry_points.txt +0 -0
- {mem_llm-1.1.0 → mem_llm-1.2.0}/mem_llm.egg-info/top_level.txt +0 -0
- {mem_llm-1.1.0 → mem_llm-1.2.0}/requirements-dev.txt +0 -0
- {mem_llm-1.1.0 → mem_llm-1.2.0}/requirements.txt +0 -0
- {mem_llm-1.1.0 → mem_llm-1.2.0}/setup.cfg +0 -0
- {mem_llm-1.1.0 → mem_llm-1.2.0}/tests/test_advanced_coverage.py +0 -0
- {mem_llm-1.1.0 → mem_llm-1.2.0}/tests/test_backward_compatibility.py +0 -0
- {mem_llm-1.1.0 → mem_llm-1.2.0}/tests/test_improvements.py +0 -0
- {mem_llm-1.1.0 → mem_llm-1.2.0}/tests/test_integration.py +0 -0
- {mem_llm-1.1.0 → mem_llm-1.2.0}/tests/test_llm_client.py +0 -0
- {mem_llm-1.1.0 → mem_llm-1.2.0}/tests/test_mem_agent.py +0 -0
- {mem_llm-1.1.0 → mem_llm-1.2.0}/tests/test_memory_manager.py +0 -0
- {mem_llm-1.1.0 → mem_llm-1.2.0}/tests/test_memory_tools.py +0 -0
- {mem_llm-1.1.0 → mem_llm-1.2.0}/tests/test_qwen3_model.py +0 -0
|
@@ -5,6 +5,55 @@ All notable changes to this project will be documented in this file.
|
|
|
5
5
|
The format is based on [Keep a Changelog](https://keepachangelog.com/en/1.0.0/),
|
|
6
6
|
and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0.html).
|
|
7
7
|
|
|
8
|
+
## [1.2.0] - 2025-10-21
|
|
9
|
+
|
|
10
|
+
### Added
|
|
11
|
+
|
|
12
|
+
- 📊 **Conversation Summarization**: Automatic conversation history compression
|
|
13
|
+
- `ConversationSummarizer`: Generates concise summaries from conversation histories
|
|
14
|
+
- `AutoSummarizer`: Threshold-based automatic summary updates
|
|
15
|
+
- Token compression: ~40-60% reduction in context size
|
|
16
|
+
- Key facts extraction: Automatic user profile insights
|
|
17
|
+
- Configurable thresholds and conversation limits
|
|
18
|
+
|
|
19
|
+
- 📤 **Data Export/Import System**: Multi-format and multi-database support
|
|
20
|
+
- `DataExporter`: Export conversations to JSON, CSV, SQLite, PostgreSQL, MongoDB
|
|
21
|
+
- `DataImporter`: Import from JSON, CSV, SQLite, PostgreSQL, MongoDB
|
|
22
|
+
- Auto-create databases: PostgreSQL and MongoDB databases created automatically if missing
|
|
23
|
+
- Enterprise-ready: Support for analytics (PostgreSQL) and real-time dashboards (MongoDB)
|
|
24
|
+
- Optional dependencies: `pip install mem-llm[postgresql]`, `pip install mem-llm[mongodb]`, `pip install mem-llm[databases]`
|
|
25
|
+
|
|
26
|
+
- 🗄️ **In-Memory Database Support**: Temporary database operations
|
|
27
|
+
- `db_path=":memory:"` parameter for MemAgent
|
|
28
|
+
- No file creation: Perfect for testing and temporary workflows
|
|
29
|
+
- Full SQL functionality without persistent storage
|
|
30
|
+
|
|
31
|
+
### Changed
|
|
32
|
+
|
|
33
|
+
- 🔇 **Reduced Logging Verbosity**: Cleaner console output
|
|
34
|
+
- Default log level changed from INFO to WARNING
|
|
35
|
+
- Less noise in production environments
|
|
36
|
+
- Users can still enable detailed logs via config
|
|
37
|
+
- Examples suppress logs for cleaner demonstrations
|
|
38
|
+
|
|
39
|
+
- 📦 **Enhanced Package Structure**: Better optional dependencies
|
|
40
|
+
- `pip install mem-llm[postgresql]` - PostgreSQL support only
|
|
41
|
+
- `pip install mem-llm[mongodb]` - MongoDB support only
|
|
42
|
+
- `pip install mem-llm[databases]` - Both PostgreSQL and MongoDB
|
|
43
|
+
- `pip install mem-llm[all]` - Everything included
|
|
44
|
+
|
|
45
|
+
### Fixed
|
|
46
|
+
|
|
47
|
+
- 🗄️ **Database Path Handling**: SQLite files now organized in memories/ folder
|
|
48
|
+
- All SQLite files (.db, .db-shm, .db-wal) now in memories/ directory
|
|
49
|
+
- Cleaner workspace: No database files cluttering project root
|
|
50
|
+
- Automatic directory creation: memories/ folder created if missing
|
|
51
|
+
|
|
52
|
+
- 🔧 **MemAgent db_path Parameter**: Added missing parameter
|
|
53
|
+
- New `db_path` parameter in MemAgent.__init__()
|
|
54
|
+
- Enables custom database locations and in-memory databases
|
|
55
|
+
- Better control over database file placement
|
|
56
|
+
|
|
8
57
|
## [1.1.0] - 2025-10-21
|
|
9
58
|
|
|
10
59
|
### Added
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
Metadata-Version: 2.2
|
|
2
2
|
Name: mem-llm
|
|
3
|
-
Version: 1.
|
|
4
|
-
Summary: Memory-enabled AI assistant with local LLM support - Now with
|
|
3
|
+
Version: 1.2.0
|
|
4
|
+
Summary: Memory-enabled AI assistant with local LLM support - Now with data import/export and multi-database support
|
|
5
5
|
Author-email: "C. Emre Karataş" <karatasqemre@gmail.com>
|
|
6
6
|
License: MIT
|
|
7
7
|
Project-URL: Homepage, https://github.com/emredeveloper/Mem-LLM
|
|
@@ -33,6 +33,24 @@ Requires-Dist: flask-cors>=4.0.0; extra == "web"
|
|
|
33
33
|
Provides-Extra: api
|
|
34
34
|
Requires-Dist: fastapi>=0.104.0; extra == "api"
|
|
35
35
|
Requires-Dist: uvicorn>=0.24.0; extra == "api"
|
|
36
|
+
Provides-Extra: postgresql
|
|
37
|
+
Requires-Dist: psycopg2-binary>=2.9.9; extra == "postgresql"
|
|
38
|
+
Provides-Extra: mongodb
|
|
39
|
+
Requires-Dist: pymongo>=4.6.0; extra == "mongodb"
|
|
40
|
+
Provides-Extra: databases
|
|
41
|
+
Requires-Dist: psycopg2-binary>=2.9.9; extra == "databases"
|
|
42
|
+
Requires-Dist: pymongo>=4.6.0; extra == "databases"
|
|
43
|
+
Provides-Extra: all
|
|
44
|
+
Requires-Dist: pytest>=7.4.0; extra == "all"
|
|
45
|
+
Requires-Dist: pytest-cov>=4.1.0; extra == "all"
|
|
46
|
+
Requires-Dist: black>=23.7.0; extra == "all"
|
|
47
|
+
Requires-Dist: flake8>=6.1.0; extra == "all"
|
|
48
|
+
Requires-Dist: flask>=3.0.0; extra == "all"
|
|
49
|
+
Requires-Dist: flask-cors>=4.0.0; extra == "all"
|
|
50
|
+
Requires-Dist: fastapi>=0.104.0; extra == "all"
|
|
51
|
+
Requires-Dist: uvicorn>=0.24.0; extra == "all"
|
|
52
|
+
Requires-Dist: psycopg2-binary>=2.9.9; extra == "all"
|
|
53
|
+
Requires-Dist: pymongo>=4.6.0; extra == "all"
|
|
36
54
|
|
|
37
55
|
# 🧠 Mem-LLM
|
|
38
56
|
|
|
@@ -44,16 +62,23 @@ Requires-Dist: uvicorn>=0.24.0; extra == "api"
|
|
|
44
62
|
|
|
45
63
|
Mem-LLM is a powerful Python library that brings persistent memory capabilities to local Large Language Models. Build AI assistants that remember user interactions, manage knowledge bases, and work completely offline with Ollama.
|
|
46
64
|
|
|
47
|
-
##
|
|
65
|
+
## 🔗 Links
|
|
48
66
|
|
|
49
|
-
-
|
|
50
|
-
-
|
|
51
|
-
-
|
|
52
|
-
-
|
|
53
|
-
- 💾 **SQLite WAL Mode**: Write-Ahead Logging for better concurrency (15K+ msg/s)
|
|
54
|
-
- ✅ **100% Backward Compatible**: All v1.0.x code works without changes
|
|
67
|
+
- **PyPI**: https://pypi.org/project/mem-llm/
|
|
68
|
+
- **GitHub**: https://github.com/emredeveloper/Mem-LLM
|
|
69
|
+
- **Issues**: https://github.com/emredeveloper/Mem-LLM/issues
|
|
70
|
+
- **Documentation**: See examples/ directory
|
|
55
71
|
|
|
56
|
-
|
|
72
|
+
## 🆕 What's New in v1.2.0
|
|
73
|
+
|
|
74
|
+
- � **Conversation Summarization**: Automatic conversation compression (~40-60% token reduction)
|
|
75
|
+
- 📤 **Data Export/Import**: JSON, CSV, SQLite, PostgreSQL, MongoDB support
|
|
76
|
+
- 🗄️ **Multi-Database**: Enterprise-ready PostgreSQL & MongoDB integration
|
|
77
|
+
- �️ **In-Memory DB**: Use `:memory:` for temporary operations
|
|
78
|
+
- � **Cleaner Logs**: Default WARNING level for production-ready output
|
|
79
|
+
- � **Bug Fixes**: Database path handling, organized SQLite files
|
|
80
|
+
|
|
81
|
+
[See full changelog](CHANGELOG.md#120---2025-10-21)
|
|
57
82
|
|
|
58
83
|
## ✨ Key Features
|
|
59
84
|
|
|
@@ -70,15 +95,38 @@ Mem-LLM is a powerful Python library that brings persistent memory capabilities
|
|
|
70
95
|
- 🛡️ **Prompt Injection Protection** (v1.1.0+) - Advanced security against prompt attacks (opt-in)
|
|
71
96
|
- ⚡ **High Performance** (v1.1.0+) - Thread-safe operations, 15K+ msg/s throughput
|
|
72
97
|
- 🔄 **Retry Logic** (v1.1.0+) - Automatic exponential backoff for network errors
|
|
98
|
+
- 📊 **Conversation Summarization** (v1.2.0+) - Automatic token compression (~40-60% reduction)
|
|
99
|
+
- 📤 **Data Export/Import** (v1.2.0+) - Multi-format support (JSON, CSV, SQLite, PostgreSQL, MongoDB)
|
|
73
100
|
|
|
74
101
|
## 🚀 Quick Start
|
|
75
102
|
|
|
76
103
|
### Installation
|
|
77
104
|
|
|
105
|
+
**Basic Installation:**
|
|
78
106
|
```bash
|
|
79
107
|
pip install mem-llm
|
|
80
108
|
```
|
|
81
109
|
|
|
110
|
+
**With Optional Dependencies:**
|
|
111
|
+
```bash
|
|
112
|
+
# PostgreSQL support
|
|
113
|
+
pip install mem-llm[postgresql]
|
|
114
|
+
|
|
115
|
+
# MongoDB support
|
|
116
|
+
pip install mem-llm[mongodb]
|
|
117
|
+
|
|
118
|
+
# All database support (PostgreSQL + MongoDB)
|
|
119
|
+
pip install mem-llm[databases]
|
|
120
|
+
|
|
121
|
+
# All optional features
|
|
122
|
+
pip install mem-llm[all]
|
|
123
|
+
```
|
|
124
|
+
|
|
125
|
+
**Upgrade:**
|
|
126
|
+
```bash
|
|
127
|
+
pip install -U mem-llm
|
|
128
|
+
```
|
|
129
|
+
|
|
82
130
|
### Prerequisites
|
|
83
131
|
|
|
84
132
|
Install and start [Ollama](https://ollama.ai):
|
|
@@ -391,33 +439,8 @@ stats = agent.get_memory_stats()
|
|
|
391
439
|
- **MemoryTools**: Search, export, statistics
|
|
392
440
|
- **ConfigManager**: YAML configuration
|
|
393
441
|
- **CLI**: Command-line interface
|
|
394
|
-
|
|
395
|
-
|
|
396
|
-
|
|
397
|
-
Run the comprehensive test suite:
|
|
398
|
-
|
|
399
|
-
```bash
|
|
400
|
-
# Install dev dependencies
|
|
401
|
-
pip install -r requirements-dev.txt
|
|
402
|
-
|
|
403
|
-
# Run all tests (34+ automated tests)
|
|
404
|
-
cd tests
|
|
405
|
-
python run_all_tests.py
|
|
406
|
-
|
|
407
|
-
# Run specific test
|
|
408
|
-
python -m pytest test_mem_agent.py -v
|
|
409
|
-
```
|
|
410
|
-
|
|
411
|
-
### Test Coverage
|
|
412
|
-
- ✅ Core imports and dependencies
|
|
413
|
-
- ✅ CLI functionality
|
|
414
|
-
- ✅ Ollama connection and models
|
|
415
|
-
- ✅ JSON memory operations
|
|
416
|
-
- ✅ SQL memory operations
|
|
417
|
-
- ✅ MemAgent features
|
|
418
|
-
- ✅ Configuration management
|
|
419
|
-
- ✅ Multi-user scenarios
|
|
420
|
-
- ✅ Hallucination detection
|
|
442
|
+
- **ConversationSummarizer**: Token compression (v1.2.0+)
|
|
443
|
+
- **DataExporter/DataImporter**: Multi-database support (v1.2.0+)
|
|
421
444
|
|
|
422
445
|
## 📝 Examples
|
|
423
446
|
|
|
@@ -430,53 +453,32 @@ The `examples/` directory contains ready-to-run demonstrations:
|
|
|
430
453
|
5. **05_knowledge_base.py** - FAQ/support system
|
|
431
454
|
6. **06_cli_demo.py** - Command-line interface examples
|
|
432
455
|
7. **07_document_config.py** - Configuration from documents
|
|
456
|
+
8. **08_conversation_summarization.py** - Token compression with auto-summary (v1.2.0+)
|
|
457
|
+
9. **09_data_export_import.py** - Multi-format export/import demo (v1.2.0+)
|
|
458
|
+
10. **10_database_connection_test.py** - Enterprise PostgreSQL/MongoDB migration (v1.2.0+)
|
|
433
459
|
|
|
434
|
-
##
|
|
435
|
-
|
|
436
|
-
### Setup Development Environment
|
|
437
|
-
|
|
438
|
-
```bash
|
|
439
|
-
git clone https://github.com/emredeveloper/Mem-LLM.git
|
|
440
|
-
cd Mem-LLM
|
|
441
|
-
pip install -e .
|
|
442
|
-
pip install -r requirements-dev.txt
|
|
443
|
-
```
|
|
444
|
-
|
|
445
|
-
### Running Tests
|
|
446
|
-
|
|
447
|
-
```bash
|
|
448
|
-
pytest tests/ -v --cov=mem_llm
|
|
449
|
-
```
|
|
450
|
-
|
|
451
|
-
### Building Package
|
|
452
|
-
|
|
453
|
-
```bash
|
|
454
|
-
python -m build
|
|
455
|
-
twine upload dist/*
|
|
456
|
-
```
|
|
457
|
-
|
|
458
|
-
## 📋 Requirements
|
|
459
|
-
|
|
460
|
-
### Core Dependencies
|
|
461
|
-
- Python 3.8+
|
|
462
|
-
- requests>=2.31.0
|
|
463
|
-
- pyyaml>=6.0.1
|
|
464
|
-
- click>=8.1.0
|
|
465
|
-
|
|
466
|
-
### Optional Dependencies
|
|
467
|
-
- pytest>=7.4.0 (for testing)
|
|
468
|
-
- flask>=3.0.0 (for web interface)
|
|
469
|
-
- fastapi>=0.104.0 (for API server)
|
|
460
|
+
## 📊 Project Status
|
|
470
461
|
|
|
471
|
-
|
|
462
|
+
- **Version**: 1.2.0
|
|
463
|
+
- **Status**: Production Ready
|
|
464
|
+
- **Last Updated**: October 21, 2025
|
|
465
|
+
- **Test Coverage**: 16/16 automated tests (100% success rate)
|
|
466
|
+
- **Performance**: Thread-safe operations, <1ms search latency
|
|
467
|
+
- **Databases**: SQLite, PostgreSQL, MongoDB, In-Memory
|
|
472
468
|
|
|
473
|
-
|
|
469
|
+
## 📈 Roadmap
|
|
474
470
|
|
|
475
|
-
|
|
476
|
-
|
|
477
|
-
|
|
478
|
-
|
|
479
|
-
|
|
471
|
+
- [x] ~~Thread-safe operations~~ (v1.1.0)
|
|
472
|
+
- [x] ~~Prompt injection protection~~ (v1.1.0)
|
|
473
|
+
- [x] ~~Structured logging~~ (v1.1.0)
|
|
474
|
+
- [x] ~~Retry logic~~ (v1.1.0)
|
|
475
|
+
- [x] ~~Conversation Summarization~~ (v1.2.0)
|
|
476
|
+
- [x] ~~Multi-Database Export/Import~~ (v1.2.0)
|
|
477
|
+
- [x] ~~In-Memory Database~~ (v1.2.0)
|
|
478
|
+
- [ ] Web UI dashboard
|
|
479
|
+
- [ ] REST API server
|
|
480
|
+
- [ ] Vector database integration
|
|
481
|
+
- [ ] Advanced analytics dashboard
|
|
480
482
|
|
|
481
483
|
## 📄 License
|
|
482
484
|
|
|
@@ -494,35 +496,6 @@ This project is licensed under the MIT License - see the [LICENSE](LICENSE) file
|
|
|
494
496
|
- Inspired by the need for privacy-focused AI assistants
|
|
495
497
|
- Thanks to all contributors and users
|
|
496
498
|
|
|
497
|
-
## 📊 Project Status
|
|
498
|
-
|
|
499
|
-
- **Version**: 1.1.0
|
|
500
|
-
- **Status**: Production Ready
|
|
501
|
-
- **Last Updated**: October 21, 2025
|
|
502
|
-
- **Performance**: 15,346 msg/s write throughput, <1ms search latency
|
|
503
|
-
- **Thread-Safe**: Supports 200+ concurrent operations
|
|
504
|
-
- **Test Coverage**: 44+ automated tests (100% success rate)
|
|
505
|
-
|
|
506
|
-
## 🔗 Links
|
|
507
|
-
|
|
508
|
-
- **PyPI**: https://pypi.org/project/mem-llm/
|
|
509
|
-
- **GitHub**: https://github.com/emredeveloper/Mem-LLM
|
|
510
|
-
- **Issues**: https://github.com/emredeveloper/Mem-LLM/issues
|
|
511
|
-
- **Documentation**: See examples/ directory
|
|
512
|
-
|
|
513
|
-
## 📈 Roadmap
|
|
514
|
-
|
|
515
|
-
- [x] ~~Thread-safe operations~~ (v1.1.0)
|
|
516
|
-
- [x] ~~Prompt injection protection~~ (v1.1.0)
|
|
517
|
-
- [x] ~~Structured logging~~ (v1.1.0)
|
|
518
|
-
- [x] ~~Retry logic~~ (v1.1.0)
|
|
519
|
-
- [ ] Web UI dashboard
|
|
520
|
-
- [ ] REST API server
|
|
521
|
-
- [ ] Vector database integration
|
|
522
|
-
- [ ] Multi-language support
|
|
523
|
-
- [ ] Cloud backup options
|
|
524
|
-
- [ ] Advanced analytics
|
|
525
|
-
|
|
526
499
|
---
|
|
527
500
|
|
|
528
501
|
**⭐ If you find this project useful, please give it a star on GitHub!**
|
|
@@ -8,16 +8,23 @@
|
|
|
8
8
|
|
|
9
9
|
Mem-LLM is a powerful Python library that brings persistent memory capabilities to local Large Language Models. Build AI assistants that remember user interactions, manage knowledge bases, and work completely offline with Ollama.
|
|
10
10
|
|
|
11
|
-
##
|
|
11
|
+
## 🔗 Links
|
|
12
12
|
|
|
13
|
-
-
|
|
14
|
-
-
|
|
15
|
-
-
|
|
16
|
-
-
|
|
17
|
-
- 💾 **SQLite WAL Mode**: Write-Ahead Logging for better concurrency (15K+ msg/s)
|
|
18
|
-
- ✅ **100% Backward Compatible**: All v1.0.x code works without changes
|
|
13
|
+
- **PyPI**: https://pypi.org/project/mem-llm/
|
|
14
|
+
- **GitHub**: https://github.com/emredeveloper/Mem-LLM
|
|
15
|
+
- **Issues**: https://github.com/emredeveloper/Mem-LLM/issues
|
|
16
|
+
- **Documentation**: See examples/ directory
|
|
19
17
|
|
|
20
|
-
|
|
18
|
+
## 🆕 What's New in v1.2.0
|
|
19
|
+
|
|
20
|
+
- � **Conversation Summarization**: Automatic conversation compression (~40-60% token reduction)
|
|
21
|
+
- 📤 **Data Export/Import**: JSON, CSV, SQLite, PostgreSQL, MongoDB support
|
|
22
|
+
- 🗄️ **Multi-Database**: Enterprise-ready PostgreSQL & MongoDB integration
|
|
23
|
+
- �️ **In-Memory DB**: Use `:memory:` for temporary operations
|
|
24
|
+
- � **Cleaner Logs**: Default WARNING level for production-ready output
|
|
25
|
+
- � **Bug Fixes**: Database path handling, organized SQLite files
|
|
26
|
+
|
|
27
|
+
[See full changelog](CHANGELOG.md#120---2025-10-21)
|
|
21
28
|
|
|
22
29
|
## ✨ Key Features
|
|
23
30
|
|
|
@@ -34,15 +41,38 @@ Mem-LLM is a powerful Python library that brings persistent memory capabilities
|
|
|
34
41
|
- 🛡️ **Prompt Injection Protection** (v1.1.0+) - Advanced security against prompt attacks (opt-in)
|
|
35
42
|
- ⚡ **High Performance** (v1.1.0+) - Thread-safe operations, 15K+ msg/s throughput
|
|
36
43
|
- 🔄 **Retry Logic** (v1.1.0+) - Automatic exponential backoff for network errors
|
|
44
|
+
- 📊 **Conversation Summarization** (v1.2.0+) - Automatic token compression (~40-60% reduction)
|
|
45
|
+
- 📤 **Data Export/Import** (v1.2.0+) - Multi-format support (JSON, CSV, SQLite, PostgreSQL, MongoDB)
|
|
37
46
|
|
|
38
47
|
## 🚀 Quick Start
|
|
39
48
|
|
|
40
49
|
### Installation
|
|
41
50
|
|
|
51
|
+
**Basic Installation:**
|
|
42
52
|
```bash
|
|
43
53
|
pip install mem-llm
|
|
44
54
|
```
|
|
45
55
|
|
|
56
|
+
**With Optional Dependencies:**
|
|
57
|
+
```bash
|
|
58
|
+
# PostgreSQL support
|
|
59
|
+
pip install mem-llm[postgresql]
|
|
60
|
+
|
|
61
|
+
# MongoDB support
|
|
62
|
+
pip install mem-llm[mongodb]
|
|
63
|
+
|
|
64
|
+
# All database support (PostgreSQL + MongoDB)
|
|
65
|
+
pip install mem-llm[databases]
|
|
66
|
+
|
|
67
|
+
# All optional features
|
|
68
|
+
pip install mem-llm[all]
|
|
69
|
+
```
|
|
70
|
+
|
|
71
|
+
**Upgrade:**
|
|
72
|
+
```bash
|
|
73
|
+
pip install -U mem-llm
|
|
74
|
+
```
|
|
75
|
+
|
|
46
76
|
### Prerequisites
|
|
47
77
|
|
|
48
78
|
Install and start [Ollama](https://ollama.ai):
|
|
@@ -355,33 +385,8 @@ stats = agent.get_memory_stats()
|
|
|
355
385
|
- **MemoryTools**: Search, export, statistics
|
|
356
386
|
- **ConfigManager**: YAML configuration
|
|
357
387
|
- **CLI**: Command-line interface
|
|
358
|
-
|
|
359
|
-
|
|
360
|
-
|
|
361
|
-
Run the comprehensive test suite:
|
|
362
|
-
|
|
363
|
-
```bash
|
|
364
|
-
# Install dev dependencies
|
|
365
|
-
pip install -r requirements-dev.txt
|
|
366
|
-
|
|
367
|
-
# Run all tests (34+ automated tests)
|
|
368
|
-
cd tests
|
|
369
|
-
python run_all_tests.py
|
|
370
|
-
|
|
371
|
-
# Run specific test
|
|
372
|
-
python -m pytest test_mem_agent.py -v
|
|
373
|
-
```
|
|
374
|
-
|
|
375
|
-
### Test Coverage
|
|
376
|
-
- ✅ Core imports and dependencies
|
|
377
|
-
- ✅ CLI functionality
|
|
378
|
-
- ✅ Ollama connection and models
|
|
379
|
-
- ✅ JSON memory operations
|
|
380
|
-
- ✅ SQL memory operations
|
|
381
|
-
- ✅ MemAgent features
|
|
382
|
-
- ✅ Configuration management
|
|
383
|
-
- ✅ Multi-user scenarios
|
|
384
|
-
- ✅ Hallucination detection
|
|
388
|
+
- **ConversationSummarizer**: Token compression (v1.2.0+)
|
|
389
|
+
- **DataExporter/DataImporter**: Multi-database support (v1.2.0+)
|
|
385
390
|
|
|
386
391
|
## 📝 Examples
|
|
387
392
|
|
|
@@ -394,53 +399,32 @@ The `examples/` directory contains ready-to-run demonstrations:
|
|
|
394
399
|
5. **05_knowledge_base.py** - FAQ/support system
|
|
395
400
|
6. **06_cli_demo.py** - Command-line interface examples
|
|
396
401
|
7. **07_document_config.py** - Configuration from documents
|
|
402
|
+
8. **08_conversation_summarization.py** - Token compression with auto-summary (v1.2.0+)
|
|
403
|
+
9. **09_data_export_import.py** - Multi-format export/import demo (v1.2.0+)
|
|
404
|
+
10. **10_database_connection_test.py** - Enterprise PostgreSQL/MongoDB migration (v1.2.0+)
|
|
397
405
|
|
|
398
|
-
##
|
|
399
|
-
|
|
400
|
-
### Setup Development Environment
|
|
401
|
-
|
|
402
|
-
```bash
|
|
403
|
-
git clone https://github.com/emredeveloper/Mem-LLM.git
|
|
404
|
-
cd Mem-LLM
|
|
405
|
-
pip install -e .
|
|
406
|
-
pip install -r requirements-dev.txt
|
|
407
|
-
```
|
|
408
|
-
|
|
409
|
-
### Running Tests
|
|
410
|
-
|
|
411
|
-
```bash
|
|
412
|
-
pytest tests/ -v --cov=mem_llm
|
|
413
|
-
```
|
|
414
|
-
|
|
415
|
-
### Building Package
|
|
416
|
-
|
|
417
|
-
```bash
|
|
418
|
-
python -m build
|
|
419
|
-
twine upload dist/*
|
|
420
|
-
```
|
|
421
|
-
|
|
422
|
-
## 📋 Requirements
|
|
423
|
-
|
|
424
|
-
### Core Dependencies
|
|
425
|
-
- Python 3.8+
|
|
426
|
-
- requests>=2.31.0
|
|
427
|
-
- pyyaml>=6.0.1
|
|
428
|
-
- click>=8.1.0
|
|
429
|
-
|
|
430
|
-
### Optional Dependencies
|
|
431
|
-
- pytest>=7.4.0 (for testing)
|
|
432
|
-
- flask>=3.0.0 (for web interface)
|
|
433
|
-
- fastapi>=0.104.0 (for API server)
|
|
406
|
+
## 📊 Project Status
|
|
434
407
|
|
|
435
|
-
|
|
408
|
+
- **Version**: 1.2.0
|
|
409
|
+
- **Status**: Production Ready
|
|
410
|
+
- **Last Updated**: October 21, 2025
|
|
411
|
+
- **Test Coverage**: 16/16 automated tests (100% success rate)
|
|
412
|
+
- **Performance**: Thread-safe operations, <1ms search latency
|
|
413
|
+
- **Databases**: SQLite, PostgreSQL, MongoDB, In-Memory
|
|
436
414
|
|
|
437
|
-
|
|
415
|
+
## 📈 Roadmap
|
|
438
416
|
|
|
439
|
-
|
|
440
|
-
|
|
441
|
-
|
|
442
|
-
|
|
443
|
-
|
|
417
|
+
- [x] ~~Thread-safe operations~~ (v1.1.0)
|
|
418
|
+
- [x] ~~Prompt injection protection~~ (v1.1.0)
|
|
419
|
+
- [x] ~~Structured logging~~ (v1.1.0)
|
|
420
|
+
- [x] ~~Retry logic~~ (v1.1.0)
|
|
421
|
+
- [x] ~~Conversation Summarization~~ (v1.2.0)
|
|
422
|
+
- [x] ~~Multi-Database Export/Import~~ (v1.2.0)
|
|
423
|
+
- [x] ~~In-Memory Database~~ (v1.2.0)
|
|
424
|
+
- [ ] Web UI dashboard
|
|
425
|
+
- [ ] REST API server
|
|
426
|
+
- [ ] Vector database integration
|
|
427
|
+
- [ ] Advanced analytics dashboard
|
|
444
428
|
|
|
445
429
|
## 📄 License
|
|
446
430
|
|
|
@@ -458,35 +442,6 @@ This project is licensed under the MIT License - see the [LICENSE](LICENSE) file
|
|
|
458
442
|
- Inspired by the need for privacy-focused AI assistants
|
|
459
443
|
- Thanks to all contributors and users
|
|
460
444
|
|
|
461
|
-
## 📊 Project Status
|
|
462
|
-
|
|
463
|
-
- **Version**: 1.1.0
|
|
464
|
-
- **Status**: Production Ready
|
|
465
|
-
- **Last Updated**: October 21, 2025
|
|
466
|
-
- **Performance**: 15,346 msg/s write throughput, <1ms search latency
|
|
467
|
-
- **Thread-Safe**: Supports 200+ concurrent operations
|
|
468
|
-
- **Test Coverage**: 44+ automated tests (100% success rate)
|
|
469
|
-
|
|
470
|
-
## 🔗 Links
|
|
471
|
-
|
|
472
|
-
- **PyPI**: https://pypi.org/project/mem-llm/
|
|
473
|
-
- **GitHub**: https://github.com/emredeveloper/Mem-LLM
|
|
474
|
-
- **Issues**: https://github.com/emredeveloper/Mem-LLM/issues
|
|
475
|
-
- **Documentation**: See examples/ directory
|
|
476
|
-
|
|
477
|
-
## 📈 Roadmap
|
|
478
|
-
|
|
479
|
-
- [x] ~~Thread-safe operations~~ (v1.1.0)
|
|
480
|
-
- [x] ~~Prompt injection protection~~ (v1.1.0)
|
|
481
|
-
- [x] ~~Structured logging~~ (v1.1.0)
|
|
482
|
-
- [x] ~~Retry logic~~ (v1.1.0)
|
|
483
|
-
- [ ] Web UI dashboard
|
|
484
|
-
- [ ] REST API server
|
|
485
|
-
- [ ] Vector database integration
|
|
486
|
-
- [ ] Multi-language support
|
|
487
|
-
- [ ] Cloud backup options
|
|
488
|
-
- [ ] Advanced analytics
|
|
489
|
-
|
|
490
445
|
---
|
|
491
446
|
|
|
492
447
|
**⭐ If you find this project useful, please give it a star on GitHub!**
|
|
@@ -43,7 +43,21 @@ try:
|
|
|
43
43
|
except ImportError:
|
|
44
44
|
__all_enhanced__ = []
|
|
45
45
|
|
|
46
|
-
|
|
46
|
+
# Conversation Summarization (v1.2.0+)
|
|
47
|
+
try:
|
|
48
|
+
from .conversation_summarizer import ConversationSummarizer, AutoSummarizer
|
|
49
|
+
__all_summarizer__ = ["ConversationSummarizer", "AutoSummarizer"]
|
|
50
|
+
except ImportError:
|
|
51
|
+
__all_summarizer__ = []
|
|
52
|
+
|
|
53
|
+
# Data Export/Import (v1.2.0+)
|
|
54
|
+
try:
|
|
55
|
+
from .data_export_import import DataExporter, DataImporter
|
|
56
|
+
__all_export_import__ = ["DataExporter", "DataImporter"]
|
|
57
|
+
except ImportError:
|
|
58
|
+
__all_export_import__ = []
|
|
59
|
+
|
|
60
|
+
__version__ = "1.2.0"
|
|
47
61
|
__author__ = "C. Emre Karataş"
|
|
48
62
|
|
|
49
63
|
# CLI
|
|
@@ -57,4 +71,4 @@ __all__ = [
|
|
|
57
71
|
"MemAgent",
|
|
58
72
|
"MemoryManager",
|
|
59
73
|
"OllamaClient",
|
|
60
|
-
] + __all_tools__ + __all_pro__ + __all_cli__ + __all_security__ + __all_enhanced__
|
|
74
|
+
] + __all_tools__ + __all_pro__ + __all_cli__ + __all_security__ + __all_enhanced__ + __all_summarizer__ + __all_export_import__
|