-
Notifications
You must be signed in to change notification settings - Fork 1
feat: implement Mem0 memory backend adapter #338
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Changes from 7 commits
026b913
e6cf866
871f228
fa007f3
669975c
28eba7a
e8c7def
8bc403b
89e670d
6227b58
ac7d47e
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
| Original file line number | Diff line number | Diff line change |
|---|---|---|
|
|
@@ -3,11 +3,19 @@ | |
| Re-exports protocols (``MemoryBackend``, ``MemoryCapabilities``, | ||
| ``SharedKnowledgeStore``, ``MemoryInjectionStrategy``, | ||
| ``OrgMemoryBackend``, ``ConsolidationStrategy``, ``ArchivalStore``), | ||
| domain models, config models, factory, retrieval pipeline, | ||
| consolidation, org memory, and error hierarchy so consumers can | ||
| import from ``ai_company.memory`` directly. | ||
| concrete backends (``Mem0MemoryBackend``), domain models, config | ||
| models, factory, retrieval pipeline, consolidation, org memory, and | ||
| error hierarchy so consumers can import from ``ai_company.memory`` | ||
| directly. | ||
|
Comment on lines
+6
to
+9
Contributor
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Docstring export list is incomplete. Line 6 mentions only 🤖 Prompt for AI Agents |
||
| """ | ||
|
|
||
| import contextlib | ||
|
|
||
| with contextlib.suppress(ImportError): # mem0ai is optional | ||
| from ai_company.memory.backends.mem0 import ( | ||
| Mem0EmbedderConfig, | ||
| Mem0MemoryBackend, | ||
| ) | ||
|
Contributor
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. 🧹 Nitpick | 🔵 Trivial Conditionally-defined exports in When
Consider conditionally extending 💡 Optional: Conditionally extend __all__+_MEM0_EXPORTS: list[str] = []
with contextlib.suppress(ImportError): # mem0ai is optional
from ai_company.memory.backends.mem0 import (
Mem0EmbedderConfig,
Mem0MemoryBackend,
)
+ _MEM0_EXPORTS = ["Mem0EmbedderConfig", "Mem0MemoryBackend"]
__all__ = [
"ArchivalStore",
# ... other exports ...
- "Mem0EmbedderConfig",
- "Mem0MemoryBackend",
# ... other exports ...
-]
+] + _MEM0_EXPORTSAlso applies to: 85-86 🤖 Prompt for AI Agents |
||
| from ai_company.memory.capabilities import MemoryCapabilities | ||
| from ai_company.memory.config import ( | ||
| CompanyMemoryConfig, | ||
|
|
@@ -74,6 +82,8 @@ | |
| "DefaultTokenEstimator", | ||
| "InjectionPoint", | ||
| "InjectionStrategy", | ||
| "Mem0EmbedderConfig", | ||
| "Mem0MemoryBackend", | ||
| "MemoryBackend", | ||
| "MemoryCapabilities", | ||
| "MemoryCapabilityError", | ||
|
|
||
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,5 @@ | ||
| """Concrete memory backend implementations.""" | ||
|
|
||
| from ai_company.memory.backends.mem0 import Mem0MemoryBackend | ||
|
|
||
| __all__ = ["Mem0MemoryBackend"] |
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,6 @@ | ||
| """Mem0-backed agent memory — adapter, config, and mappers.""" | ||
|
|
||
| from ai_company.memory.backends.mem0.adapter import Mem0MemoryBackend | ||
| from ai_company.memory.backends.mem0.config import Mem0BackendConfig, Mem0EmbedderConfig | ||
|
|
||
| __all__ = ["Mem0BackendConfig", "Mem0EmbedderConfig", "Mem0MemoryBackend"] |
Uh oh!
There was an error while loading. Please reload this page.