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