Skip to main content

AI Memory and Conversation Management Framework - Simple as mem0, Powerful as MemU

Project description

MemU Banner

MemU: A Future-Oriented Agentic Memory System

PyPI version License: Apache 2.0 Python 3.8+ Discord Twitter

MemU is an agentic memory framework for LLM and AI agent backends. It receives multi-modal inputs, extracts them into memory items, and then organizes and summarizes these items into structured memory files.

Unlike traditional RAG systems that rely solely on embedding-based search, MemU supports non-embedding retrieval through direct file reading. The LLM comprehends natural language memory files directly, enabling deep search by progressively tracking from categories → items → original resources.

MemU is commonly used in scenarios where memory matters:

  • Capture user behavior and context to build user profiles
  • Track agent successes and failures for self-improvement
  • Integrate multi-source data for knowledge management
  • Enable personalized recommendations with deep memory

MemU offers several convenient ways to get started right away:

⭐ Star Us on GitHub

Star MemU to get notified about new releases and join our growing community of AI developers building intelligent agents with persistent memory capabilities.

star-us

💬 Join our Discord community: https://discord.gg/memu


Roadmap

The current version initializes the memorize and retrieve workflows with the new 3-layer architecture. More features are coming soon as we continue to expand MemU's capabilities.

Core capabilities iteration

  • Multi-modal enhancements – Support for images, audio, and video
  • User model and user context store
  • Intention – Higher-level decision-making and goal management
  • Multi-client support – Switch between OpenAI, Deepseek, Gemini, etc.
  • Data persistence expansion – Support for Postgres, S3, DynamoDB
  • Benchmark tools – Test agent performance and memory efficiency
  • ……

New open-source repositories

  • memU-ui – The web frontend for MemU, providing developers with an intuitive and visual interface
  • memU-server – Powers memU-ui with reliable data support, ensuring efficient reading, writing, and maintenance of agent memories

🧩 Why MemU?

Most memory systems in current LLM pipelines rely heavily on explicit modeling, requiring manual definition and annotation of memory categories. This limits AI’s ability to truly understand memory and makes it difficult to support diverse usage scenarios.

MemU offers a flexible and robust alternative, inspired by hierarchical storage architecture in computer systems. It progressively transforms heterogeneous input data into queryable and interpretable textual memory.

Its core architecture consists of three layers: Resource Layer → Memory Item Layer → MemoryCategory Layer.

Three-Layer Architecture Diagram
  • Resource Layer: Multimodal raw data warehouse
  • Memory Item Layer: Discrete extracted memory units
  • MemoryCategory Layer: Aggregated textual memory units

Key Features:

  • Full Traceability: Track from raw data → items → documents and back
  • Memory Lifecycle: Memorization → Retrieval → Self-evolution
  • Two Retrieval Methods:
    • RAG-based: Fast embedding vector search
    • LLM-based: Direct file reading with deep semantic understanding
  • Self-Evolving: Adapts memory structure based on usage patterns
process

Performance Excellence in Locomo Tests:

MemU achieves 92.09% average accuracy in the Locomo dataset across all reasoning tasks, significantly outperforming competitors. View Detailed Experimental Data:https://github.com/NevaMind-AI/memU-experiment

benchmark

MemU Repositories: What They Do & How to Use

memU memU-server memU-ui
Positioning Core algorithm engine Memory data backend service Front-end dashboard
Key Features - Core algorithms
- Memory extraction
- Multi-strategy retrieval
- Memory CRUD
- Retrieve record tracking
- Token usage & billing tracking
- User system
- RBAC permission system
- Security boundary controls
- Front-end interface
- Visual memory viewer
- User management UI
- Data retrieval UI
- Easy self-hosting experience
Best For Developers/teams who want to embed AI memory algorithms into their product Teams that want to self-host a memory backend (internal tools, research, enterprise setups) Developers/teams looking for a ready-to-use memory console
Usage Core algorithms can be used standalone or integrated into server Self-hostable; works together with memU Self-hostable; integrates with memU

Summary: memU, memU-server, and memU-ui together form a flexible memory ecosystem for LLMs and AI agents.

🚀 Get Started

Installation

pip install memu-py

Quick Example

⚠️ Important: Ensure you have Python 3.14+

⚠️ Important: Replace "your-openai-api-key" with your actual OpenAI API key to use the service.

from memu.app import MemoryService
import os

