SMRITI Memory

io.github.shivamtyagi18由 GitHub 帳號 shivamtyagi18 發布v1.4.17更新於 Oct 24, 2026

Neuro-inspired long-term memory for AI agents with semantic graph and consolidation.

發布方自己的服務:Memory.fit

已驗證STDIO僅桌面知識與記憶AI 與機器學習

概覽

AI 產生的概覽

為 AI 代理提供本機長期記憶的引擎,透過 MCP 在語意圖譜中儲存、檢索並整併記憶。

可以做什麼
  • 編碼、檢索與固定記憶,並把目前的工作記憶槽注入上下文
  • 檢查對某主題的後設記憶信心度並列出知識缺口
  • 遺忘或封存記憶、觸發背景整併、讀取系統統計
  • 建立彼此隔離的私人房間,並把記憶圖譜匯出到 Obsidian 儲存庫
  • 在瀏覽器中開啟本機視覺化圖譜瀏覽器
  • 提供 AMP v1.0 別名工具以相容 Agent Memory Protocol 用戶端
適用情境
適合需要助理跨工作階段、跨多個編碼代理記住事實、偏好或專案背景的情況,也適合想以本機、重視隱私的方式,取代把原始歷史塞進上下文視窗的做法。
執行需求
以本機 stdio 程序執行,需從 smriti-memcore 這個 PyPI 套件安裝,因此需要 Python 與 pip。背景整併依賴 LLM:README 建議在本機執行 Ollama 模型,或在 Python SDK 設定中提供 OpenAI API 金鑰。選用元件包括用於加速向量檢索的 FAISS,以及用於匯出的 Obsidian 儲存庫。
安裝前請注意
記憶會寫入本機儲存,助理可以軟刪除或封存記憶,背景整併還會改寫並衰減記憶。若設定 OpenAI 等雲端 LLM,記憶內容會傳送給該服務商;使用本機 Ollama 模型則資料留在本機。README 也提到會安裝 git post-commit 鉤子並在儲存庫中產生規則檔案,這會改動專案檔案。

安裝

在 SourceWeft 中

  1. 開啟 儀表板中的 SMRITI Memory,將其新增到工作區。
  2. 為需要使用其工具的對話啟用該服務。

Desktop only,透過 STDIO。 STDIO 服務會啟動本機處理程序,因此需要 SourceWeft 桌面主機。

其他 MCP 客戶端

參照 儲存庫 中的啟動說明。

README

SMRITI Memcore

Enterprise-grade, privacy-first Long-Term Memory (LTM) engine for LLM agents, multi-agent frameworks, and MCP clients.

www.smriti-memcore.com

[PyPI] [Python 3.9+] [License: MIT] [Website] [SMRITI Memory MCP server]

[SMRITI Memory Browser & Graph Explorer Demo]

Interactive Semantic Palace Graph Browser (smriti ui) — Category Room hub clustering, neural synaptic particle flow, and real-time dual inspector. Watch Full-Res Video


What is SMRITI?

SMRITI is a high-performance, neuro-inspired long-term memory layer designed to give AI agents persistent, adaptive recall without blocking their real-time execution loop.

Inspired by human Dual-Process cognitive theory, SMRITI splits memory operations into:

  1. System 1 (Immediate Heuristics): Decoupled, millisecond-level ingestion of raw interactions into an append-only Episode Buffer.
  2. System 2 (Async Consolidation): Background LLM-driven consolidation that extracts knowledge graphs, resolves contradictions, identifies skills, and decays weak memories.

SMRITI vs. Naive RAG & Vector Databases

FeatureNaive RAG / Vector DBsSMRITI Memory Engine
LatencyScales linearly with context size; blocks agent loopsSub-5ms ingestion (System 1); System 2 is asynchronous
Context WindowStuffs raw logs, leading to prompt bloat and distractionMiller's Law (7 ± 2 slots) capacity-bounded Working Memory
Data EvolutionStatic embeddings; struggles with contradictions/correctionsAutomatic conflict resolution, abstraction, and temporal decay
RelationshipsFlat vector search; no concept of entity linksSemantic Palace Graph showing structured Room/Topic associations
Privacy & SyncAll-or-nothing storage; complex namespace routingPrivate Rooms and private=True tags natively isolating user syncs

