TeleAI-UAGI/telemem

★ 492⑂ 0

TeleMem is a high-performance drop-in replacement for Mem0, featuring semantic deduplication, long-term dialogue memory, and multimodal video reasoning.

About TeleAI-UAGI/telemem

TeleAI-UAGI/telemem is an open-source project on GitHub, mainly written in Python. TeleMem is a high-performance drop-in replacement for Mem0, featuring semantic deduplication, long-term dialogue memory, and multimodal video reasoning. It currently holds 492 stars and 0 forks with 0 open issues, and was last pushed on an unknown date (repository created unknown).

Project Overview

AI Homed tracks it on the AI Agent Memory board.

GitHub Repository Details

Repository TeleAI-UAGI/telemem · default branch - · size 0 KB · watchers 0 · source: GitHub REST API and repository README

README

TeleMem: Building Long-Term and Multimodal Memory for Agentic AI

https://github.com/TeleAI-UAGI/telemem/blob/HEAD/arXiv https://github.com/TeleAI-UAGI/telemem/blob/HEAD/CI https://github.com/TeleAI-UAGI/telemem/blob/HEAD/PyPI https://github.com/TeleAI-UAGI/telemem/blob/HEAD/GitHub Stars https://github.com/TeleAI-UAGI/telemem/blob/HEAD/License: Apache 2.0 https://github.com/TeleAI-UAGI/telemem/blob/HEAD/Last Commit https://github.com/TeleAI-UAGI/telemem/blob/HEAD/PRs Welcome https://github.com/TeleAI-UAGI/telemem/blob/HEAD/MCPVault: verified

If you find this project helpful, please give us a ⭐️ on GitHub for the latest update.

_🤝 Contributions welcome! Feel free to open an issue or submit a pull request._

---

English | 简体中文

📄 Awesome-Agent-Memory →

TeleMem is an agent memory management layer that can be used as a high-performance drop-in replacement for Mem0 with one line of code (import telemem as mem0), deeply optimized for complex scenarios involving multi-turn dialogues, character modeling, long-term information storage, and semantic retrieval.

Through its unique context-aware enhancement mechanism, TeleMem provides conversational AI with core infrastructure offering higher accuracy, faster performance, and stronger character memory capabilities.

Building upon this foundation, TeleMem implements video understanding, multimodal reasoning, and visual question answering capabilities. Through a complete pipeline of video frame extraction, caption generation, and vector database construction, AI Agents can effortlessly store, retrieve, and reason over video content just like handling text memories.

The ultimate goal of the TeleMem project is to _use an agent's hindsight to improve its foresight_.

TeleMem, where memory lives on and intelligence grows strong.

Why TeleMem?

---

📢 Latest Updates

---

🔥 Research Highlights

---

📌 Table of Contents

---

Project Introduction

TeleMem enables conversational AI to maintain stable, natural, and continuous worldviews and character settings during long-term interactions through a deeply optimized pipeline of character-aware summarization → semantic clustering deduplication → efficient storage → precise retrieval.

flowchart LR
    A["Dialogue
messages"] --> B["Character-aware
summarization
(global + per-character)"] B --> C["Embedding +
similar-memory
retrieval"] C --> D["Write buffer
(batch flush)"] D --> E["LLM semantic
clustering & fusion"] E --> F[("FAISS index +
JSON metadata")] Q["Query"] --> S["Vector search
+ rerank"] F --> S S --> R["results"]

Features

Applicable Scenarios

  • Multi-character virtual agent systems
  • Long-memory AI assistants (e.g., customer service, companionship, creative co-pilots)
  • Complex narrative/world-building in virtual environments
  • Dialogue scenarios with strong contextual dependencies
  • Video content QA and reasoning
  • Multimodal agent memory management
  • Long video understanding and information retrieval
image

---

TeleMem vs Mem0: Core Advantages

TeleMem deeply refactors Mem0 to address characterization, long-term memory, and high performance. Key differences:

| Capability Dimension | Mem0 | TeleMem | | -------------------------- | --------------------------- | ------------------------------------------------------------ | | Multi-character separation | ❌ Not supported | ✅ Automatically creates independent memory profiles per character | | Summary quality | Basic summarization | ✅ Context-aware + character-focused prompts covering key entities, actions, and timestamps | | Deduplication mechanism | Vector similarity filtering | ✅ LLM-based semantic clustering: merges similar memories via LLM | | Write performance | Streaming, single writes | ✅ Batch flush + concurrency: 2–3× faster writes | | Storage format | SQLite / vector DB | ✅ FAISS + JSON metadata dual-write: fast retrieval + human-readable | | Multimodal Capability | Single image to text only | ✅ Video Multimodal Memory: Full video processing pipeline + ReAct multi-step reasoning QA | ---

Experimental Results

Dataset

We evaluate the ZH-4O Chinese long-character dialogue dataset constructed in the paper MOOM: Maintenance, Organization and Optimization of Memory in Ultra-Long Role-Playing Dialogues:

Memory capability was assessed via QA benchmarks, e.g.:

{
"question": "What is Zhao Qi's nickname for Bai Yulan? A Xiaobai B Xiaoyu C Lanlan D Yuyu",
"answer": "A"
},
{
"question": "What is the relationship between Zhao Qi and Bai Yulan? A Classmates B Teacher and student C Enemies D Neighbors",
"answer": "B"
}

Experimental Configuration

| Method | Overall(%) | |:--------------------------------------------------------- |:---------- | | RAG | 62.45 | | _Mem0_ | _70.20_ | | MOOM | 72.60 | | A-mem | 73.78 | | Memobase | 76.78 | |
TeleMem | 86.33 |

---

Quick Start

Installation

pip install telemem            # core (text memory)
pip install "telemem[mcp]"     # + MCP server
pip install "telemem[video]"   # + video/multimodal pipeline
pip install "telemem[all]"     # everything

Development Environment

Using uv (recommended — creates .venv from the committed uv.lock for a reproducible environment):

uv sync --all-extras   # install TeleMem (editable) + all extras, incl. MCP
uv run python examples/quickstart.py

Or with conda + pip:

# Create and activate virtual environment
conda create -n telemem python=3.10
conda activate telemem

Install from source (editable), with the extras you need

pip install -e ".[all]"

Example

Set your OpenAI API key:

export OPENAI_API_KEY="your-openai-api-key"

# python examples/quickstart.py
import telemem as mem0

memory = mem0.Memory()

messages = [ {"role": "user", "content": "Jordan, did you take the subway to work again today?"}, {"role": "assistant", "content": "Yes, James. The subway is much faster than driving. I leave at 7 o'clock and it's just not crowded."}, {"role": "user", "content": "Jordan, I want to try taking the subway too. Can you tell me which station is closest?"}, {"role": "assistant", "content": "Of course, James. You take Line 2 to Civic Center Station, exit from Exit A, and walk 5 minutes to the company."} ]

memory.add(messages=messages, user_id="Jordan") results = memory.search("What transportation did Jordan use to go to work today?", user_id="Jordan") for hit in results["results"]: # same result shape as mem0 print(hit["memory"])

Memory() uses the default provider settings inherited from mem0ai. To use the repository's local Qwen + FAISS configuration, load config/config.yaml explicitly:

from telemem.utils import load_config
import telemem as mem0

config = load_config("config/config.yaml") memory = mem0.Memory(config=config)

The runnable examples also honor the same configuration through TELEMEM_CONFIG:

TELEMEM_CONFIG=config/config.yaml python examples/quickstart.py

Using MiniMax as the LLM Provider

TeleMem supports MiniMax as an LLM backend via its OpenAI-compatible API. A ready-to-use example config is provided at config/config.minimax.yaml.

export MINIMAX_API_KEY="your-minimax-api-key"
export OPENAI_API_KEY="your-openai-api-key"  # still needed for embeddings
from telemem.utils import load_config
import telemem as mem0

config = load_config("config/config.minimax.yaml") memory = mem0.Memory(config=config)

Key points for MiniMax usage:

More LLM Providers

TeleMem works with any OpenAI-compatible endpoint. Ready-to-use config examples ship in config/:

| Provider | Config file | LLM | Embeddings | Notes | | -------- | ----------- | --- | ---------- | ----- | | Ollama (fully local) | config.ollama.yaml | any local model (e.g. qwen3:8b) | nomic-embed-text, local | No API key, no cloud — everything runs on your machine | | DeepSeek | config.deepseek.yaml | deepseek-chat / deepseek-reasoner | external (e.g. OpenAI) | DEEPSEEK_API_KEY + OPENAI_API_KEY | | Moonshot (Kimi) | config.moonshot.yaml | kimi-k2-0905-preview | external (e.g. OpenAI) | .cn and .ai endpoints supported | | MiniMax** | config.minimax.yaml | MiniMax-M3 | external (e.g. OpenAI) | see section above |

TELEMEM_CONFIG=config/config.ollama.yaml python examples/quickstart.py   # 100% local memory

---

Project Structure

Expand/Collapse Directory Structure
telemem/
├── assets/                 # Documentation assets and figures
├── baselines/              # Baseline implementations for comparative evaluation
│ ├── RAG                   # Retrieval-Augmented Generation baseline
│ ├── MemoBase              # MemoBase memory management system
│ ├── MOOM                  # MOOM dual-branch narrative memory framework
│ ├── A-mem                 # A-mem agent memory baseline
│ └── Mem0                  # Mem0 baseline implementation
├── config/               
│ ├── config.yaml           # TeleMem default configuration
│ └── config.minimax.yaml   # MiniMax provider example configuration
├── data/                   # Small sample datasets for evaluation or demonstration
├── examples/               # Code examples and tutorial demos
│ ├── quickstart.py         # Quick start
│ ├── quickstart_mm.py      # Quick start (multimodal)
│ ├── mcp_client.py         # Quick start over MCP (stdio client)
│ ├── mcp_config.json       # MCP config snippet for Claude Desktop / Cursor
│ └── deepseek-harness.cordis.yml # DeepSeek Harness memory patch
├── docs/
│ ├── MCP.md                # MCP server reference
│ └── TeleMem_Tech_Report.pdf
├── telemem/                # Telemem code
│ └── mcp/                  # Model Context Protocol server
├── tests/                  # Telemem test
├── README.md               # English README
├── README-ZH.md            # Chinese README
└── pyproject.toml          # Python environment

---

Core Functions

Add Memory (add)

The add() method injects one or more dialogue turns into the memory system.

def add(
 self,
 messages,
 *,
 user_id: Optional[str] = None,
 agent_id: Optional[str] = None,
 run_id: Optional[str] = None,
 metadata: Optional[Dict[str, Any]] = None,
 infer: bool = True,
 memory_type: Optional[str] = None,
 prompt: Optional[str] = None,
 batch: bool = False,
)

🔎 Parameter Description

| Parameter | Type | Required | Description | | ------------- | ------------------------------- | -------- | ------------------------------------------------------------ | | messages | str or List[Dict[str, str]] | ✅ Yes | A single statement, or a list of dialogue messages with role (user/assistant) and content | | user_id | Optional[str] | ❌ No | Character/user to attribute the memory to; TeleMem keeps an independent memory profile per user_id. Omit it to store shared conversation-event memories | | agent_id / run_id | Optional[str] | ❌ No | Additional mem0-compatible scopes (e.g. one run_id per session) | | metadata | Optional[Dict[str, Any]] | ❌ No | Arbitrary metadata stored with each memory | | infer | bool | ❌ No | Extract salient facts with the LLM (default: True); False stores message contents verbatim with no LLM call | | memory_type | Optional[str] | ❌ No | Pass "procedural_memory" to create procedural memories via mem0's pipeline; omit for conversational memories | | prompt | Optional[str] | ❌ No | Custom extraction prompt (replaces the optimized default as the system prompt) | | batch | bool | ❌ No | Route through the high-throughput batched pipeline (add_batch) |

Returns the mem0-compatible shape: {"results": [{"id": "...", "memory": "...", "event": "ADD"}, ...]}

🔁 Internal Workflow of add()

1. Message preprocessing: Merge consecutive messages from the same speaker; normalize turn structure. 2. Multi-perspective summarization:

3. Vectorization & similarity search: Generate embeddings and retrieve existing similar memories. 4. Batch processing: When buffer threshold is reached, invoke LLM to semantically merge similar memories. 5. Persistence: Dual-write to FAISS (for retrieval) and JSON (for metadata).

🎭 Multi-character demo: examples/multi_npc.py runs five tavern
NPCs through one scene — a single add_batch(scene, user_id=[...]) call gives each NPC a
private memory profile plus a shared "events" world-state, and each NPC then recalls the
scene from their own perspective.

---

Search Memory (search)

Performs semantic vector-based retrieval of relevant memories with context-aware recall.

def search(
 self,
 query: str,
 *,
 user_id: Optional[str] = None,
 agent_id: Optional[str] = None,
 run_id: Optional[str] = None,
 limit: int = 100,
 filters: Optional[Dict[str, Any]] = None,
 threshold: Optional[float] = None,
 rerank: bool = True,
)

🔎 Parameter Description

| Parameter | Type | Required | Description | | ----------- | ------------------ | -------- | ------------------------------------------------- | | query | str | ✅ Yes | Natural language query | | user_id | Optional[str] | ❌ No | Character/user profile to search. The shared event memories (pseudo-user "events") are always searched as well | | agent_id / run_id | Optional[str] | ❌ No | Additional mem0-compatible scope filters | | limit | int | ❌ No | Max number of results (default: 100) | | threshold | Optional[float] | ❌ No | Similarity threshold (0–1; auto-tuned if omitted) | | filters | Dict[str, Any] | ❌ No | Custom filters (e.g., by character, time range) | | rerank | bool | ❌ No | Whether to rerank results (default: True) |

Returns the mem0-compatible shape: {"results": [{"id": "...", "memory": "...", "score": ..., ...}, ...]}

🔍 Search is based on FAISS vector retrieval, supporting millisecond-level responses.

---

Multimodal Extensions

Beyond text memory, TeleMem further extends multimodal capabilities. Drawing inspiration from Deep Video Discovery's Agentic Search and Tool Use approach, we implemented two core methods in the TeleMemory class to support intelligent storage and semantic retrieval of video content.

| Method | Description | |------|----------| | add_mm() | Process video into retrievable memory (frame extraction → caption generation → vector database) | | search_mm() | Query video content using natural language, supporting ReAct-style multi-step reasoning |

Add Multimodal Memory (add_

GitHub Stars & Activity

492Stars
0Forks
0Open issues
PythonLanguage

GitHub Popularity

GitHub stars492
Forks0
Open issues0
Primary languagePython
License-
Stars gained today0
Created-
Last pushed-

Trending History

Trending statusnot on today's boards

Related AI Projects

1

mem0ai / mem0

Python★ 65,719⑂ 0
2

volcengine / OpenViking

Python★ 38,212⑂ 0
3

topoteretes / cognee

Python★ 30,864⑂ 0
4

MemoriLabs / Memori

Python★ 16,866⑂ 0
5

NevaMind-AI / memU

Python★ 14,418⑂ 0
6

EverMind-AI / EverOS

Python★ 13,094⑂ 0
7

plastic-labs / honcho

Python★ 7,274⑂ 0
8

FlowElement-xinliuyuansu / m_flow

Python★ 4,507⑂ 0

More AI Rankings