MCPcopy
hub / github.com/NevaMind-AI/memU

github.com/NevaMind-AI/memU @v1.5.1 sqlite

repository ↗ · DeepWiki ↗ · release v1.5.1 ↗
862 symbols 3,441 edges 148 files 383 documented · 44%
README

MemU Banner

memU

24/7 Always-On Proactive Memory for AI Agents

PyPI version License: Apache 2.0 Python 3.13+ Discord Twitter

NevaMind-AI%2FmemU | Trendshift

English | 中文 | 日本語 | 한국어 | Español | Français


memU is a memory framework built for 24/7 proactive agents. It is designed for long-running use and greatly reduces the LLM token cost of keeping agents always online, making always-on, evolving agents practical in production systems. memU continuously captures and understands user intent. Even without a command, the agent can tell what you are about to do and act on it by itself.


🤖 OpenClaw (Moltbot, Clawdbot) Alternative

memU Bot — Now open source. The enterprise-ready OpenClaw. Your proactive AI assistant that remembers everything.

  • Download-and-use and simple to get started (one-click install, < 3 min).
  • Builds long-term memory to understand user intent and act proactively (24/7).
  • Cuts LLM token cost with smaller context (~1/10 of comparable usage).

Try now: memu.bot · Source: memUBot on GitHub


🗃️ Memory as File System, File System as Memory

memU treats memory like a file system—structured, hierarchical, and instantly accessible.

File System memU Memory
📁 Folders 🏷️ Categories (auto-organized topics)
📄 Files 🧠 Memory Items (extracted facts, preferences, skills)
🔗 Symlinks 🔄 Cross-references (related memories linked)
📂 Mount points 📥 Resources (conversations, documents, images)

Why this matters: - Navigate memories like browsing directories—drill down from broad categories to specific facts - Mount new knowledge instantly—conversations and documents become queryable memory - Cross-link everything—memories reference each other, building a connected knowledge graph - Persistent & portable—export, backup, and transfer memory like files

memory/
├── preferences/
│   ├── communication_style.md
│   └── topic_interests.md
├── relationships/
│   ├── contacts/
│   └── interaction_history/
├── knowledge/
│   ├── domain_expertise/
│   └── learned_skills/
└── context/
    ├── recent_conversations/
    └── pending_tasks/

Just as a file system turns raw bytes into organized data, memU transforms raw interactions into structured, searchable, proactive intelligence.


⭐️ Star the repository

If you find memU useful or interesting, a GitHub Star ⭐️ would be greatly appreciated.


✨ Core Features

Capability Description
🤖 24/7 Proactive Agent Always-on memory agent that works continuously in the background—never sleeps, never forgets
🎯 User Intention Capture Understands and remembers user goals, preferences, and context across sessions automatically
💰 Cost Efficient Reduces long-running token costs by caching insights and avoiding redundant LLM calls
---

🔄 How Proactive Memory Works


cd examples/proactive
python proactive.py


Proactive Memory Lifecycle

┌──────────────────────────────────────────────────────────────────────────────────────────────────┐
│                                         USER QUERY                                               │
└──────────────────────────────────────────────────────────────────────────────────────────────────┘
                 │                                                           │
                 ▼                                                           ▼
