一个可复现的长时记忆问答框架,在生成答案前将检索到的证据组织成结构化分类账,以改善跨会话推理。

Stars

430

7 天增长

暂无数据

Fork 数

45

开放 Issue

2

开源协议

MIT

最近更新

2026-07-28

AI 仓库情报摘要
FR-AI / ANALYSIS

为什么值得关注

它在检索与生成之间引入了一个新颖的证据组织步骤(分类账),并为 OpenAI 客户端提供了一键自动记忆封装,附带可视化演示和基准案例回放。

适合谁使用

  • 研究大语言模型长时记忆的研究人员
  • 在应用中集成持久记忆的开发者
  • 评估结构化推理流水线的 AI 工程师

典型使用场景

  • 构建具有持久多会话用户记忆的聊天机器人
  • 对记忆增强推理进行可重复实验
  • 在 LongMemEval 基准上评估问答
  • 为现有兼容 OpenAI 的应用添加自动记忆保留/召回功能

项目优势

  • 清晰的端到端流水线:Retain → Recall → Organize → Answer → Judge
  • 通过 wrap_openai() 一键集成自动记忆,同时支持 Responses 和 Chat Completions API
  • 可视化演示(记忆流水线和基准案例回放)直观展示证据组织过程
  • 提供分类账(ledger)和自进化(self-evolution)两种模式,便于对比研究结构化证据的效果

使用前须知

  • 需要支持 pgvector 的 PostgreSQL 数据库
  • 依赖兼容 OpenAI 的 API 用于大语言模型和嵌入模型
  • 并非独立记忆系统,而是研究框架,部署配置有一定的复杂度
  • 论文尚未发表(arXiv 标记为“即将发布”)

README 快速开始

Structured Memory Intelligence for Reliable Long-Horizon Reasoning

ShadowWeave Team

  

English · 中文


Overview

The Holographic Memory System (HMS) is a structured long-term memory layer for AI applications. It retains conversations and documents, extracts durable facts, links related entities and events, and recalls relevant context for later model calls.

HMS is designed for applications that need memory across sessions without placing an entire conversation history into every prompt.

One-Command Automatic Memory

HMS can wrap an existing OpenAI client so each model call automatically:

user input -> recall relevant memories -> inject context -> call the LLM
           -> retain the completed user/assistant exchange

Configure the model Base URL, API key, and model in .env, then run:

bash scripts/run_memory_demo.sh

The script starts PostgreSQL and HMS locally, waits for the memory API, installs the local SDK adapter in an isolated environment, and runs a two-turn demo. The first turn stores a user preference and project; the second turn recalls both without manually calling retain() or recall().

The application-side integration is one wrapper call:

from openai import OpenAI
from hms_litellm import wrap_openai

client = wrap_openai(
    OpenAI(),
    hms_api_url="http://127.0.0.1:18080",
    api_key="YOUR_HMS_API_KEY",
    bank_id="user-alice",
)

response = client.responses.create(
    model="gpt-4o-mini",
    input="What do you remember about my current project?",
)

wrap_openai() supports both client.responses.create(...) and client.chat.completions.create(...), including streaming. Use a stable, per-user bank_id; optionally set session_id to accumulate one conversation as a tracked HMS document.

Opt-in Image and Video Memory

The dataplane includes an opt-in openai_multimodal file parser. Images are validated and normalized locally; videos are decoded locally into a bounded, deterministic frame set. The visual description is rendered as grounded canonical Markdown and then enters the existing document, chunk, embedding, link, and recall pipeline. Raw video is never sent to the description provider.

The feature is disabled by default. Its current runtime support matrix is PostgreSQL; enabling the media path

相关仓库与替代方案

根据分类、Topic 和编程语言匹配的相似项目。

lopopolo
精选
lopopolo GitHub avatar

harness-engineering

Harness Engineering is a methodology for improving coding agent outputs by carefully crafting the environment around them—providing curated context, tools, and executable constraints that encode an organization’s nonfunctional requirements and cumulative lessons.

AI 与机器学习AI 智能体
2,390
slvDev
精选
slvDev GitHub avatar

esp32-ai

A 28.9 million parameter language model runs on an $8 ESP32-S3 microcontroller entirely on-device, generating simple stories at about 9.5 tokens per second.

AI 与机器学习大语言模型
1,960
littledivy
精选
littledivy GitHub avatar

mimic

mimic captures traffic from any iOS or web app and automatically generates a Python client library that lets you call the app's API like a regular library.

AI 与机器学习
1,482