AI Memory and Conversation Management Framework - Simple as mem0, Powerful as MemU
Project description
MemU is an agentic memory framework for LLM and AI agent backends. It receives multimodal inputs (conversations, documents, images), extracts them into structured memory, and organizes them into a hierarchical file system that supports both embedding-based (RAG) and non-embedding (LLM) retrieval.
MemU is collaborating with four open-source projects to launch the 2026 New Year Challenge. 🎉Between January 8–18, contributors can submit PRs to memU and earn cash rewards, community recognition, and platform credits. 🎁Learn more & get involved
✨ Core Features
| Feature | Description |
|---|---|
| 🗂️ Hierarchical File System | Three-layer architecture: Resource → Item → Category with full traceability |
| 🔍 Dual Retrieval Methods | RAG (embedding-based) for speed, LLM (non-embedding) for deep semantic understanding |
| 🎨 Multimodal Support | Process conversations, documents, images, audio, and video |
| 🔄 Self-Evolving Memory | Memory structure adapts and improves based on usage patterns |
🗂️ Hierarchical File System
MemU organizes memory using a three-layer architecture inspired by hierarchical storage systems:
| Layer | Description | Examples |
|---|---|---|
| Resource | Raw multimodal data warehouse | JSON conversations, text documents, images, videos |
| Item | Discrete extracted memory units | Individual preferences, skills, opinions, habits |
| Category | Aggregated textual memory with summaries | preferences.md, work_life.md, relationships.md |
Key Benefits:
- Full Traceability: Track from raw data → items → categories and back
- Progressive Summarization: Each layer provides increasingly abstracted views
- Flexible Organization: Categories evolve based on content patterns
🎨 Multimodal Support
MemU processes diverse content types into unified memory:
| Modality | Input | Processing |
|---|---|---|
conversation |
JSON chat logs | Extract preferences, opinions, habits, relationships |
document |
Text files (.txt, .md) | Extract knowledge, skills, facts |
image |
PNG, JPG, etc. | Vision model extracts visual concepts and descriptions |
video |
Video files | Frame extraction + vision analysis |
audio |
Audio files | Transcription + text processing |
All modalities are unified into the same three-layer hierarchy, enabling cross-modal retrieval.
🚀 Quick Start
Option 1: Cloud Version
Try MemU instantly without any setup:
👉 memu.so - Hosted cloud service with full API access
For enterprise deployment and custom solutions, contact info@nevamind.ai
Cloud API (v3)
| Base URL | https://api.memu.so |
|---|---|
| Auth | Authorization: Bearer YOUR_API_KEY |
| Method | Endpoint | Description |
|---|---|---|
POST |
/api/v3/memory/memorize |
Register a memorization task |
GET |
/api/v3/memory/memorize/status/{task_id} |
Get task status |
POST |
/api/v3/memory/categories |
List memory categories |
POST |
/api/v3/memory/retrieve |
Retrieve memories (semantic search) |
Option 2: Self-Hosted
Installation
pip install -e .
Basic Example
Requirements: Python 3.13+ and an OpenAI API key
Test with In-Memory Storage (no database required):
export OPENAI_API_KEY=your_api_key
cd tests
python test_inmemory.py
Test with PostgreSQL Storage (requires pgvector):
# Start PostgreSQL with pgvector
docker run -d \
--name memu-postgres \
-e POSTGRES_USER=postgres \
-e POSTGRES_PASSWORD=postgres \
-e POSTGRES_DB=memu \
-p 5432:5432 \
pgvector/pgvector:pg16
# Run the test
export OPENAI_API_KEY=your_api_key
cd tests
python test_postgres.py
Both examples demonstrate the complete workflow:
- Memorize: Process a conversation file and extract structured memory
- Retrieve (RAG): Fast embedding-based search
- Retrieve (LLM): Deep semantic understanding search
See tests/test_inmemory.py and tests/test_postgres.py for the full source code.
📖 Core APIs
memorize() - Extract and Store Memory
Processes input resources and extracts structured memory:
result = await service.memorize(
resource_url="path/to/file.json", # File path or URL
modality="conversation", # conversation | document | image | video | audio
user={"user_id": "123"} # Optional: scope to a user
)
# Returns:
{
"resource": {...}, # Stored resource metadata
"items": [...], # Extracted memory items
"categories": [...] # Updated category summaries
}
retrieve() - Query Memory
Retrieves relevant memory based on queries. MemU supports two retrieval strategies:
RAG-based Retrieval (method="rag")
Fast embedding vector search using cosine similarity:
- ✅ Fast: Pure vector computation
- ✅ Scalable: Efficient for large memory stores
- ✅ Returns scores: Each result includes similarity score
LLM-based Retrieval (method="llm")
Deep semantic understanding through direct LLM reasoning:
- ✅ Deep understanding: LLM comprehends context and nuance
- ✅ Query rewriting: Automatically refines query at each tier
- ✅ Adaptive: Stops early when sufficient information is found
Comparison
| Aspect | RAG | LLM |
|---|---|---|
| Speed | ⚡ Fast | 🐢 Slower |
| Cost | 💰 Low | 💰💰 Higher |
| Semantic depth | Medium | Deep |
| Tier 2 scope | All items | Only items in relevant categories |
| Output | With similarity scores | Ranked by LLM reasoning |
Both methods support:
- Context-aware rewriting: Resolves pronouns using conversation history
- Progressive search: Categories → Items → Resources
- Sufficiency checking: Stops when enough information is retrieved
Usage
result = await service.retrieve(
queries=[
{"role": "user", "content": {"text": "What are their preferences?"}},
{"role": "user", "content": {"text": "Tell me about work habits"}}
],
where={"user_id": "123"} # Optional: scope filter
)
# Returns:
{
"categories": [...], # Relevant categories (with scores for RAG)
"items": [...], # Relevant memory items
"resources": [...], # Related raw resources
"next_step_query": "..." # Rewritten query for follow-up (if applicable)
}
Scope Filtering: Use where to filter by user model fields:
where={"user_id": "123"}- exact matchwhere={"agent_id__in": ["1", "2"]}- match any in list- Omit
whereto retrieve across all scopes
📚 For complete API documentation, see SERVICE_API.md - includes all methods, CRUD operations, pipeline configuration, and configuration types.
💡 Use Cases
Example 1: Conversation Memory
Extract and organize memory from multi-turn conversations:
export OPENAI_API_KEY=your_api_key
python examples/example_1_conversation_memory.py
What it does:
- Processes multiple conversation JSON files
- Extracts memory items (preferences, habits, opinions, relationships)
- Generates category markdown files (
preferences.md,work_life.md, etc.)
Best for: Personal AI assistants, customer support bots, social chatbots
Example 2: Skill Extraction from Logs
Extract skills and lessons learned from agent execution logs:
export OPENAI_API_KEY=your_api_key
python examples/example_2_skill_extraction.py
What it does:
- Processes agent logs sequentially
- Extracts actions, outcomes, and lessons learned
- Demonstrates incremental learning - memory evolves with each file
- Generates evolving skill guides (
log_1.md→log_2.md→skill.md)
Best for: DevOps teams, agent self-improvement, knowledge management
Example 3: Multimodal Memory
Process diverse content types into unified memory:
export OPENAI_API_KEY=your_api_key
python examples/example_3_multimodal_memory.py
What it does:
- Processes documents and images together
- Extracts memory from different content types
- Unifies into cross-modal categories (
technical_documentation,visual_diagrams, etc.)
Best for: Documentation systems, learning platforms, research tools
📊 Performance
MemU achieves 92.09% average accuracy on the Locomo benchmark across all reasoning tasks.
View detailed experimental data: memU-experiment
🧩 Ecosystem
| Repository | Description | Use Case |
|---|---|---|
| memU | Core algorithm engine | Embed AI memory into your product |
| memU-server | Backend service with CRUD, user system, RBAC | Self-host a memory backend |
| memU-ui | Visual dashboard | Ready-to-use memory console |
Quick Links:
🤝 Partners
📄 License
🌍 Community
- GitHub Issues: Report bugs & request features
- Discord: Join the community
- X (Twitter): Follow @memU_ai
- Contact: info@nevamind.ai
⭐ Star us on GitHub to get notified about new releases!
Project details
Release history Release notifications | RSS feed
Download files
Download the file for your platform. If you're not sure which to choose, learn more about installing packages.
Source Distribution
Built Distributions
Filter files by name, interpreter, ABI, and platform.
If you're not sure about the file name format, learn more about wheel file names.
Copy a direct link to the current filters
File details
Details for the file memu_py-1.1.0.tar.gz.
File metadata
- Download URL: memu_py-1.1.0.tar.gz
- Upload date:
- Size: 9.8 MB
- Tags: Source
- Uploaded using Trusted Publishing? Yes
- Uploaded via: twine/6.1.0 CPython/3.13.7
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
22c71cc0f09dd803f546713d8105c72ac09c029c7b141f076f463ea426c6c933
|
|
| MD5 |
c3329215e331a9f4f927c0c25ed9ad4e
|
|
| BLAKE2b-256 |
294e41fde4958c4cf56adb151f708066b5fc2e29c3632a46c382069e687b1bcc
|
Provenance
The following attestation bundles were made for memu_py-1.1.0.tar.gz:
Publisher:
release-please.yml on NevaMind-AI/memU
-
Statement:
-
Statement type:
https://in-toto.io/Statement/v1 -
Predicate type:
https://docs.pypi.org/attestations/publish/v1 -
Subject name:
memu_py-1.1.0.tar.gz -
Subject digest:
22c71cc0f09dd803f546713d8105c72ac09c029c7b141f076f463ea426c6c933 - Sigstore transparency entry: 800431551
- Sigstore integration time:
-
Permalink:
NevaMind-AI/memU@a02c04222b9f0becb4e19156de0642d55c3b915f -
Branch / Tag:
refs/heads/main - Owner: https://github.com/NevaMind-AI
-
Access:
public
-
Token Issuer:
https://token.actions.githubusercontent.com -
Runner Environment:
github-hosted -
Publication workflow:
release-please.yml@a02c04222b9f0becb4e19156de0642d55c3b915f -
Trigger Event:
push
-
Statement type:
File details
Details for the file memu_py-1.1.0-cp313-abi3-win_amd64.whl.
File metadata
- Download URL: memu_py-1.1.0-cp313-abi3-win_amd64.whl
- Upload date:
- Size: 220.9 kB
- Tags: CPython 3.13+, Windows x86-64
- Uploaded using Trusted Publishing? Yes
- Uploaded via: twine/6.1.0 CPython/3.13.7
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
cea949940c4b0b105c8449d14af2ea77794d2b4cd9ce11dc1df9dca63c85d2ce
|
|
| MD5 |
7f084596d2bfaf3dd8ff8e8e7ace2045
|
|
| BLAKE2b-256 |
c43ae8b13929cff986d5809109f2b392821f72b33832bd3ff8a2121e41407b6c
|
Provenance
The following attestation bundles were made for memu_py-1.1.0-cp313-abi3-win_amd64.whl:
Publisher:
release-please.yml on NevaMind-AI/memU
-
Statement:
-
Statement type:
https://in-toto.io/Statement/v1 -
Predicate type:
https://docs.pypi.org/attestations/publish/v1 -
Subject name:
memu_py-1.1.0-cp313-abi3-win_amd64.whl -
Subject digest:
cea949940c4b0b105c8449d14af2ea77794d2b4cd9ce11dc1df9dca63c85d2ce - Sigstore transparency entry: 800431565
- Sigstore integration time:
-
Permalink:
NevaMind-AI/memU@a02c04222b9f0becb4e19156de0642d55c3b915f -
Branch / Tag:
refs/heads/main - Owner: https://github.com/NevaMind-AI
-
Access:
public
-
Token Issuer:
https://token.actions.githubusercontent.com -
Runner Environment:
github-hosted -
Publication workflow:
release-please.yml@a02c04222b9f0becb4e19156de0642d55c3b915f -
Trigger Event:
push
-
Statement type:
File details
Details for the file memu_py-1.1.0-cp313-abi3-manylinux_2_39_aarch64.whl.
File metadata
- Download URL: memu_py-1.1.0-cp313-abi3-manylinux_2_39_aarch64.whl
- Upload date:
- Size: 349.3 kB
- Tags: CPython 3.13+, manylinux: glibc 2.39+ ARM64
- Uploaded using Trusted Publishing? Yes
- Uploaded via: twine/6.1.0 CPython/3.13.7
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
768efe8d51d80d2c4cc5126af5b8da84e3bccc8b11f66020c1dc1a9a98592c0b
|
|
| MD5 |
2c6596a5334050d07dc38631ed5d8fbd
|
|
| BLAKE2b-256 |
6e819ab1710521cbaf8e1ecc33de152f552e75e60e3224be6d8f5ec2e837291b
|
Provenance
The following attestation bundles were made for memu_py-1.1.0-cp313-abi3-manylinux_2_39_aarch64.whl:
Publisher:
release-please.yml on NevaMind-AI/memU
-
Statement:
-
Statement type:
https://in-toto.io/Statement/v1 -
Predicate type:
https://docs.pypi.org/attestations/publish/v1 -
Subject name:
memu_py-1.1.0-cp313-abi3-manylinux_2_39_aarch64.whl -
Subject digest:
768efe8d51d80d2c4cc5126af5b8da84e3bccc8b11f66020c1dc1a9a98592c0b - Sigstore transparency entry: 800431592
- Sigstore integration time:
-
Permalink:
NevaMind-AI/memU@a02c04222b9f0becb4e19156de0642d55c3b915f -
Branch / Tag:
refs/heads/main - Owner: https://github.com/NevaMind-AI
-
Access:
public
-
Token Issuer:
https://token.actions.githubusercontent.com -
Runner Environment:
github-hosted -
Publication workflow:
release-please.yml@a02c04222b9f0becb4e19156de0642d55c3b915f -
Trigger Event:
push
-
Statement type:
File details
Details for the file memu_py-1.1.0-cp313-abi3-macosx_11_0_arm64.whl.
File metadata
- Download URL: memu_py-1.1.0-cp313-abi3-macosx_11_0_arm64.whl
- Upload date:
- Size: 326.6 kB
- Tags: CPython 3.13+, macOS 11.0+ ARM64
- Uploaded using Trusted Publishing? Yes
- Uploaded via: twine/6.1.0 CPython/3.13.7
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
76ab59bd21df9fd848054a07eff5043d3b71ffcbbf08733f1b512319ffe5eb45
|
|
| MD5 |
7933a64cf7d4e294eed70954ac4e8efb
|
|
| BLAKE2b-256 |
4b9f24c26f8875fddca00f5b07579d047e9f11809241bc70510de2625400ca0c
|
Provenance
The following attestation bundles were made for memu_py-1.1.0-cp313-abi3-macosx_11_0_arm64.whl:
Publisher:
release-please.yml on NevaMind-AI/memU
-
Statement:
-
Statement type:
https://in-toto.io/Statement/v1 -
Predicate type:
https://docs.pypi.org/attestations/publish/v1 -
Subject name:
memu_py-1.1.0-cp313-abi3-macosx_11_0_arm64.whl -
Subject digest:
76ab59bd21df9fd848054a07eff5043d3b71ffcbbf08733f1b512319ffe5eb45 - Sigstore transparency entry: 800431626
- Sigstore integration time:
-
Permalink:
NevaMind-AI/memU@a02c04222b9f0becb4e19156de0642d55c3b915f -
Branch / Tag:
refs/heads/main - Owner: https://github.com/NevaMind-AI
-
Access:
public
-
Token Issuer:
https://token.actions.githubusercontent.com -
Runner Environment:
github-hosted -
Publication workflow:
release-please.yml@a02c04222b9f0becb4e19156de0642d55c3b915f -
Trigger Event:
push
-
Statement type:
File details
Details for the file memu_py-1.1.0-cp313-abi3-macosx_10_12_x86_64.whl.
File metadata
- Download URL: memu_py-1.1.0-cp313-abi3-macosx_10_12_x86_64.whl
- Upload date:
- Size: 329.0 kB
- Tags: CPython 3.13+, macOS 10.12+ x86-64
- Uploaded using Trusted Publishing? Yes
- Uploaded via: twine/6.1.0 CPython/3.13.7
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
8b005d912664a12a6bd8365ab0360278ec22b52e9cb0c833da951c9d7719e75e
|
|
| MD5 |
495134d4e2641eb5ad1a6d134649af3e
|
|
| BLAKE2b-256 |
5508b7775e98645231dab4e2a547fb9d095a07e7d6adb27dd47271210624600d
|
Provenance
The following attestation bundles were made for memu_py-1.1.0-cp313-abi3-macosx_10_12_x86_64.whl:
Publisher:
release-please.yml on NevaMind-AI/memU
-
Statement:
-
Statement type:
https://in-toto.io/Statement/v1 -
Predicate type:
https://docs.pypi.org/attestations/publish/v1 -
Subject name:
memu_py-1.1.0-cp313-abi3-macosx_10_12_x86_64.whl -
Subject digest:
8b005d912664a12a6bd8365ab0360278ec22b52e9cb0c833da951c9d7719e75e - Sigstore transparency entry: 800431577
- Sigstore integration time:
-
Permalink:
NevaMind-AI/memU@a02c04222b9f0becb4e19156de0642d55c3b915f -
Branch / Tag:
refs/heads/main - Owner: https://github.com/NevaMind-AI
-
Access:
public
-
Token Issuer:
https://token.actions.githubusercontent.com -
Runner Environment:
github-hosted -
Publication workflow:
release-please.yml@a02c04222b9f0becb4e19156de0642d55c3b915f -
Trigger Event:
push
-
Statement type: