memorisdk 1.0.1__tar.gz → 2.0.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 memorisdk might be problematic. Click here for more details.
- {memorisdk-1.0.1 → memorisdk-2.0.0}/PKG-INFO +144 -34
- {memorisdk-1.0.1 → memorisdk-2.0.0}/README.md +118 -31
- {memorisdk-1.0.1 → memorisdk-2.0.0}/memori/__init__.py +24 -8
- memorisdk-2.0.0/memori/agents/conscious_agent.py +344 -0
- memorisdk-2.0.0/memori/agents/memory_agent.py +585 -0
- {memorisdk-1.0.1 → memorisdk-2.0.0}/memori/agents/retrieval_agent.py +416 -60
- memorisdk-2.0.0/memori/config/memory_manager.py +323 -0
- memorisdk-2.0.0/memori/core/conversation.py +393 -0
- {memorisdk-1.0.1 → memorisdk-2.0.0}/memori/core/database.py +386 -371
- memorisdk-2.0.0/memori/core/memory.py +2491 -0
- memorisdk-2.0.0/memori/core/providers.py +217 -0
- memorisdk-2.0.0/memori/database/adapters/__init__.py +10 -0
- memorisdk-2.0.0/memori/database/adapters/mysql_adapter.py +331 -0
- memorisdk-2.0.0/memori/database/adapters/postgresql_adapter.py +291 -0
- memorisdk-2.0.0/memori/database/adapters/sqlite_adapter.py +229 -0
- memorisdk-2.0.0/memori/database/auto_creator.py +320 -0
- memorisdk-2.0.0/memori/database/connection_utils.py +207 -0
- memorisdk-2.0.0/memori/database/connectors/base_connector.py +283 -0
- memorisdk-2.0.0/memori/database/connectors/mysql_connector.py +381 -0
- memorisdk-2.0.0/memori/database/connectors/postgres_connector.py +431 -0
- memorisdk-2.0.0/memori/database/connectors/sqlite_connector.py +323 -0
- memorisdk-2.0.0/memori/database/models.py +400 -0
- {memorisdk-1.0.1 → memorisdk-2.0.0}/memori/database/queries/base_queries.py +1 -1
- {memorisdk-1.0.1 → memorisdk-2.0.0}/memori/database/queries/memory_queries.py +91 -2
- memorisdk-2.0.0/memori/database/query_translator.py +222 -0
- memorisdk-2.0.0/memori/database/schema_generators/__init__.py +7 -0
- memorisdk-2.0.0/memori/database/schema_generators/mysql_schema_generator.py +215 -0
- memorisdk-2.0.0/memori/database/search/__init__.py +8 -0
- memorisdk-2.0.0/memori/database/search/mysql_search_adapter.py +255 -0
- memorisdk-2.0.0/memori/database/search/sqlite_search_adapter.py +180 -0
- memorisdk-2.0.0/memori/database/search_service.py +548 -0
- memorisdk-2.0.0/memori/database/sqlalchemy_manager.py +839 -0
- memorisdk-2.0.0/memori/integrations/__init__.py +93 -0
- memorisdk-2.0.0/memori/integrations/litellm_integration.py +345 -0
- memorisdk-2.0.0/memori/integrations/openai_integration.py +539 -0
- memorisdk-2.0.0/memori/utils/input_validator.py +395 -0
- {memorisdk-1.0.1 → memorisdk-2.0.0}/memori/utils/pydantic_models.py +138 -36
- memorisdk-2.0.0/memori/utils/query_builder.py +530 -0
- memorisdk-2.0.0/memori/utils/security_audit.py +594 -0
- memorisdk-2.0.0/memori/utils/security_integration.py +339 -0
- memorisdk-2.0.0/memori/utils/transaction_manager.py +547 -0
- {memorisdk-1.0.1 → memorisdk-2.0.0}/memorisdk.egg-info/PKG-INFO +144 -34
- {memorisdk-1.0.1 → memorisdk-2.0.0}/memorisdk.egg-info/SOURCES.txt +24 -1
- {memorisdk-1.0.1 → memorisdk-2.0.0}/memorisdk.egg-info/requires.txt +28 -1
- {memorisdk-1.0.1 → memorisdk-2.0.0}/pyproject.toml +43 -6
- memorisdk-1.0.1/memori/agents/conscious_agent.py +0 -506
- memorisdk-1.0.1/memori/agents/memory_agent.py +0 -322
- memorisdk-1.0.1/memori/core/memory.py +0 -1349
- memorisdk-1.0.1/memori/database/connectors/mysql_connector.py +0 -159
- memorisdk-1.0.1/memori/database/connectors/postgres_connector.py +0 -158
- memorisdk-1.0.1/memori/database/connectors/sqlite_connector.py +0 -148
- memorisdk-1.0.1/memori/integrations/__init__.py +0 -68
- memorisdk-1.0.1/memori/integrations/litellm_integration.py +0 -11
- memorisdk-1.0.1/memori/integrations/openai_integration.py +0 -273
- memorisdk-1.0.1/memorisdk.egg-info/entry_points.txt +0 -2
- {memorisdk-1.0.1 → memorisdk-2.0.0}/LICENSE +0 -0
- {memorisdk-1.0.1 → memorisdk-2.0.0}/memori/agents/__init__.py +0 -0
- {memorisdk-1.0.1 → memorisdk-2.0.0}/memori/config/__init__.py +0 -0
- {memorisdk-1.0.1 → memorisdk-2.0.0}/memori/config/manager.py +0 -0
- {memorisdk-1.0.1 → memorisdk-2.0.0}/memori/config/settings.py +0 -0
- {memorisdk-1.0.1 → memorisdk-2.0.0}/memori/core/__init__.py +0 -0
- {memorisdk-1.0.1 → memorisdk-2.0.0}/memori/database/__init__.py +0 -0
- {memorisdk-1.0.1 → memorisdk-2.0.0}/memori/database/connectors/__init__.py +0 -0
- {memorisdk-1.0.1 → memorisdk-2.0.0}/memori/database/queries/__init__.py +0 -0
- {memorisdk-1.0.1 → memorisdk-2.0.0}/memori/database/queries/chat_queries.py +0 -0
- {memorisdk-1.0.1 → memorisdk-2.0.0}/memori/database/queries/entity_queries.py +0 -0
- {memorisdk-1.0.1 → memorisdk-2.0.0}/memori/database/templates/__init__.py +0 -0
- {memorisdk-1.0.1 → memorisdk-2.0.0}/memori/database/templates/basic_template.py +0 -0
- {memorisdk-1.0.1 → memorisdk-2.0.0}/memori/database/templates/schemas/__init__.py +0 -0
- {memorisdk-1.0.1 → memorisdk-2.0.0}/memori/integrations/anthropic_integration.py +0 -0
- {memorisdk-1.0.1 → memorisdk-2.0.0}/memori/scripts/llm_text.py +0 -0
- {memorisdk-1.0.1 → memorisdk-2.0.0}/memori/tools/__init__.py +0 -0
- {memorisdk-1.0.1 → memorisdk-2.0.0}/memori/tools/memory_tool.py +0 -0
- {memorisdk-1.0.1 → memorisdk-2.0.0}/memori/utils/__init__.py +0 -0
- {memorisdk-1.0.1 → memorisdk-2.0.0}/memori/utils/exceptions.py +0 -0
- {memorisdk-1.0.1 → memorisdk-2.0.0}/memori/utils/helpers.py +0 -0
- {memorisdk-1.0.1 → memorisdk-2.0.0}/memori/utils/logging.py +0 -0
- {memorisdk-1.0.1 → memorisdk-2.0.0}/memori/utils/schemas.py +0 -0
- {memorisdk-1.0.1 → memorisdk-2.0.0}/memori/utils/validators.py +0 -0
- {memorisdk-1.0.1 → memorisdk-2.0.0}/memorisdk.egg-info/dependency_links.txt +0 -0
- {memorisdk-1.0.1 → memorisdk-2.0.0}/memorisdk.egg-info/top_level.txt +0 -0
- {memorisdk-1.0.1 → memorisdk-2.0.0}/setup.cfg +0 -0
|
@@ -1,11 +1,11 @@
|
|
|
1
1
|
Metadata-Version: 2.4
|
|
2
2
|
Name: memorisdk
|
|
3
|
-
Version:
|
|
3
|
+
Version: 2.0.0
|
|
4
4
|
Summary: The Open-Source Memory Layer for AI Agents & Multi-Agent Systems
|
|
5
|
-
Author-email:
|
|
5
|
+
Author-email: GibsonAI Team <noc@gibsonai.com>
|
|
6
6
|
License: Apache-2.0
|
|
7
7
|
Project-URL: Homepage, https://github.com/GibsonAI/memori
|
|
8
|
-
Project-URL: Documentation, https://gibsonai.
|
|
8
|
+
Project-URL: Documentation, https://memori.gibsonai.com/docs
|
|
9
9
|
Project-URL: Repository, https://github.com/GibsonAI/memori.git
|
|
10
10
|
Project-URL: Bug Tracker, https://github.com/GibsonAI/memori/issues
|
|
11
11
|
Project-URL: Changelog, https://github.com/GibsonAI/memori/blob/main/CHANGELOG.md
|
|
@@ -31,8 +31,9 @@ License-File: LICENSE
|
|
|
31
31
|
Requires-Dist: loguru>=0.6.0
|
|
32
32
|
Requires-Dist: pydantic>=2.0.0
|
|
33
33
|
Requires-Dist: python-dotenv>=1.0.0
|
|
34
|
-
Requires-Dist:
|
|
34
|
+
Requires-Dist: sqlalchemy>=2.0.0
|
|
35
35
|
Requires-Dist: openai>=1.0.0
|
|
36
|
+
Requires-Dist: litellm>=1.0.0
|
|
36
37
|
Provides-Extra: dev
|
|
37
38
|
Requires-Dist: black>=23.0; extra == "dev"
|
|
38
39
|
Requires-Dist: ruff>=0.1.0; extra == "dev"
|
|
@@ -40,6 +41,9 @@ Requires-Dist: isort>=5.9.0; extra == "dev"
|
|
|
40
41
|
Requires-Dist: mypy>=1.0; extra == "dev"
|
|
41
42
|
Requires-Dist: pre-commit>=2.15; extra == "dev"
|
|
42
43
|
Requires-Dist: types-PyYAML>=6.0.0; extra == "dev"
|
|
44
|
+
Requires-Dist: pytest>=6.0; extra == "dev"
|
|
45
|
+
Requires-Dist: pytest-cov>=2.0; extra == "dev"
|
|
46
|
+
Requires-Dist: pytest-asyncio>=0.18.0; extra == "dev"
|
|
43
47
|
Provides-Extra: docs
|
|
44
48
|
Requires-Dist: mkdocs>=1.5.0; extra == "docs"
|
|
45
49
|
Requires-Dist: mkdocs-material>=9.0.0; extra == "docs"
|
|
@@ -50,15 +54,31 @@ Provides-Extra: postgres
|
|
|
50
54
|
Requires-Dist: psycopg2-binary>=2.9.0; extra == "postgres"
|
|
51
55
|
Provides-Extra: mysql
|
|
52
56
|
Requires-Dist: PyMySQL>=1.0.0; extra == "mysql"
|
|
57
|
+
Provides-Extra: databases
|
|
58
|
+
Requires-Dist: psycopg2-binary>=2.9.0; extra == "databases"
|
|
59
|
+
Requires-Dist: PyMySQL>=1.0.0; extra == "databases"
|
|
60
|
+
Provides-Extra: anthropic
|
|
61
|
+
Requires-Dist: anthropic>=0.3.0; extra == "anthropic"
|
|
62
|
+
Provides-Extra: litellm
|
|
63
|
+
Requires-Dist: litellm>=1.0.0; extra == "litellm"
|
|
53
64
|
Provides-Extra: integrations
|
|
54
65
|
Requires-Dist: litellm>=1.0.0; extra == "integrations"
|
|
55
66
|
Requires-Dist: anthropic>=0.3.0; extra == "integrations"
|
|
67
|
+
Provides-Extra: demos
|
|
68
|
+
Requires-Dist: streamlit>=1.28.0; extra == "demos"
|
|
69
|
+
Requires-Dist: pandas>=2.0.0; extra == "demos"
|
|
70
|
+
Requires-Dist: plotly>=5.17.0; extra == "demos"
|
|
71
|
+
Requires-Dist: crewai>=0.152.0; extra == "demos"
|
|
72
|
+
Requires-Dist: crewai-tools>=0.59.0; extra == "demos"
|
|
56
73
|
Provides-Extra: all
|
|
57
74
|
Requires-Dist: black>=23.0; extra == "all"
|
|
58
75
|
Requires-Dist: ruff>=0.1.0; extra == "all"
|
|
59
76
|
Requires-Dist: isort>=5.9.0; extra == "all"
|
|
60
77
|
Requires-Dist: mypy>=1.0; extra == "all"
|
|
61
78
|
Requires-Dist: pre-commit>=2.15; extra == "all"
|
|
79
|
+
Requires-Dist: pytest>=6.0; extra == "all"
|
|
80
|
+
Requires-Dist: pytest-cov>=2.0; extra == "all"
|
|
81
|
+
Requires-Dist: pytest-asyncio>=0.18.0; extra == "all"
|
|
62
82
|
Requires-Dist: mkdocs>=1.5.0; extra == "all"
|
|
63
83
|
Requires-Dist: mkdocs-material>=9.0.0; extra == "all"
|
|
64
84
|
Requires-Dist: mkdocs-git-revision-date-localized-plugin>=1.2.0; extra == "all"
|
|
@@ -68,17 +88,43 @@ Requires-Dist: psycopg2-binary>=2.9.0; extra == "all"
|
|
|
68
88
|
Requires-Dist: PyMySQL>=1.0.0; extra == "all"
|
|
69
89
|
Requires-Dist: litellm>=1.0.0; extra == "all"
|
|
70
90
|
Requires-Dist: anthropic>=0.3.0; extra == "all"
|
|
91
|
+
Requires-Dist: streamlit>=1.28.0; extra == "all"
|
|
92
|
+
Requires-Dist: pandas>=2.0.0; extra == "all"
|
|
93
|
+
Requires-Dist: plotly>=5.17.0; extra == "all"
|
|
71
94
|
Dynamic: license-file
|
|
72
95
|
|
|
73
|
-
|
|
74
|
-
|
|
75
|
-
|
|
76
|
-
|
|
77
|
-
|
|
78
|
-
|
|
79
|
-
|
|
80
|
-
|
|
81
|
-
|
|
96
|
+
[](https://gibsonai.com/)
|
|
97
|
+
|
|
98
|
+
# memori
|
|
99
|
+
|
|
100
|
+
<p align="center">
|
|
101
|
+
<strong>Open-Source Memory Engine for LLMs, AI Agents & Multi-Agent Systems</strong>
|
|
102
|
+
</p>
|
|
103
|
+
|
|
104
|
+
<p align="center">
|
|
105
|
+
<i>Make LLMs context-aware with human-like memory, dual-mode retrieval, and automatic context injection.</i>
|
|
106
|
+
</p>
|
|
107
|
+
|
|
108
|
+
<p align="center">
|
|
109
|
+
<a href="https://memori.gibsonai.com/docs">Learn more</a>
|
|
110
|
+
·
|
|
111
|
+
<a href="https://www.gibsonai.com/discord">Join Discord</a>
|
|
112
|
+
</p>
|
|
113
|
+
|
|
114
|
+
<p align="center">
|
|
115
|
+
<a href="https://badge.fury.io/py/memorisdk">
|
|
116
|
+
<img src="https://badge.fury.io/py/memori.svg" alt="PyPI version">
|
|
117
|
+
</a>
|
|
118
|
+
<a href="https://pepy.tech/projects/memorisdk">
|
|
119
|
+
<img src="https://static.pepy.tech/badge/memorisdk" alt="Downloads">
|
|
120
|
+
</a>
|
|
121
|
+
<a href="https://opensource.org/licenses/MIT">
|
|
122
|
+
<img src="https://img.shields.io/badge/License-MIT-yellow.svg" alt="License: MIT">
|
|
123
|
+
</a>
|
|
124
|
+
<a href="https://www.python.org/downloads/">
|
|
125
|
+
<img src="https://img.shields.io/badge/python-3.8+-blue.svg" alt="Python 3.8+">
|
|
126
|
+
</a>
|
|
127
|
+
</p>
|
|
82
128
|
|
|
83
129
|
---
|
|
84
130
|
|
|
@@ -92,32 +138,72 @@ Dynamic: license-file
|
|
|
92
138
|
|
|
93
139
|
## ⚡ Quick Start
|
|
94
140
|
|
|
141
|
+
Install Memori:
|
|
142
|
+
|
|
95
143
|
```bash
|
|
96
144
|
pip install memorisdk
|
|
97
145
|
```
|
|
98
146
|
|
|
147
|
+
### Example with OpenAI
|
|
148
|
+
|
|
149
|
+
1. Install OpenAI:
|
|
150
|
+
|
|
151
|
+
```bash
|
|
152
|
+
pip install openai
|
|
153
|
+
```
|
|
154
|
+
|
|
155
|
+
2. Set OpenAI API Key:
|
|
156
|
+
|
|
157
|
+
```bash
|
|
158
|
+
export OPENAI_API_KEY="sk-your-openai-key-here"
|
|
159
|
+
```
|
|
160
|
+
|
|
161
|
+
3. Run this Python script:
|
|
162
|
+
|
|
99
163
|
```python
|
|
100
164
|
from memori import Memori
|
|
165
|
+
from openai import OpenAI
|
|
101
166
|
|
|
102
|
-
#
|
|
103
|
-
|
|
104
|
-
database_connect="sqlite:///office_memory.db",
|
|
105
|
-
conscious_ingest=True, # Short-term working memory (one-shot context)
|
|
106
|
-
openai_api_key="your-key"
|
|
107
|
-
)
|
|
167
|
+
# Initialize OpenAI client
|
|
168
|
+
openai_client = OpenAI()
|
|
108
169
|
|
|
109
|
-
|
|
170
|
+
# Initialize memory
|
|
171
|
+
memori = Memori(conscious_ingest=True)
|
|
172
|
+
memori.enable()
|
|
110
173
|
|
|
111
|
-
|
|
112
|
-
|
|
174
|
+
print("=== First Conversation - Establishing Context ===")
|
|
175
|
+
response1 = openai_client.chat.completions.create(
|
|
176
|
+
model="gpt-4o-mini",
|
|
177
|
+
messages=[{
|
|
178
|
+
"role": "user",
|
|
179
|
+
"content": "I'm working on a Python FastAPI project"
|
|
180
|
+
}]
|
|
181
|
+
)
|
|
113
182
|
|
|
114
|
-
|
|
115
|
-
|
|
116
|
-
|
|
183
|
+
print("Assistant:", response1.choices[0].message.content)
|
|
184
|
+
print("\n" + "="*50)
|
|
185
|
+
print("=== Second Conversation - Memory Provides Context ===")
|
|
186
|
+
|
|
187
|
+
response2 = openai_client.chat.completions.create(
|
|
188
|
+
model="gpt-4o-mini",
|
|
189
|
+
messages=[{
|
|
190
|
+
"role": "user",
|
|
191
|
+
"content": "Help me add user authentication"
|
|
192
|
+
}]
|
|
117
193
|
)
|
|
118
|
-
|
|
194
|
+
print("Assistant:", response2.choices[0].message.content)
|
|
195
|
+
print("\n💡 Notice: Memori automatically knows about your FastAPI Python project!")
|
|
119
196
|
```
|
|
120
197
|
|
|
198
|
+
---
|
|
199
|
+
|
|
200
|
+
**🚀 Ready to explore more?**
|
|
201
|
+
- [📖 Examples](#examples) - Basic usage patterns and code samples
|
|
202
|
+
- [🔌 Framework Integrations](#framework-integrations) - LangChain, Agno & CrewAI examples
|
|
203
|
+
- [🎮 Interactive Demos](#interactive-demos) - Live applications & tutorials
|
|
204
|
+
|
|
205
|
+
---
|
|
206
|
+
|
|
121
207
|
## 🧠 How It Works
|
|
122
208
|
|
|
123
209
|
### 1. **Universal Recording**
|
|
@@ -284,15 +370,15 @@ Works with **ANY** LLM library:
|
|
|
284
370
|
```python
|
|
285
371
|
memori.enable() # Enable universal recording
|
|
286
372
|
|
|
287
|
-
# LiteLLM (recommended)
|
|
288
|
-
from litellm import completion
|
|
289
|
-
completion(model="gpt-4", messages=[...])
|
|
290
|
-
|
|
291
373
|
# OpenAI
|
|
292
|
-
import
|
|
293
|
-
client =
|
|
374
|
+
from openai import OpenAI
|
|
375
|
+
client = OpenAI()
|
|
294
376
|
client.chat.completions.create(...)
|
|
295
377
|
|
|
378
|
+
# LiteLLM
|
|
379
|
+
from litellm import completion
|
|
380
|
+
completion(model="gpt-4", messages=[...])
|
|
381
|
+
|
|
296
382
|
# Anthropic
|
|
297
383
|
import anthropic
|
|
298
384
|
client = anthropic.Anthropic()
|
|
@@ -365,7 +451,7 @@ memori/
|
|
|
365
451
|
└── tools/ # Memory search tools
|
|
366
452
|
```
|
|
367
453
|
|
|
368
|
-
##
|
|
454
|
+
## Examples
|
|
369
455
|
|
|
370
456
|
- **[Basic Usage](./examples/basic_usage.py)** - Simple memory setup with conscious ingestion
|
|
371
457
|
- **[Personal Assistant](./examples/personal_assistant.py)** - AI assistant with intelligent memory
|
|
@@ -373,9 +459,33 @@ memori/
|
|
|
373
459
|
- **[Advanced Config](./examples/advanced_config.py)** - Production configuration
|
|
374
460
|
- **[Interactive Demo](./memori_example.py)** - Live conscious ingestion showcase
|
|
375
461
|
|
|
462
|
+
## Framework Integrations
|
|
463
|
+
|
|
464
|
+
Memori works seamlessly with popular AI frameworks:
|
|
465
|
+
|
|
466
|
+
| Framework | Description | Example | Features |
|
|
467
|
+
|-----------|-------------|---------|----------|
|
|
468
|
+
| 🤖 [Agno](./examples/integrations/agno_example.py) | Memory-enhanced agent framework integration with persistent conversations | Simple chat agent with memory search | Memory tools, conversation persistence, contextual responses |
|
|
469
|
+
| 👥 [CrewAI](./examples/integrations/crewai_example.py) | Multi-agent system with shared memory across agent interactions | Collaborative agents with memory | Agent coordination, shared memory, task-based workflows |
|
|
470
|
+
| 🌊 [Digital Ocean AI](./examples/integrations/digital_ocean_example.py) | Memory-enhanced customer support using Digital Ocean's AI platform | Customer support assistant with conversation history | Context injection, session continuity, support analytics |
|
|
471
|
+
| 🔗 [LangChain](./examples/integrations/langchain_example.py) | Enterprise-grade agent framework with advanced memory integration | AI assistant with LangChain tools and memory | Custom tools, agent executors, memory persistence, error handling |
|
|
472
|
+
| � [OpenAI Agent](./examples/integrations/openai_agent_example.py) | Memory-enhanced OpenAI Agent with function calling and user preference tracking | Interactive assistant with memory search and user info storage | Function calling tools, memory search, preference tracking, async conversations |
|
|
473
|
+
| �🚀 [Swarms](./examples/integrations/swarms_example.py) | Multi-agent system framework with persistent memory capabilities | Memory-enhanced Swarms agents with auto/conscious ingestion | Agent memory persistence, multi-agent coordination, contextual awareness |
|
|
474
|
+
|
|
475
|
+
## Interactive Demos
|
|
476
|
+
|
|
477
|
+
Explore Memori's capabilities through these interactive demonstrations:
|
|
478
|
+
|
|
479
|
+
| Title | Description | Tools Used | Live Demo |
|
|
480
|
+
|------------|-------------|------------|-----------|
|
|
481
|
+
| 🌟 [Personal Diary Assistant](./demos/personal_diary_assistant/) | A comprehensive diary assistant with mood tracking, pattern analysis, and personalized recommendations. | Streamlit, LiteLLM, OpenAI, SQLite | [Run Demo](https://personal-diary-assistant.streamlit.app/) |
|
|
482
|
+
| 🌍 [Travel Planner Agent](./demos/travel_planner/) | Intelligent travel planning with CrewAI agents, real-time web search, and memory-based personalization. Plans complete itineraries with budget analysis. | CrewAI, Streamlit, OpenAI, SQLite | |
|
|
483
|
+
| 🧑🔬 [Researcher Agent](./demos/researcher_agent/) | Advanced AI research assistant with persistent memory, real-time web search, and comprehensive report generation. Builds upon previous research sessions. | Agno, Streamlit, OpenAI, ExaAI, SQLite | [Run Demo](https://researcher-agent-memori.streamlit.app/) |
|
|
484
|
+
|
|
376
485
|
## 🤝 Contributing
|
|
377
486
|
|
|
378
|
-
See [CONTRIBUTING.md](./CONTRIBUTING.md) for development setup and guidelines.
|
|
487
|
+
- See [CONTRIBUTING.md](./CONTRIBUTING.md) for development setup and guidelines.
|
|
488
|
+
- Community: [Discord](https://www.gibsonai.com/discord)
|
|
379
489
|
|
|
380
490
|
## 📄 License
|
|
381
491
|
|
|
@@ -1,12 +1,35 @@
|
|
|
1
|
-
|
|
2
|
-
|
|
3
|
-
|
|
4
|
-
|
|
5
|
-
|
|
6
|
-
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
|
|
1
|
+
[](https://gibsonai.com/)
|
|
2
|
+
|
|
3
|
+
# memori
|
|
4
|
+
|
|
5
|
+
<p align="center">
|
|
6
|
+
<strong>Open-Source Memory Engine for LLMs, AI Agents & Multi-Agent Systems</strong>
|
|
7
|
+
</p>
|
|
8
|
+
|
|
9
|
+
<p align="center">
|
|
10
|
+
<i>Make LLMs context-aware with human-like memory, dual-mode retrieval, and automatic context injection.</i>
|
|
11
|
+
</p>
|
|
12
|
+
|
|
13
|
+
<p align="center">
|
|
14
|
+
<a href="https://memori.gibsonai.com/docs">Learn more</a>
|
|
15
|
+
·
|
|
16
|
+
<a href="https://www.gibsonai.com/discord">Join Discord</a>
|
|
17
|
+
</p>
|
|
18
|
+
|
|
19
|
+
<p align="center">
|
|
20
|
+
<a href="https://badge.fury.io/py/memorisdk">
|
|
21
|
+
<img src="https://badge.fury.io/py/memori.svg" alt="PyPI version">
|
|
22
|
+
</a>
|
|
23
|
+
<a href="https://pepy.tech/projects/memorisdk">
|
|
24
|
+
<img src="https://static.pepy.tech/badge/memorisdk" alt="Downloads">
|
|
25
|
+
</a>
|
|
26
|
+
<a href="https://opensource.org/licenses/MIT">
|
|
27
|
+
<img src="https://img.shields.io/badge/License-MIT-yellow.svg" alt="License: MIT">
|
|
28
|
+
</a>
|
|
29
|
+
<a href="https://www.python.org/downloads/">
|
|
30
|
+
<img src="https://img.shields.io/badge/python-3.8+-blue.svg" alt="Python 3.8+">
|
|
31
|
+
</a>
|
|
32
|
+
</p>
|
|
10
33
|
|
|
11
34
|
---
|
|
12
35
|
|
|
@@ -20,32 +43,72 @@
|
|
|
20
43
|
|
|
21
44
|
## ⚡ Quick Start
|
|
22
45
|
|
|
46
|
+
Install Memori:
|
|
47
|
+
|
|
23
48
|
```bash
|
|
24
49
|
pip install memorisdk
|
|
25
50
|
```
|
|
26
51
|
|
|
52
|
+
### Example with OpenAI
|
|
53
|
+
|
|
54
|
+
1. Install OpenAI:
|
|
55
|
+
|
|
56
|
+
```bash
|
|
57
|
+
pip install openai
|
|
58
|
+
```
|
|
59
|
+
|
|
60
|
+
2. Set OpenAI API Key:
|
|
61
|
+
|
|
62
|
+
```bash
|
|
63
|
+
export OPENAI_API_KEY="sk-your-openai-key-here"
|
|
64
|
+
```
|
|
65
|
+
|
|
66
|
+
3. Run this Python script:
|
|
67
|
+
|
|
27
68
|
```python
|
|
28
69
|
from memori import Memori
|
|
70
|
+
from openai import OpenAI
|
|
29
71
|
|
|
30
|
-
#
|
|
31
|
-
|
|
32
|
-
database_connect="sqlite:///office_memory.db",
|
|
33
|
-
conscious_ingest=True, # Short-term working memory (one-shot context)
|
|
34
|
-
openai_api_key="your-key"
|
|
35
|
-
)
|
|
72
|
+
# Initialize OpenAI client
|
|
73
|
+
openai_client = OpenAI()
|
|
36
74
|
|
|
37
|
-
|
|
75
|
+
# Initialize memory
|
|
76
|
+
memori = Memori(conscious_ingest=True)
|
|
77
|
+
memori.enable()
|
|
38
78
|
|
|
39
|
-
|
|
40
|
-
|
|
79
|
+
print("=== First Conversation - Establishing Context ===")
|
|
80
|
+
response1 = openai_client.chat.completions.create(
|
|
81
|
+
model="gpt-4o-mini",
|
|
82
|
+
messages=[{
|
|
83
|
+
"role": "user",
|
|
84
|
+
"content": "I'm working on a Python FastAPI project"
|
|
85
|
+
}]
|
|
86
|
+
)
|
|
41
87
|
|
|
42
|
-
|
|
43
|
-
|
|
44
|
-
|
|
88
|
+
print("Assistant:", response1.choices[0].message.content)
|
|
89
|
+
print("\n" + "="*50)
|
|
90
|
+
print("=== Second Conversation - Memory Provides Context ===")
|
|
91
|
+
|
|
92
|
+
response2 = openai_client.chat.completions.create(
|
|
93
|
+
model="gpt-4o-mini",
|
|
94
|
+
messages=[{
|
|
95
|
+
"role": "user",
|
|
96
|
+
"content": "Help me add user authentication"
|
|
97
|
+
}]
|
|
45
98
|
)
|
|
46
|
-
|
|
99
|
+
print("Assistant:", response2.choices[0].message.content)
|
|
100
|
+
print("\n💡 Notice: Memori automatically knows about your FastAPI Python project!")
|
|
47
101
|
```
|
|
48
102
|
|
|
103
|
+
---
|
|
104
|
+
|
|
105
|
+
**🚀 Ready to explore more?**
|
|
106
|
+
- [📖 Examples](#examples) - Basic usage patterns and code samples
|
|
107
|
+
- [🔌 Framework Integrations](#framework-integrations) - LangChain, Agno & CrewAI examples
|
|
108
|
+
- [🎮 Interactive Demos](#interactive-demos) - Live applications & tutorials
|
|
109
|
+
|
|
110
|
+
---
|
|
111
|
+
|
|
49
112
|
## 🧠 How It Works
|
|
50
113
|
|
|
51
114
|
### 1. **Universal Recording**
|
|
@@ -212,15 +275,15 @@ Works with **ANY** LLM library:
|
|
|
212
275
|
```python
|
|
213
276
|
memori.enable() # Enable universal recording
|
|
214
277
|
|
|
215
|
-
# LiteLLM (recommended)
|
|
216
|
-
from litellm import completion
|
|
217
|
-
completion(model="gpt-4", messages=[...])
|
|
218
|
-
|
|
219
278
|
# OpenAI
|
|
220
|
-
import
|
|
221
|
-
client =
|
|
279
|
+
from openai import OpenAI
|
|
280
|
+
client = OpenAI()
|
|
222
281
|
client.chat.completions.create(...)
|
|
223
282
|
|
|
283
|
+
# LiteLLM
|
|
284
|
+
from litellm import completion
|
|
285
|
+
completion(model="gpt-4", messages=[...])
|
|
286
|
+
|
|
224
287
|
# Anthropic
|
|
225
288
|
import anthropic
|
|
226
289
|
client = anthropic.Anthropic()
|
|
@@ -293,7 +356,7 @@ memori/
|
|
|
293
356
|
└── tools/ # Memory search tools
|
|
294
357
|
```
|
|
295
358
|
|
|
296
|
-
##
|
|
359
|
+
## Examples
|
|
297
360
|
|
|
298
361
|
- **[Basic Usage](./examples/basic_usage.py)** - Simple memory setup with conscious ingestion
|
|
299
362
|
- **[Personal Assistant](./examples/personal_assistant.py)** - AI assistant with intelligent memory
|
|
@@ -301,9 +364,33 @@ memori/
|
|
|
301
364
|
- **[Advanced Config](./examples/advanced_config.py)** - Production configuration
|
|
302
365
|
- **[Interactive Demo](./memori_example.py)** - Live conscious ingestion showcase
|
|
303
366
|
|
|
367
|
+
## Framework Integrations
|
|
368
|
+
|
|
369
|
+
Memori works seamlessly with popular AI frameworks:
|
|
370
|
+
|
|
371
|
+
| Framework | Description | Example | Features |
|
|
372
|
+
|-----------|-------------|---------|----------|
|
|
373
|
+
| 🤖 [Agno](./examples/integrations/agno_example.py) | Memory-enhanced agent framework integration with persistent conversations | Simple chat agent with memory search | Memory tools, conversation persistence, contextual responses |
|
|
374
|
+
| 👥 [CrewAI](./examples/integrations/crewai_example.py) | Multi-agent system with shared memory across agent interactions | Collaborative agents with memory | Agent coordination, shared memory, task-based workflows |
|
|
375
|
+
| 🌊 [Digital Ocean AI](./examples/integrations/digital_ocean_example.py) | Memory-enhanced customer support using Digital Ocean's AI platform | Customer support assistant with conversation history | Context injection, session continuity, support analytics |
|
|
376
|
+
| 🔗 [LangChain](./examples/integrations/langchain_example.py) | Enterprise-grade agent framework with advanced memory integration | AI assistant with LangChain tools and memory | Custom tools, agent executors, memory persistence, error handling |
|
|
377
|
+
| � [OpenAI Agent](./examples/integrations/openai_agent_example.py) | Memory-enhanced OpenAI Agent with function calling and user preference tracking | Interactive assistant with memory search and user info storage | Function calling tools, memory search, preference tracking, async conversations |
|
|
378
|
+
| �🚀 [Swarms](./examples/integrations/swarms_example.py) | Multi-agent system framework with persistent memory capabilities | Memory-enhanced Swarms agents with auto/conscious ingestion | Agent memory persistence, multi-agent coordination, contextual awareness |
|
|
379
|
+
|
|
380
|
+
## Interactive Demos
|
|
381
|
+
|
|
382
|
+
Explore Memori's capabilities through these interactive demonstrations:
|
|
383
|
+
|
|
384
|
+
| Title | Description | Tools Used | Live Demo |
|
|
385
|
+
|------------|-------------|------------|-----------|
|
|
386
|
+
| 🌟 [Personal Diary Assistant](./demos/personal_diary_assistant/) | A comprehensive diary assistant with mood tracking, pattern analysis, and personalized recommendations. | Streamlit, LiteLLM, OpenAI, SQLite | [Run Demo](https://personal-diary-assistant.streamlit.app/) |
|
|
387
|
+
| 🌍 [Travel Planner Agent](./demos/travel_planner/) | Intelligent travel planning with CrewAI agents, real-time web search, and memory-based personalization. Plans complete itineraries with budget analysis. | CrewAI, Streamlit, OpenAI, SQLite | |
|
|
388
|
+
| 🧑🔬 [Researcher Agent](./demos/researcher_agent/) | Advanced AI research assistant with persistent memory, real-time web search, and comprehensive report generation. Builds upon previous research sessions. | Agno, Streamlit, OpenAI, ExaAI, SQLite | [Run Demo](https://researcher-agent-memori.streamlit.app/) |
|
|
389
|
+
|
|
304
390
|
## 🤝 Contributing
|
|
305
391
|
|
|
306
|
-
See [CONTRIBUTING.md](./CONTRIBUTING.md) for development setup and guidelines.
|
|
392
|
+
- See [CONTRIBUTING.md](./CONTRIBUTING.md) for development setup and guidelines.
|
|
393
|
+
- Community: [Discord](https://www.gibsonai.com/discord)
|
|
307
394
|
|
|
308
395
|
## 📄 License
|
|
309
396
|
|
|
@@ -311,4 +398,4 @@ MIT License - see [LICENSE](./LICENSE) for details.
|
|
|
311
398
|
|
|
312
399
|
---
|
|
313
400
|
|
|
314
|
-
*Made for developers who want their AI agents to remember and learn*
|
|
401
|
+
*Made for developers who want their AI agents to remember and learn*
|
|
@@ -5,13 +5,11 @@ Professional-grade memory layer with comprehensive error handling, configuration
|
|
|
5
5
|
management, and modular architecture for production AI systems.
|
|
6
6
|
"""
|
|
7
7
|
|
|
8
|
-
__version__ = "
|
|
8
|
+
__version__ = "2.0.0"
|
|
9
9
|
__author__ = "Harshal More"
|
|
10
10
|
__email__ = "harshalmore2468@gmail.com"
|
|
11
11
|
|
|
12
|
-
|
|
13
|
-
from .agents.memory_agent import MemoryAgent
|
|
14
|
-
from .agents.retrieval_agent import MemorySearchEngine
|
|
12
|
+
from typing import Any, Optional
|
|
15
13
|
|
|
16
14
|
# Configuration system
|
|
17
15
|
from .config import (
|
|
@@ -72,7 +70,22 @@ from .utils import ( # Pydantic models; Enhanced exceptions; Validators and hel
|
|
|
72
70
|
get_logger,
|
|
73
71
|
)
|
|
74
72
|
|
|
75
|
-
|
|
73
|
+
# Memory agents (dynamically imported to avoid import errors)
|
|
74
|
+
MemoryAgent: Optional[Any] = None
|
|
75
|
+
MemorySearchEngine: Optional[Any] = None
|
|
76
|
+
_AGENTS_AVAILABLE = False
|
|
77
|
+
|
|
78
|
+
try:
|
|
79
|
+
from .agents.memory_agent import MemoryAgent
|
|
80
|
+
from .agents.retrieval_agent import MemorySearchEngine
|
|
81
|
+
|
|
82
|
+
_AGENTS_AVAILABLE = True
|
|
83
|
+
except ImportError:
|
|
84
|
+
# Agents are not available, use placeholder None values
|
|
85
|
+
pass
|
|
86
|
+
|
|
87
|
+
# Build __all__ list dynamically based on available components
|
|
88
|
+
_all_components = [
|
|
76
89
|
# Core
|
|
77
90
|
"Memori",
|
|
78
91
|
"DatabaseManager",
|
|
@@ -82,9 +95,6 @@ __all__ = [
|
|
|
82
95
|
"AgentSettings",
|
|
83
96
|
"LoggingSettings",
|
|
84
97
|
"ConfigManager",
|
|
85
|
-
# Agents
|
|
86
|
-
"MemoryAgent",
|
|
87
|
-
"MemorySearchEngine",
|
|
88
98
|
# Database
|
|
89
99
|
"SQLiteConnector",
|
|
90
100
|
"PostgreSQLConnector",
|
|
@@ -138,3 +148,9 @@ __all__ = [
|
|
|
138
148
|
"LoggingManager",
|
|
139
149
|
"get_logger",
|
|
140
150
|
]
|
|
151
|
+
|
|
152
|
+
# Add agents only if available
|
|
153
|
+
if _AGENTS_AVAILABLE:
|
|
154
|
+
_all_components.extend(["MemoryAgent", "MemorySearchEngine"])
|
|
155
|
+
|
|
156
|
+
__all__ = _all_components
|