mem-llm 1.1.0__py3-none-any.whl → 1.3.0__py3-none-any.whl

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.

@@ -1,13 +1,13 @@
1
1
  Metadata-Version: 2.2
2
2
  Name: mem-llm
3
- Version: 1.1.0
4
- Summary: Memory-enabled AI assistant with local LLM support - Now with security and performance improvements
3
+ Version: 1.3.0
4
+ Summary: Memory-enabled AI assistant with multi-backend LLM support (Ollama, LM Studio, Gemini) - Local and cloud ready
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
8
8
  Project-URL: Bug Reports, https://github.com/emredeveloper/Mem-LLM/issues
9
9
  Project-URL: Source, https://github.com/emredeveloper/Mem-LLM
10
- Keywords: llm,ai,memory,agent,chatbot,ollama,local
10
+ Keywords: llm,ai,memory,agent,chatbot,ollama,lmstudio,gemini,multi-backend,local
11
11
  Classifier: Development Status :: 4 - Beta
12
12
  Classifier: Intended Audience :: Developers
13
13
  Classifier: Topic :: Scientific/Engineering :: Artificial Intelligence
@@ -22,6 +22,7 @@ Description-Content-Type: text/markdown
22
22
  Requires-Dist: requests>=2.31.0
23
23
  Requires-Dist: pyyaml>=6.0.1
24
24
  Requires-Dist: click>=8.1.0
25
+ Requires-Dist: google-generativeai>=0.3.0
25
26
  Provides-Extra: dev
26
27
  Requires-Dist: pytest>=7.4.0; extra == "dev"
27
28
  Requires-Dist: pytest-cov>=4.1.0; extra == "dev"
@@ -33,6 +34,24 @@ Requires-Dist: flask-cors>=4.0.0; extra == "web"
33
34
  Provides-Extra: api
34
35
  Requires-Dist: fastapi>=0.104.0; extra == "api"
35
36
  Requires-Dist: uvicorn>=0.24.0; extra == "api"
37
+ Provides-Extra: postgresql
38
+ Requires-Dist: psycopg2-binary>=2.9.9; extra == "postgresql"
39
+ Provides-Extra: mongodb
40
+ Requires-Dist: pymongo>=4.6.0; extra == "mongodb"
41
+ Provides-Extra: databases
42
+ Requires-Dist: psycopg2-binary>=2.9.9; extra == "databases"
43
+ Requires-Dist: pymongo>=4.6.0; extra == "databases"
44
+ Provides-Extra: all
45
+ Requires-Dist: pytest>=7.4.0; extra == "all"
46
+ Requires-Dist: pytest-cov>=4.1.0; extra == "all"
47
+ Requires-Dist: black>=23.7.0; extra == "all"
48
+ Requires-Dist: flake8>=6.1.0; extra == "all"
49
+ Requires-Dist: flask>=3.0.0; extra == "all"
50
+ Requires-Dist: flask-cors>=4.0.0; extra == "all"
51
+ Requires-Dist: fastapi>=0.104.0; extra == "all"
52
+ Requires-Dist: uvicorn>=0.24.0; extra == "all"
53
+ Requires-Dist: psycopg2-binary>=2.9.9; extra == "all"
54
+ Requires-Dist: pymongo>=4.6.0; extra == "all"
36
55
 
37
56
  # 🧠 Mem-LLM
38
57
 
@@ -44,16 +63,23 @@ Requires-Dist: uvicorn>=0.24.0; extra == "api"
44
63
 
45
64
  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
65
 
47
- ## 🆕 What's New in v1.1.0
66
+ ## 🔗 Links
48
67
 
49
- - 🛡️ **Prompt Injection Protection**: Detects and blocks 15+ attack patterns (opt-in with `enable_security=True`)
50
- - **Thread-Safe Operations**: Fixed all race conditions, supports 200+ concurrent writes
51
- - 🔄 **Retry Logic**: Exponential backoff for network errors (3 retries: 1s, 2s, 4s)
52
- - 📝 **Structured Logging**: Production-ready logging with `MemLLMLogger`
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
68
+ - **PyPI**: https://pypi.org/project/mem-llm/
69
+ - **GitHub**: https://github.com/emredeveloper/Mem-LLM
70
+ - **Issues**: https://github.com/emredeveloper/Mem-LLM/issues
71
+ - **Documentation**: See examples/ directory
55
72
 
