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 receive 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 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

MemU v0.3.0 has been released! This version initializes the memorize and retrieve workflows with the new 3-layer architecture.

Starting from this release, MemU will roll out multiple features in the short- to mid-term:

Core capabilities iteration

  • Multi-modal enhancements – Support for images, audio, and video
  • 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
  • ……

Upcoming 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

🚀 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},
        embedding_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]")
    result_rag = await service_rag.retrieve(queries=queries)
    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},
        embedding_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)
    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())

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)

📄 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.7.0.tar.gz (3.2 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.7.0-cp313-abi3-win_amd64.whl (153.0 kB view details)

Uploaded CPython 3.13+Windows x86-64

memu_py-0.7.0-cp313-abi3-manylinux_2_39_x86_64.whl (291.9 kB view details)

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

memu_py-0.7.0-cp313-abi3-macosx_11_0_arm64.whl (259.2 kB view details)

Uploaded CPython 3.13+macOS 11.0+ ARM64

memu_py-0.7.0-cp313-abi3-macosx_10_12_x86_64.whl (262.0 kB view details)

Uploaded CPython 3.13+macOS 10.12+ x86-64

File details

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

File metadata

  • Download URL: memu_py-0.7.0.tar.gz
  • Upload date:
  • Size: 3.2 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.7.0.tar.gz
Algorithm Hash digest
SHA256 b3e3b04863e0fb6e3a2e18ec883b5659c2e9e817159673a01db2e414994243ed
MD5 b3aa7c7f817655663012d3e70f70851d
BLAKE2b-256 7a84dff96694a25317dd38d37e26fc6d9c0f538b3aaedbfde5405161f64b61b3

See more details on using hashes here.

Provenance

The following attestation bundles were made for memu_py-0.7.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.7.0-cp313-abi3-win_amd64.whl.

File metadata

  • Download URL: memu_py-0.7.0-cp313-abi3-win_amd64.whl
  • Upload date:
  • Size: 153.0 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.7.0-cp313-abi3-win_amd64.whl
Algorithm Hash digest
SHA256 7399a31c10e279a829557f1a8527f540531ed7ab3633a68ba76608f85b9f0109
MD5 aa838043b0cca97b7e9f2a4ebc75a997
BLAKE2b-256 fc880cab42fc64c3955e4fa7e2b72c4981069527fc275a387af7f4e8301d0169

See more details on using hashes here.

Provenance

The following attestation bundles were made for memu_py-0.7.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.7.0-cp313-abi3-manylinux_2_39_x86_64.whl.

File metadata

File hashes

Hashes for memu_py-0.7.0-cp313-abi3-manylinux_2_39_x86_64.whl
Algorithm Hash digest
SHA256 7b4e87a6ddd721d7b7386a83e3d8d3de0fc54dd88c6ba748a37d4a4e9218c427
MD5 1b5bfb312022d204fd12ca45b3a70a10
BLAKE2b-256 0b5bdaffc544f200ce6f8c793259932f3d7ada0c65f71e0fa0f23bf38dd0f71f

See more details on using hashes here.

Provenance

The following attestation bundles were made for memu_py-0.7.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.7.0-cp313-abi3-macosx_11_0_arm64.whl.

File metadata

File hashes

Hashes for memu_py-0.7.0-cp313-abi3-macosx_11_0_arm64.whl
Algorithm Hash digest
SHA256 af5fcb73be5c7f81ff59defd4e1e69484681429a60e1256fa648d76af6454c0b
MD5 cb4fb715b92acaf36a0251de1c16294e
BLAKE2b-256 d564024deb8a6677171683834a0357f55446b771c2a1228579dd4c7259473f8e

See more details on using hashes here.

Provenance

The following attestation bundles were made for memu_py-0.7.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.7.0-cp313-abi3-macosx_10_12_x86_64.whl.

File metadata

File hashes

Hashes for memu_py-0.7.0-cp313-abi3-macosx_10_12_x86_64.whl
Algorithm Hash digest
SHA256 8b0b655da9b5cc057bab5bb10006e78ffca563e2fb60ab6571b48757aff9c9b5
MD5 0c541db14f33ae15cf513cbe30080b53
BLAKE2b-256 4bffb63dd8521eacb811f5f2905b9c8b75f96de1efeeccff10806579e03004bd

See more details on using hashes here.

Provenance

The following attestation bundles were made for memu_py-0.7.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