┌────────────────────────────────────────┐         ┌────────────────────────────────────────────────┐
│         🤖 MAIN AGENT                  │         │              🧠 MEMU BOT                       │
│                                        │         │                                                │
│  Handle user queries & execute tasks   │  ◄───►  │  Monitor, memorize & proactive intelligence   │
├────────────────────────────────────────┤         ├────────────────────────────────────────────────┤
│                                        │         │                                                │
│  ┌──────────────────────────────────┐  │         │  ┌──────────────────────────────────────────┐  │
│  │  1. RECEIVE USER INPUT           │  │         │  │  1. MONITOR INPUT/OUTPUT                 │  │
│  │     Parse query, understand      │  │   ───►  │  │     Observe agent interactions           │  │
│  │     context and intent           │  │         │  │     Track conversation flow              │  │
│  └──────────────────────────────────┘  │         │  └──────────────────────────────────────────┘  │
│                 │                      │         │                    │                           │
│                 ▼                      │         │                    ▼                           │
│  ┌──────────────────────────────────┐  │         │  ┌──────────────────────────────────────────┐  │
│  │  2. PLAN & EXECUTE               │  │         │  │  2. MEMORIZE & EXTRACT                   │  │
│  │     Break down tasks             │  │   ◄───  │  │     Store insights, facts, preferences   │  │
│  │     Call tools, retrieve data    │  │  inject │  │     Extract skills & knowledge           │  │
│  │     Generate responses           │  │  memory │  │     Update user profile                  │  │
│  └──────────────────────────────────┘  │         │  └──────────────────────────────────────────┘  │
│                 │                      │         │                    │                           │
│                 ▼                      │         │                    ▼                           │
│  ┌──────────────────────────────────┐  │         │  ┌──────────────────────────────────────────┐  │
│  │  3. RESPOND TO USER              │  │         │  │  3. PREDICT USER INTENT                  │  │
│  │     Deliver answer/result        │  │   ───►  │  │     Anticipate next steps                │  │
│  │     Continue conversation        │  │         │  │     Identify upcoming needs              │  │
│  └──────────────────────────────────┘  │         │  └──────────────────────────────────────────┘  │
│                 │                      │         │                    │                           │
│                 ▼                      │         │                    ▼                           │
│  ┌──────────────────────────────────┐  │         │  ┌──────────────────────────────────────────┐  │
│  │  4. LOOP                         │  │         │  │  4. RUN PROACTIVE TASKS                  │  │
│  │     Wait for next user input     │  │   ◄───  │  │     Pre-fetch relevant context           │  │
│  │     or proactive suggestions     │  │  suggest│  │     Prepare recommendations              │  │
│  └──────────────────────────────────┘  │         │  │     Update todolist autonomously         │  │
│                                        │         │  └──────────────────────────────────────────┘  │
└────────────────────────────────────────┘         └────────────────────────────────────────────────┘
                 │                                                           │
                 └───────────────────────────┬───────────────────────────────┘
                                             ▼
                              ┌──────────────────────────────┐
                              │     CONTINUOUS SYNC LOOP     │
                              │  Agent ◄──► MemU Bot ◄──► DB │
                              └──────────────────────────────┘

🎯 Proactive Use Cases

1. Information Recommendation

Agent monitors interests and proactively surfaces relevant content

# User has been researching AI topics
MemU tracks: reading history, saved articles, search queries

# When new content arrives:
Agent: "I found 3 new papers on RAG optimization that align with
        your recent research on retrieval systems. One author
        (Dr. Chen) you've cited before published yesterday."

# Proactive behaviors:
- Learns topic preferences from browsing patterns
- Tracks author/source credibility preferences
- Filters noise based on engagement history
- Times recommendations for optimal attention

2. Email Management

Agent learns communication patterns and handles routine correspondence

# MemU observes email patterns over time:
- Response templates for common scenarios
- Priority contacts and urgent keywords
- Scheduling preferences and availability
- Writing style and tone variations

# Proactive email assistance:
Agent: "You have 12 new emails. I've drafted responses for 3 routine
        requests and flagged 2 urgent items from your priority contacts.
        Should I also reschedule tomorrow's meeting based on the
        conflict John mentioned?"

# Autonomous actions:
✓ Draft context-aware replies
✓ Categorize and prioritize inbox
✓ Detect scheduling conflicts
✓ Summarize long threads with key decisions

3. Trading & Financial Monitoring

Agent tracks market context and user investment behavior

# MemU learns trading preferences:
- Risk tolerance from historical decisions
- Preferred sectors and asset classes
- Response patterns to market events
- Portfolio rebalancing triggers

# Proactive alerts:
Agent: "NVDA dropped 5% in after-hours trading. Based on your past
        behavior, you typically buy tech dips above 3%. Your current
        allocation allows for $2,000 additional exposure while
        maintaining your 70/30 equity-bond target."