Key Capabilities

  • Dual-Process Performance: Zero-blocking real-time loops. Write immediately, analyze when idle.
  • Persona Palaces & On-Demand Hub: Download pre-curated cognitive memory palaces for historical figures (e.g., Albert Einstein, Isaac Newton) and converse with them with authentic mental models.
  • Privacy-First (Private Rooms): Create local semantic rooms whose memories are automatically excluded from shared/team-wide sync.
  • Model Context Protocol (MCP): Native MCP server integration with Claude Code, Claude Desktop, Gemini Antigravity, and Codex.
  • AMP v1.0 Spec Compliant: Drop-in compatibility with any agent framework conforming to the Agent Memory Protocol.
  • Visual Graph Explorer: Clean D3.js-based visualization interface with Prometheus metrics monitoring.
  • Obsidian Vault Integration: Automatically syncs your agent's memory graph into an Obsidian vault for human curation.
  • Framework Agnostic: Integrates natively with LangChain, LlamaIndex, CrewAI, and AutoGen.

Core Architecture

text
                           ┌─────────────────────────────────┐                           │    Asynchronous Consolidation   │                           │      (8 Background Processes)   │                           │  • Chunking      • Cross-Ref.   │                           │  • Conflict Res. • Skill Ext.   │                           │  • Forgetting    • Spaced Rep.  │                           │  • Reflection    • Defragment.  │                           └────────────────┬────────────────┘                                            │ background  ┌──────────┐   ┌──────────┐   ┌───────────▼─────────┐   ┌──────────┐  │  Input   │──▶│ Attention │──▶│   Episode Buffer    │──▶│ Semantic │  │  Text    │   │   Gate    │   │  (append-only log)  │   │  Palace  │  │  └───────┘   │ (salience │   └─────────────────────┘   │  Graph   │  │              │  filter)  │                              │ G=(V,E)  │  └──────────┘   └──────────┘                              └────┬─────┘                                                                │  ┌──────────┐   ┌──────────┐   ┌───────────────────┐           │  │  Query   │──▶│ Retrieval│──▶│  Working Memory   │◀──────────┘  │          │   │  Engine  │   │   (7 ± 2 slots)   │  └──────────┘   │ Q(v) =   │   └───────────────────┘                 │ β₁cos +  │                 │ β₂decay+ │   ┌───────────────────┐                 │ β₃freq + │──▶│    Meta-Memory    │                 │ β₄sal    │   │ (confidence map)  │                 └──────────┘   └───────────────────┘

Quick Start

1. Install SMRITI

Install the core memory engine and CLI:

bash
pip install smriti-memcore

(Optional: Ensure Ollama is running locally for 100% private, free LLM inference: ollama run mistral)


2. Instructions for Professors & Course Creators: Package Your Curriculum

Turn your raw lecture folder into a self-contained, offline-first Cognitive Palace Bundle (.smritibundle) that acts as a 24/7 Socratic Teaching Assistant for your students.

bash
# Package a folder of slides, transcripts, readings, or notebooks into an offline bundle:smriti pack ./my-course-folder -o cs101.smritibundle
# Or package directly from a declarative YAML/JSON persona spec:smriti pack ./course-spec.yaml -o cs101.smritibundle --install
  • Supported Formats: PDF slides, WebVTT/SRT video lecture transcripts, Markdown, plain text, and Jupyter notebooks (.ipynb).
  • Zero Cloud Costs: All vector embeddings are calculated locally ($0 OpenAI/HuggingFace API bills).
  • Lightweight Distribution: Generates a self-contained archive (typically 5–15 MB) containing the vector index, full-text search, and semantic graph. Upload it directly to Canvas, Blackboard, Piazza, Google Drive, or email it to students.

3. Instructions for Students: 24/7 Socratic Office Hours

Students download the professor's .smritibundle and converse with an interactive course mentor directly in their terminal—100% offline, private, and subscription-free.