async def main():
    api_key = "your-openai-api-key"
    file_path = os.path.abspath("path/to/memU/tests/example/example_conversation.json")

    # Initialize service with RAG method
    service_rag = MemoryService(
        llm_config={"api_key": api_key},
        retrieve_config={"method": "rag"}
    )

    # Memorize
    memory = await service_rag.memorize(resource_url=file_path, modality="conversation")
    for cat in memory.get('categories', []):
        print(f"  - {cat.get('name')}: {(cat.get('summary') or '')[:80]}...")

    queries = [
        {"role": "user", "content": {"text": "Tell me about preferences"}},
        {"role": "user", "content": {"text": "What are their habits?"}}
    ]

    # RAG-based retrieval
    print("\n[RETRIEVED - RAG]")
    # Scope retrieval to a particular user; omit filters to fetch across scopes
    result_rag = await service_rag.retrieve(queries=queries, user_id="123")
    for item in result_rag.get('items', [])[:3]:
        print(f"  - [{item.get('memory_type')}] {item.get('summary', '')[:100]}...")

    # Initialize service with LLM method (reuse same memory store)
    service_llm = MemoryService(
        llm_config={"api_key": api_key},
        retrieve_config={"method": "llm"}
    )
    service_llm.store = service_rag.store  # Reuse memory store

    # LLM-based retrieval
    print("\n[RETRIEVED - LLM]")
    result_llm = await service_llm.retrieve(queries=queries, agent_id__in=["1", "2"])
    for item in result_llm.get('items', [])[:3]:
        print(f"  - [{item.get('memory_type')}] {item.get('summary', '')[:100]}...")

if __name__ == "__main__":
    import asyncio
    asyncio.run(main())

retrieve accepts keyword scope filters that match the fields on your configured user_config.model (e.g., user_id="123" or agent_id__in=["1", "2"]). Leave filters off to fetch across scopes.

Retrieval Methods

RAG-based (method="rag"): Fast embedding vector search for large-scale data

LLM-based (method="llm"): Deep semantic understanding through direct file reading

Both support:

  • Context-aware rewriting: Resolves pronouns using conversation history
  • Progressive search: Categories → Items → Resources
  • Next-step suggestions: Iterative multi-turn retrieval

💡 Use Cases

MemU provides practical examples demonstrating different memory extraction and organization scenarios. Each example showcases a specific use case with real-world applications.

Use Case 1: Conversation Memory Processing

Extract and organize memory from multi-turn conversations. Perfect for:

  • Personal AI assistants that remember user preferences and history
  • Customer support bots maintaining conversation context
  • Social chatbots building user profiles over time

Example: Process multiple conversation files and automatically categorize memories into personal_info, preferences, work_life, relationships, etc.

export OPENAI_API_KEY=your_api_key
python examples/example_1_conversation_memory.py

What it does:

  • Processes conversation JSON files
  • Extracts memory items (preferences, habits, opinions)
  • Organizes into structured categories
  • Generates readable markdown files for each category

Use Case 2: Skill Extraction from Logs

Extract skills and lessons learned from agent execution logs. Ideal for:

  • DevOps teams learning from deployment experiences
  • Agent systems improving through iterative execution
  • Knowledge management from operational logs

Example: Process deployment logs incrementally, learning from each attempt to build a comprehensive skill guide.

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 → log_3.md → skill.md)

Key Feature: Shows MemU's core strength - continuous memory updates. Each file updates existing memory, and category summaries evolve progressively.

Use Case 3: Multimodal Memory Processing

Process diverse content types (documents, images, videos) into unified memory. Great for:

  • Documentation systems processing mixed media
  • Learning platforms combining text and visual content
  • Research tools analyzing multimodal data

Example: Process technical documents and architecture diagrams together, creating unified memory categories.

export OPENAI_API_KEY=your_api_key
python examples/example_3_multimodal_memory.py

What it does:

  • Processes multiple modalities (text documents, images)
  • Extracts memory from different content types
  • Unifies memories into cross-modal categories
  • Creates organized documentation (technical_documentation, architecture_concepts, code_examples, visual_diagrams)

Memory in Action

Build an end-to-end, real-time voice assistant with long-term memory using MemU and the TEN Framework multi-modal conversational AI framework. Tutorial: https://memu.pro/blog/build-real-time-voice-agent 1

Build a long-term memory Q&A assistant in just 20 lines of code using MemU and the all-in-one multi-agent framework LazyLLM. Tutorial: https://ai.feishu.cn/wiki/By6IwM7Kfinyf0kbM1xcrrcfnnd

lazy memu_副本

📄 License

By contributing to MemU, you agree that your contributions will be licensed under the Apache License 2.0.


🌍 Community

For more information please contact info@nevamind.ai

  • GitHub Issues: Report bugs, request features, and track development. Submit an issue

  • Discord: Get real-time support, chat with the community, and stay updated. Join us

  • X (Twitter): Follow for updates, AI insights, and key announcements. Follow us


🤝 Ecosystem

We're proud to work with amazing organizations:

Development Tools

Ten OpenAgents Ten xRoute jazz buddie bytebase LazyLLM


Interested in partnering with MemU? Contact us at contact@nevamind.ai

Project details


Download files

Download the file for your platform. If you're not sure which to choose, learn more about installing packages.

Source Distribution

memu_py-0.8.0.tar.gz (3.3 MB view details)

Uploaded Source

Built Distributions

If you're not sure about the file name format, learn more about wheel file names.

memu_py-0.8.0-cp313-abi3-win_amd64.whl (190.8 kB view details)

Uploaded CPython 3.13+Windows x86-64

memu_py-0.8.0-cp313-abi3-manylinux_2_39_x86_64.whl (327.9 kB view details)

Uploaded CPython 3.13+manylinux: glibc 2.39+ x86-64

memu_py-0.8.0-cp313-abi3-macosx_11_0_arm64.whl (296.8 kB view details)