# Continuous monitoring:
- Track price alerts tied to user-defined thresholds
- Correlate news events with portfolio impact
- Learn from executed vs. ignored recommendations
- Anticipate tax-loss harvesting opportunities

...


🗂️ Hierarchical Memory Architecture

MemU's three-layer system enables both reactive queries and proactive context loading:

structure

Layer Reactive Use Proactive Use
Resource Direct access to original data Background monitoring for new patterns
Item Targeted fact retrieval Real-time extraction from ongoing interactions
Category Summary-level overview Automatic context assembly for anticipation

Proactive Benefits: - Auto-categorization: New memories self-organize into topics - Pattern Detection: System identifies recurring themes - Context Prediction: Anticipates what information will be needed next


🚀 Quick Start

Option 1: Cloud Version

Experience proactive memory instantly:

👉 memu.so - Hosted service with 7×24 continuous learning

For enterprise deployment with custom proactive workflows, 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 continuous learning task
GET /api/v3/memory/memorize/status/{task_id} Check real-time processing status
POST /api/v3/memory/categories List auto-generated categories
POST /api/v3/memory/retrieve Query memory (supports proactive context loading)

📚 Full API Documentation


Option 2: Self-Hosted

Installation

pip install -e .

Basic Example

Requirements: Python 3.13+ and an OpenAI API key

Test Continuous Learning (in-memory):

export OPENAI_API_KEY=your_api_key
cd tests
python test_inmemory.py

Test with Persistent Storage (PostgreSQL):

# 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 continuous learning test
export OPENAI_API_KEY=your_api_key
cd tests
python test_postgres.py

Both examples demonstrate proactive memory workflows: 1. Continuous Ingestion: Process multiple files sequentially 2. Auto-Extraction: Immediate memory creation 3. Proactive Retrieval: Context-aware memory surfacing

See tests/test_inmemory.py and tests/test_postgres.py for implementation details.


Custom LLM and Embedding Providers

MemU supports custom LLM and embedding providers beyond OpenAI. Configure them via llm_profiles: ```python from memu import MemUService

service = MemUService( llm_profiles={ # Default profile for LLM operations "default": {

Core symbols most depended-on inside this repo

get
called by 429
src/memu/app/settings.py
items
called by 31
src/memu/app/settings.py
_get_llm_client
called by 27
src/memu/app/service.py
session
called by 25
src/memu/database/postgres/session.py
_escape_prompt_value
called by 25
src/memu/app/service.py
run
called by 20
src/memu/workflow/step.py
session
called by 19
src/memu/database/sqlite/session.py
embed
called by 17
src/memu/llm/wrapper.py

Shape

Method 557
Function 154
Class 143
Route 8

Languages

Python100%

Modules by API surface

src/memu/app/memorize.py61 symbols
src/memu/llm/wrapper.py55 symbols
src/memu/app/retrieve.py47 symbols
src/memu/app/crud.py36 symbols
src/memu/app/service.py33 symbols
src/memu/app/settings.py31 symbols
tests/test_references.py27 symbols
src/memu/llm/http_client.py23 symbols
tests/test_salience.py20 symbols
src/memu/workflow/interceptor.py19 symbols
src/memu/app/patch.py19 symbols
tests/test_tool_memory.py17 symbols

Dependencies from manifests, versioned

alembic1.14.0 · 1×
defusedxml0.7.1 · 1×
fastapi0.100.0 · 1×
httpx0.28.1 · 1×
langchain-core1.2.7 · 1×
lazyllm0.7.3 · 1×
memu0.1.0 · 1×
numpy2.3.4 · 1×
openai2.8.0 · 1×
pendulum3.1.0 · 1×
pydantic2.12.4 · 1×
python-dotenv1.0.0 · 1×

Datastores touched

memuDatabase · 1 repos

For agents

$ claude mcp add memU \
  -- python -m otcore.mcp_server <graph>

⬇ download graph artifact