bash
# Step 1: Import the course bundle provided by your professorsmriti pull ./cs101.smritibundle
# Step 2: Start your 24/7 Socratic Office Hourssmriti chat cs101
# (Optional) Use a specific local Ollama model (e.g. Mistral, Qwen, Llama)smriti chat cs101 --model mistralsmriti chat cs101 --model qwen3.5
  • Pinpoint Attribution: Asks about any concept and surfaces exact slide page numbers and video lecture transcript quotes.
  • Socratic Pedagogy: Rather than simply giving away homework answers, the course persona guides students step-by-step from first principles using course analogies.
  • 100% Local & Private: All conversations stay on the student's laptop—zero student data is sent to external servers.
Pre-Curated Mentors in Official Registry

You can also explore out-of-the-box mentors right away:

bash
# List all available mentors and locally installed bundlessmriti list
# Socratic Distributed Systems Professor (Raft, Paxos, CAP theorem)smriti chat prof-systems
# 100% Private, Local CBT & Mindfulness Companionsmriti chat mindful-counsellor
# Historical Thinkerssmriti chat einsteinsmriti chat newtonsmriti chat marcus-aurelius

4. Smriti DevBrain: Universal Developer Memory (Cursor, Claude, Windsurf, Gemini, Zed)

SMRITI solves cross-agent amnesia by acting as a shared, local cognitive brain across all your AI coding tools. A bug solved in Claude Code or Gemini is immediately remembered by Cursor.

Step 1: Auto-Configure All Installed IDEs & Agents

Run one command to scan and configure Cursor, Claude Code, Windsurf, Gemini, and Zed in seconds:

bash
smriti install

(Or target specific tools: smriti install --client cursor,windsurf)

Step 2: Initialize a Codebase Workspace

Inside any repository, run:

bash
smriti init

This automatically:

  • Creates a dedicated Semantic Room in the Palace for the project (repo:<name>).
  • Scaffolds .cursorrules, .cursor/rules/smriti.mdc, CLAUDE.md, and project .cursor/mcp.json.
  • Installs a lightweight, non-blocking git post-commit hook that records recent commits and architectural changes into memory.
Git Commit Memory Hook Management:
bash
smriti hook install    # Enable automatic commit context loggingsmriti hook uninstall  # Remove the post-commit hook

3. Python SDK

For application developers building custom agent loops.

bash
pip install smriti-memcore[faiss] # FAISS is recommended for accelerated vector search
python
from smriti import SMRITI, SmritiConfig
# Initialize memory engine with OpenAIconfig = SmritiConfig(    storage_path="./my_agent_memory",    llm_model="gpt-4o",    openai_api_key="your-api-key-here")memory = SMRITI(config=config)
# Ingest observationsmemory.encode("User prefers using PyTorch for neural networks.")memory.encode("User is allergic to shellfish.", context="medical")
# Recall relevant context using multi-factor retrievalresults = memory.recall("What framework does the user prefer?")for mem in results:    print(f"[{mem.strength:.2f}] {mem.content}")
# Manually trigger System 2 background consolidationmemory.consolidate()memory.save()
# --- Or Load a Pre-Curated Persona (e.g. Albert Einstein) ---einstein, manifest = SMRITI.from_persona("albert-einstein")memories = einstein.recall("What thought experiment led to Special Relativity?")for mem in memories:    print(f"[{mem.strength:.2f}] {mem.content}")

MCP Tool Reference

SMRITI exposes 19 tools (13 native + 6 AMP aliases) for clients:

Core Tools

Tool NameDescription
smriti_encodeIngests a new memory. Accept private=True to exclude from team syncs.
smriti_recallRetrieves memories using semantic and graph-based retrieval.
smriti_get_contextHelper to inject the current active working memory slots into the context window.
smriti_how_well_do_i_knowPerforms a meta-memory confidence check on a given topic.
smriti_knowledge_gapsIdentifies topics the agent has identified it needs more information on.
smriti_pinMarks a memory as permanent (protects it from strength decay).
smriti_forgetSoft-deletes/archives a memory, leaving a cryptographic tombstone.
smriti_consolidateTriggers a background System 2 consolidation run.
smriti_statsReturns system-wide statistics (total memories, rooms, private counts).
smriti_create_private_roomSpawns a private room. All memories inside this room are visibility-isolated.
smriti_open_uiLaunches the interactive visual D3.js memory graph in your default browser.
smriti_sync_obsidianExports the Semantic Palace graph structures to markdown files in an Obsidian Vault.

AMP v1.0 Alias Tools