56
- [See full changelog](CHANGELOG.md#110---2025-10-21)
73
+ ## 🆕 What's New in v1.2.0
74
+
75
+ - � **Conversation Summarization**: Automatic conversation compression (~40-60% token reduction)
76
+ - 📤 **Data Export/Import**: JSON, CSV, SQLite, PostgreSQL, MongoDB support
77
+ - 🗄️ **Multi-Database**: Enterprise-ready PostgreSQL & MongoDB integration
78
+ - �️ **In-Memory DB**: Use `:memory:` for temporary operations
79
+ - � **Cleaner Logs**: Default WARNING level for production-ready output
80
+ - � **Bug Fixes**: Database path handling, organized SQLite files
81
+
82
+ [See full changelog](CHANGELOG.md#120---2025-10-21)
57
83
 
58
84
  ## ✨ Key Features
59
85
 
@@ -70,15 +96,38 @@ Mem-LLM is a powerful Python library that brings persistent memory capabilities
70
96
  - 🛡️ **Prompt Injection Protection** (v1.1.0+) - Advanced security against prompt attacks (opt-in)
71
97
  - ⚡ **High Performance** (v1.1.0+) - Thread-safe operations, 15K+ msg/s throughput
72
98
  - 🔄 **Retry Logic** (v1.1.0+) - Automatic exponential backoff for network errors
99
+ - 📊 **Conversation Summarization** (v1.2.0+) - Automatic token compression (~40-60% reduction)
100
+ - 📤 **Data Export/Import** (v1.2.0+) - Multi-format support (JSON, CSV, SQLite, PostgreSQL, MongoDB)
73
101
 
74
102
  ## 🚀 Quick Start
75
103
 
76
104
  ### Installation
77
105
 
106
+ **Basic Installation:**
78
107
  ```bash
79
108
  pip install mem-llm
80
109
  ```
81
110
 
111
+ **With Optional Dependencies:**
112
+ ```bash
113
+ # PostgreSQL support
114
+ pip install mem-llm[postgresql]
115
+
116
+ # MongoDB support
117
+ pip install mem-llm[mongodb]
118
+
119
+ # All database support (PostgreSQL + MongoDB)
120
+ pip install mem-llm[databases]
121
+
122
+ # All optional features
123
+ pip install mem-llm[all]
124
+ ```
125
+
126
+ **Upgrade:**
127
+ ```bash
128
+ pip install -U mem-llm
129
+ ```
130
+
82
131
  ### Prerequisites
83
132
 
84
133
  Install and start [Ollama](https://ollama.ai):
@@ -391,33 +440,8 @@ stats = agent.get_memory_stats()
391
440
  - **MemoryTools**: Search, export, statistics
392
441
  - **ConfigManager**: YAML configuration
393
442
  - **CLI**: Command-line interface
394
-
395
- ## 🧪 Testing
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
443
+ - **ConversationSummarizer**: Token compression (v1.2.0+)
444
+ - **DataExporter/DataImporter**: Multi-database support (v1.2.0+)
421
445
 
422
446
  ## 📝 Examples
423
447
 
@@ -430,53 +454,32 @@ The `examples/` directory contains ready-to-run demonstrations:
430
454
  5. **05_knowledge_base.py** - FAQ/support system
431
455
  6. **06_cli_demo.py** - Command-line interface examples
432
456
  7. **07_document_config.py** - Configuration from documents
457
+ 8. **08_conversation_summarization.py** - Token compression with auto-summary (v1.2.0+)
458
+ 9. **09_data_export_import.py** - Multi-format export/import demo (v1.2.0+)
459
+ 10. **10_database_connection_test.py** - Enterprise PostgreSQL/MongoDB migration (v1.2.0+)
433
460
 
434
- ## 🛠️ Development
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)
461
+ ## 📊 Project Status
470
462
 
471
- ## 🤝 Contributing
463
+ - **Version**: 1.2.0
464
+ - **Status**: Production Ready
465
+ - **Last Updated**: October 21, 2025
466
+ - **Test Coverage**: 16/16 automated tests (100% success rate)
467
+ - **Performance**: Thread-safe operations, <1ms search latency
468
+ - **Databases**: SQLite, PostgreSQL, MongoDB, In-Memory
472
469
 
473
- Contributions are welcome! Please feel free to submit a Pull Request.
470
+ ## 📈 Roadmap
474
471
 
475
- 1. Fork the repository
476
- 2. Create your feature branch (`git checkout -b feature/AmazingFeature`)
477
- 3. Commit your changes (`git commit -m 'Add some AmazingFeature'`)
478
- 4. Push to the branch (`git push origin feature/AmazingFeature`)
479
- 5. Open a Pull Request
472
+ - [x] ~~Thread-safe operations~~ (v1.1.0)
473
+ - [x] ~~Prompt injection protection~~ (v1.1.0)
474
+ - [x] ~~Structured logging~~ (v1.1.0)
475
+ - [x] ~~Retry logic~~ (v1.1.0)
476
+ - [x] ~~Conversation Summarization~~ (v1.2.0)
477
+ - [x] ~~Multi-Database Export/Import~~ (v1.2.0)
478
+ - [x] ~~In-Memory Database~~ (v1.2.0)
479
+ - [ ] Web UI dashboard
480
+ - [ ] REST API server
481
+ - [ ] Vector database integration
482
+ - [ ] Advanced analytics dashboard
480
483
 
481
484
  ## 📄 License
482
485
 
@@ -494,35 +497,6 @@ This project is licensed under the MIT License - see the [LICENSE](LICENSE) file
494
497
  - Inspired by the need for privacy-focused AI assistants
495
498
  - Thanks to all contributors and users
496
499
 
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
500
  ---
527
501
 
528
502
  **⭐ If you find this project useful, please give it a star on GitHub!**
@@ -0,0 +1,29 @@
1
+ mem_llm/__init__.py,sha256=Nx_7o8uFoK7WzLjY4Ko2sVITQoAcYtwNsUK4AugddbE,2636
2
+ mem_llm/base_llm_client.py,sha256=aCpr8ZnvOsu-a-zp9quTDP42XvjAC1uci6r11s0QdVA,5218
3
+ mem_llm/cli.py,sha256=DiqQyBZknN8pVagY5jXH85_LZ6odVGopfpa-7DILNNE,8666
4
+ mem_llm/config.yaml.example,sha256=lgmfaU5pxnIm4zYxwgCcgLSohNx1Jw6oh3Qk0Xoe2DE,917
5
+ mem_llm/config_from_docs.py,sha256=YFhq1SWyK63C-TNMS73ncNHg8sJ-XGOf2idWVCjxFco,4974
6
+ mem_llm/config_manager.py,sha256=is4m0ISBIfv4PInGjrpvhxy0A7p9_BQ_UoJeayaIT3A,7084
7
+ mem_llm/conversation_summarizer.py,sha256=yCG2pKrAJf7xjaG6DPXL0i9eesMZnnzjKTpuyLHMTPQ,12509
8
+ mem_llm/data_export_import.py,sha256=gQIdD0hBY23qcRvx139yE15RWHXPinL_EoRNY7iabj0,22592
9
+ mem_llm/dynamic_prompt.py,sha256=8H99QVDRJSVtGb_o4sdEPnG1cJWuer3KiD-nuL1srTA,10244
10
+ mem_llm/knowledge_loader.py,sha256=oSNhfYYcx7DlZLVogxnbSwaIydq_Q3__RDJFeZR2XVw,2699
11
+ mem_llm/llm_client.py,sha256=3F04nlnRWRlhkQ3aZO-OfsxeajB2gwbIDfClu04cyb0,8709
12
+ mem_llm/llm_client_factory.py,sha256=jite-4CkgFBd9e0b2cIaZzP-zTqA7tjNqXnJ5CQgcbs,9325
13
+ mem_llm/logger.py,sha256=dZUmhGgFXtDsDBU_D4kZlJeMp6k-VNPaBcyTt7rZYKE,4507
14
+ mem_llm/mem_agent.py,sha256=Y4qCHNtdPlOJssQLG1GJdy02FsztYe9sjnbh54qAWWU,37221
15
+ mem_llm/memory_db.py,sha256=4HbxgfhPrijbBKsEv4ncmjZeK-RhtLkyWBrg-quCsNE,14715
16
+ mem_llm/memory_manager.py,sha256=CZI3A8pFboHQIgeiXB1h2gZK7mgfbVSU3IxuqE-zXtc,9978
17
+ mem_llm/memory_tools.py,sha256=ARANFqu_bmL56SlV1RzTjfQsJj-Qe2QvqY0pF92hDxU,8678
18
+ mem_llm/prompt_security.py,sha256=ehAi6aLiXj0gFFhpyjwEr8LentSTJwOQDLbINV7SaVM,9960
19
+ mem_llm/retry_handler.py,sha256=z5ZcSQKbvVeNK7plagTLorvOeoYgRpQcsX3PpNqUjKM,6389
20
+ mem_llm/thread_safe_db.py,sha256=Fq-wSn4ua1qiR6M4ZTIy7UT1IlFj5xODNExgub1blbU,10328
21
+ mem_llm/clients/__init__.py,sha256=Nvr4NuL9ZlDF_dUjr-ZMFxRRrBdHoUOjqncZs3n5Wow,475
22
+ mem_llm/clients/gemini_client.py,sha256=dmRZRd8f-x6J2W7luzcB1BOx_4UpXpCF4YiPGUccWCw,14432
23
+ mem_llm/clients/lmstudio_client.py,sha256=IxUX3sVRfXN46hfEUTCrspGTOeqsn4YAu9WzFuGh940,10156
24
+ mem_llm/clients/ollama_client.py,sha256=2BfYSBiOowhFg9UiCXkILlBG9_4Vri3-Iny_gH6-um0,9710
25
+ mem_llm-1.3.0.dist-info/METADATA,sha256=Ov-FBPV2qYjgWWYv9l0WidhSmr7vGx-NW1uIqxAToi4,15518
26
+ mem_llm-1.3.0.dist-info/WHEEL,sha256=beeZ86-EfXScwlR_HKu4SllMC9wUEj_8Z_4FJ3egI2w,91
27
+ mem_llm-1.3.0.dist-info/entry_points.txt,sha256=z9bg6xgNroIobvCMtnSXeFPc-vI1nMen8gejHCdnl0U,45
28
+ mem_llm-1.3.0.dist-info/top_level.txt,sha256=_fU1ML-0JwkaxWdhqpwtmTNaJEOvDMQeJdA8d5WqDn8,8
29
+ mem_llm-1.3.0.dist-info/RECORD,,
@@ -1,21 +0,0 @@
1
- mem_llm/__init__.py,sha256=tOh6_NntQjk8QbEEDYEThOfGZTGwKQwgznWGWg0I6V4,1700
2
- mem_llm/cli.py,sha256=DiqQyBZknN8pVagY5jXH85_LZ6odVGopfpa-7DILNNE,8666
3
- mem_llm/config.yaml.example,sha256=lgmfaU5pxnIm4zYxwgCcgLSohNx1Jw6oh3Qk0Xoe2DE,917
4
- mem_llm/config_from_docs.py,sha256=YFhq1SWyK63C-TNMS73ncNHg8sJ-XGOf2idWVCjxFco,4974
5
- mem_llm/config_manager.py,sha256=8PIHs21jZWlI-eG9DgekjOvNxU3-U4xH7SbT8Gr-Z6M,7075
6
- mem_llm/dynamic_prompt.py,sha256=8H99QVDRJSVtGb_o4sdEPnG1cJWuer3KiD-nuL1srTA,10244
7
- mem_llm/knowledge_loader.py,sha256=oSNhfYYcx7DlZLVogxnbSwaIydq_Q3__RDJFeZR2XVw,2699
8
- mem_llm/llm_client.py,sha256=3F04nlnRWRlhkQ3aZO-OfsxeajB2gwbIDfClu04cyb0,8709
9
- mem_llm/logger.py,sha256=dZUmhGgFXtDsDBU_D4kZlJeMp6k-VNPaBcyTt7rZYKE,4507
10
- mem_llm/mem_agent.py,sha256=HC-XHzyHowkabOeGF49ypEAPi3ymmX1j_nlCMwSFxOY,32107
11
- mem_llm/memory_db.py,sha256=EC894gaNpBzxHsiPx2WlQ4R0EBuZ0ZKYAm4Q3YpOdEE,14531
12
- mem_llm/memory_manager.py,sha256=CZI3A8pFboHQIgeiXB1h2gZK7mgfbVSU3IxuqE-zXtc,9978
13
- mem_llm/memory_tools.py,sha256=ARANFqu_bmL56SlV1RzTjfQsJj-Qe2QvqY0pF92hDxU,8678
14
- mem_llm/prompt_security.py,sha256=ehAi6aLiXj0gFFhpyjwEr8LentSTJwOQDLbINV7SaVM,9960
15
- mem_llm/retry_handler.py,sha256=z5ZcSQKbvVeNK7plagTLorvOeoYgRpQcsX3PpNqUjKM,6389
16
- mem_llm/thread_safe_db.py,sha256=7dTwATSJf1w5NMXNKg0n2Whv2F6LsdytRcUQ4Ruz_wg,10144
17
- mem_llm-1.1.0.dist-info/METADATA,sha256=VQ69D7mKe-56-_xBVx5fq1dYdyqj1nenlquxEMnll5k,15175
18
- mem_llm-1.1.0.dist-info/WHEEL,sha256=beeZ86-EfXScwlR_HKu4SllMC9wUEj_8Z_4FJ3egI2w,91
19
- mem_llm-1.1.0.dist-info/entry_points.txt,sha256=z9bg6xgNroIobvCMtnSXeFPc-vI1nMen8gejHCdnl0U,45
20
- mem_llm-1.1.0.dist-info/top_level.txt,sha256=_fU1ML-0JwkaxWdhqpwtmTNaJEOvDMQeJdA8d5WqDn8,8
21
- mem_llm-1.1.0.dist-info/RECORD,,