Uploaded CPython 3.13+macOS 11.0+ ARM64

memu_py-0.8.0-cp313-abi3-macosx_10_12_x86_64.whl (299.3 kB view details)

Uploaded CPython 3.13+macOS 10.12+ x86-64

File details

Details for the file memu_py-0.8.0.tar.gz.

File metadata

  • Download URL: memu_py-0.8.0.tar.gz
  • Upload date:
  • Size: 3.3 MB
  • Tags: Source
  • Uploaded using Trusted Publishing? Yes
  • Uploaded via: twine/6.1.0 CPython/3.13.7

File hashes

Hashes for memu_py-0.8.0.tar.gz
Algorithm Hash digest
SHA256 d1472d8482cc3c02964f622d096aceb9c6f0f22850cbe27b856dcc6982748593
MD5 a05c22f7420aff2eec46eab732efe564
BLAKE2b-256 8a6c84d5c51374f2789bc9d451f0f893cc93d3589ed1658b408de3ce841b6f1f

See more details on using hashes here.

Provenance

The following attestation bundles were made for memu_py-0.8.0.tar.gz:

Publisher: release-please.yml on NevaMind-AI/memU

Attestations: Values shown here reflect the state when the release was signed and may no longer be current.

File details

Details for the file memu_py-0.8.0-cp313-abi3-win_amd64.whl.

File metadata

  • Download URL: memu_py-0.8.0-cp313-abi3-win_amd64.whl
  • Upload date:
  • Size: 190.8 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

Hashes for memu_py-0.8.0-cp313-abi3-win_amd64.whl
Algorithm Hash digest
SHA256 ed5e02ebe4cfcff19b38ae568cd0ca0c2064f6ab1104bc6e9ff0e08c438f4982
MD5 c653f4ff1a6b44e0b6f3530381d34f61
BLAKE2b-256 ea313bac5bc0eb45277c02222dd0d503f940bf4c4f7aa38cb0e5bfe3c47a2dfe

See more details on using hashes here.

Provenance

The following attestation bundles were made for memu_py-0.8.0-cp313-abi3-win_amd64.whl:

Publisher: release-please.yml on NevaMind-AI/memU

Attestations: Values shown here reflect the state when the release was signed and may no longer be current.

File details

Details for the file memu_py-0.8.0-cp313-abi3-manylinux_2_39_x86_64.whl.

File metadata

File hashes

Hashes for memu_py-0.8.0-cp313-abi3-manylinux_2_39_x86_64.whl
Algorithm Hash digest
SHA256 99ac221eaf74a1390d135b9cae9f2300259545c2e551899cebdb6d42e67aaee8
MD5 7d4a98f9fa7006cf9f6c005c34ad8ca0
BLAKE2b-256 9cebfae54e0d3bdbe5abdda5b3dd3051e75ea69e54be3cd1ee1c00f302bc9f34

See more details on using hashes here.

Provenance

The following attestation bundles were made for memu_py-0.8.0-cp313-abi3-manylinux_2_39_x86_64.whl:

Publisher: release-please.yml on NevaMind-AI/memU

Attestations: Values shown here reflect the state when the release was signed and may no longer be current.

File details

Details for the file memu_py-0.8.0-cp313-abi3-macosx_11_0_arm64.whl.

File metadata

File hashes

Hashes for memu_py-0.8.0-cp313-abi3-macosx_11_0_arm64.whl
Algorithm Hash digest
SHA256 dbd9b7a20b9d92dc4e9e9e74a1efacf421c7ad4e651ce20646efcc69726ce7d7
MD5 7e9bd7625558c3b0d922b747e1eb3f6a
BLAKE2b-256 dd61e94df0be10ba460b2133a6a331e999ade1d801185070cc69e2ded02c0e9b

See more details on using hashes here.

Provenance

The following attestation bundles were made for memu_py-0.8.0-cp313-abi3-macosx_11_0_arm64.whl:

Publisher: release-please.yml on NevaMind-AI/memU

Attestations: Values shown here reflect the state when the release was signed and may no longer be current.

File details

Details for the file memu_py-0.8.0-cp313-abi3-macosx_10_12_x86_64.whl.

File metadata

File hashes

Hashes for memu_py-0.8.0-cp313-abi3-macosx_10_12_x86_64.whl
Algorithm Hash digest
SHA256 66fe3b7d59579462cd7ceedefdb0f43730c3611b744928e1f49adc5b88fd8d20
MD5 2773aa71273572c863c6c7c1f7333c3a
BLAKE2b-256 1c740dfc9bad309f4021bcf4bec8af674b17af2d399faac60409e29bcf66dda5

See more details on using hashes here.

Provenance

The following attestation bundles were made for memu_py-0.8.0-cp313-abi3-macosx_10_12_x86_64.whl:

Publisher: release-please.yml on NevaMind-AI/memU

Attestations: Values shown here reflect the state when the release was signed and may no longer be current.

Supported by

AWS Cloud computing and Security Sponsor Datadog Monitoring Depot Continuous Integration Fastly CDN Google Download Analytics Pingdom Monitoring Sentry Error logging StatusPage Status page