These endpoints ensure complete conformance with the standard Agent Memory Protocol specification:

AMP ToolNative MappingReturn Format
amp.encodesmriti_encodeAMP standard JSON response
amp.recallsmriti_recallArray of {id, content, score, timestamp, status}
amp.forgetsmriti_forget{status: "forgotten" | "not_found"}
amp.statssmriti_stats{memory_count, ...}
amp.pinsmriti_pin{status: "pinned" | "not_found"}
amp.consolidatesmriti_consolidate{status: "ok", memories_processed: int}

Framework Integrations

LangChain Integration

Use SmritiLangChainMemory as a drop-in replacement for default chat buffers. It limits active context using Working Memory and offloads the conversational history to the Semantic Palace graph in the background.

python
from langchain.chains import ConversationChainfrom smriti.integrations.langchain_memory import SmritiLangChainMemoryfrom smriti import SMRITI
smriti_engine = SMRITI(storage_path="./langchain_smriti_db")smriti_memory = SmritiLangChainMemory(smriti_client=smriti_engine, top_k=3)
conversation = ConversationChain(    llm=my_llm,    memory=smriti_memory,)conversation.predict(input="I prefer backend APIs in Python.")

Benchmarks & Performance

1. LoCoMo (Multi-System Context Retrieval)

Tested against four architectures on the LoCoMo long-context dialogue dataset (28 turns, 15 evaluation questions):

SystemF1 ScoreLatencyTokens/QueryConsolidation
FullContext0.3451147ms550—
MemGPT-style0.3341397ms478—
NaiveRAG0.3121387ms145—
SMRITI0.2791317ms14641.2s (async)
Mem0-style0.2351088ms106—

SMRITI retains high recall while drastically reducing query context size. Consolidation runs in the background and does not block client interactions.

2. LongMemEval (Long-Term Chat Sessions)

Evaluated over 50+ chat sessions using the LongMemEval harness:

System ConfigurationExact Match AccuracyAverage Query Latency
Baseline (Full Context)100.0%11.98s
SMRITI Dual-Process80.0%0.98s (12× latency reduction)

Configuration Parameters

Initialize SmritiConfig with custom parameters to tune the cognitive weights:

python
from smriti import SmritiConfig
config = SmritiConfig(    working_memory_slots=7,          # Capacity limit (Miller's Law)        # Retrieval scoring weights (sum to 1.0)    recency_weight=0.2,    relevance_weight=0.4,    strength_weight=0.2,    salience_weight=0.2,
    # Forgetting & Temporal Decay    decay_rate=0.99,                 # Strength multiplier per day    strength_hard_threshold=0.05,    # Memories dropping below this are forgotten        # Palace Graph    room_merge_threshold=0.85,       # Cosine similarity for auto-merging semantic rooms)

Citation

If you use SMRITI in your research, please cite our technical paper:

bibtex
@article{tyagi2025smriti,  title={SMRITI: A Scalable, Neuro-Inspired Architecture for Long-Term Event Memory in LLM Agents},  author={Tyagi, Shivam},  year={2025},  doi={10.13140/RG.2.2.25477.82407}}

License

SMRITI is licensed under the MIT License. See LICENSE for details.

來源:README.md,提交 2cb3553

工具

0
SourceWeft 尚未在沙箱中啟動過該軟體包,因此其工具未知。

版本歷史

1
  1. v1.4.17最新Sep 16, 2026

評分

已滿足適用檢查項的 50%

該評分衡量此收錄條目的完整程度,依據註冊中心條目、端點與公開來源計算得出。它不是對伺服器本身的評價,也不表示伺服器安全或目前可用:可連通性是帶日期的檢查結果,評分也不包含安裝量或使用者評價。

  • 近 30 天內可連通25 分

    請保持端點能夠回應 MCP 握手;SourceWeft 每 30 天探測一次。

  • 已宣告認證方式10 分

    請在註冊中心條目中宣告憑證請求標頭,或保持端點能夠回應探測,以便判定其認證方式。

  • 已列出工具15 分

    請讓伺服器在無憑證時回應 tools/list,或發布可在沙箱中無憑證啟動的軟體包。

  • 描述必需15 分
  • 圖示10 分
  • 文件15 分
  • 授權條款10 分

其他 Memory 整合