JSPM

  • ESM via JSPM
  • ES Module Entrypoint
  • Export Map
  • Keywords
  • License
  • Repository URL
  • TypeScript Types
  • README
  • Created
  • Published
  • Downloads 277
  • Score
    100M100P100Q118302F
  • License MIT

MemTensor Local memory plugin for Hermes Agent

Package Exports

  • @memtensor/memos-local-hermes-plugin
  • @memtensor/memos-local-hermes-plugin/index.ts

This package does not declare an exports field, so the exports above have been automatically detected and optimized by JSPM instead. If any package subpath is missing, it is recommended to post an issue to the original package (@memtensor/memos-local-hermes-plugin) to support the "exports" field. If that is not possible, create a JSPM override to customize the exports field for this package.

Readme

MemOS โ€” Hermes Memory Plugin

npm version License: MIT Node.js >= 18 GitHub

Persistent local conversation memory for Hermes Agent. Every conversation is automatically captured, semantically indexed, and instantly recallable โ€” with task summarization & skill evolution, team sharing, and Memory Viewer.

Full-write | Hybrid Search | Task Summarization & Skill Evolution | Team Sharing | Memory Viewer

๐Ÿ“ฆ NPM ยท ๐Ÿ“– Documentation

Why MemOS

Problem Solution
Agent forgets everything between sessions Persistent memory โ€” every conversation auto-captured to local SQLite
Fragmented context, repeated mistakes Task summarization & skill evolution โ€” conversations organized into structured tasks, then distilled into reusable skills that auto-upgrade
No visibility into what the agent remembers Memory Viewer โ€” full visualization of all memories, tasks, and skills
Privacy concerns with cloud storage 100% local โ€” zero cloud uploads, anonymous opt-out telemetry only

Features

Memory Engine

  • Auto-capture โ€” Stores user, assistant, and tool messages after each agent turn
  • Smart deduplication โ€” Exact content-hash skip; then Top-5 similar chunks (threshold 0.75) with LLM judge: DUPLICATE (skip), UPDATE (merge), or NEW (create)
  • Semantic chunking โ€” Splits by code blocks, function bodies, paragraphs; never cuts mid-function
  • Hybrid retrieval โ€” FTS5 keyword + vector semantic dual-channel search with RRF fusion
  • MMR diversity โ€” Maximal Marginal Relevance reranking prevents near-duplicate results
  • Recency decay โ€” Configurable time-based decay (half-life: 14 days) biases recent memories
  • Multi-provider embedding โ€” OpenAI-compatible, Gemini, Cohere, Voyage, Mistral, or local offline (Xenova/all-MiniLM-L6-v2)

Task Summarization & Skill Evolution

  • Auto task boundary detection โ€” Per-turn LLM topic judgment + 2-hour idle timeout segments conversations into tasks
  • Structured summaries โ€” LLM generates Goal, Key Steps, Result, Key Details for each completed task
  • Key detail preservation โ€” Code, commands, URLs, file paths, error messages retained in summaries
  • Automatic evaluation โ€” After task completion, rule filter + LLM evaluates if the task is worth distilling into a skill
  • Skill generation โ€” Multi-step LLM pipeline creates SKILL.md + scripts + references from real execution records
  • Skill upgrading โ€” When similar tasks appear, existing skills are auto-upgraded
  • Version management โ€” Full version history with changelog and upgrade type tracking

Memory Viewer

  • 7 management pages โ€” Memories, Tasks, Skills, Analytics, Logs, Import, Settings
  • Full CRUD โ€” Create, edit, delete, search memories
  • Task browser โ€” Status filters, chat-bubble chunk view, structured summaries
  • Skill browser โ€” Version history, quality scores, one-click download as ZIP
  • Analytics dashboard โ€” Daily read/write activity, memory breakdown charts
  • Security โ€” Password-protected, localhost-only (127.0.0.1), session cookies
  • i18n โ€” Chinese / English toggle
  • Themes โ€” Light / Dark mode

Privacy & Security

  • 100% on-device โ€” All data in local SQLite, no cloud uploads
  • Anonymous telemetry โ€” Enabled by default, opt-out via config. Only sends tool names, latencies, and version info. Never sends memory content, queries, or personal data.

Quick Start

1. Install

One command installs the plugin, all dependencies, and build tools automatically.

macOS / Linux:

curl -fsSL https://raw.githubusercontent.com/MemTensor/MemOS/main/apps/memos-local-plugin/install.sh | bash

Alternative โ€” Install via npm:

npm install -g @memtensor/memos-local-hermes-plugin

Environment variables for install script:

Variable Default Description
MEMOS_INSTALL_DIR ~/.hermes/memos-plugin Override install directory
MEMOS_STATE_DIR auto Override memory DB location
MEMOS_DAEMON_PORT 18992 Bridge daemon port
MEMOS_VIEWER_PORT 18901 Memory Viewer port
MEMOS_EMBEDDING_PROVIDER local Embedding provider

2. Configure

Copy and edit the environment template:

cd ~/.hermes/memos-plugin
cp .env.example .env

Edit .env with your API keys (or leave blank for local-only mode):

# Embedding โ€” leave blank to use local offline model (Xenova/all-MiniLM-L6-v2)
EMBEDDING_PROVIDER=openai_compatible
EMBEDDING_API_KEY=your-embedding-api-key
EMBEDDING_ENDPOINT=https://your-embedding-api.com/v1
EMBEDDING_MODEL=bge-m3

# Summarizer โ€” leave blank for rule-based fallback
SUMMARIZER_PROVIDER=openai_compatible
SUMMARIZER_API_KEY=your-summarizer-api-key
SUMMARIZER_ENDPOINT=https://api.openai.com/v1
SUMMARIZER_MODEL=gpt-4o-mini
SUMMARIZER_TEMPERATURE=0

Embedding Provider Options

Provider provider value Example model Notes
OpenAI / compatible openai_compatible bge-m3, text-embedding-3-small Any OpenAI-compatible API
Gemini gemini text-embedding-004 Requires apiKey
Cohere cohere embed-english-v3.0 Separates document/query embedding
Voyage voyage voyage-2
Mistral mistral mistral-embed
Local (offline) local โ€” Uses Xenova/all-MiniLM-L6-v2, no API needed

Summarizer Provider Options

Provider provider value Example model
OpenAI / compatible openai_compatible gpt-4o-mini
Anthropic anthropic claude-3-haiku-20240307
Gemini gemini gemini-1.5-flash
AWS Bedrock bedrock anthropic.claude-3-haiku-20240307-v1:0

3. Bridge Modes

The plugin communicates with the Hermes Agent via a JSON-RPC bridge (bridge.cts), supporting two modes:

Stdio mode (default) โ€” Short-lived, reads JSON-RPC from stdin, responds on stdout:

MEMOS_BRIDGE_CONFIG='...' npx tsx bridge.cts

Daemon mode โ€” Long-running, listens on a TCP port, also starts the Memory Viewer:

MEMOS_BRIDGE_CONFIG='...' npx tsx bridge.cts --daemon --port 18992 --viewer-port 18901

4. Verify Installation

After installing and starting the daemon, open the Memory Viewer at http://127.0.0.1:18901.

Adapters

The plugin includes adapters for different agent frameworks:

Hermes Adapter

Located at adapters/hermes/. Python-based adapter for direct integration with the Hermes Agent.

cd adapters/hermes
bash install.sh

OpenHarness Adapter

Located at adapters/openharness/. For integration via the OpenHarness framework.

cd adapters/openharness
bash install.sh

How It Works

Three Intelligent Pipelines

Conversation โ†’ Memory Write Pipeline โ†’ Task Generation Pipeline โ†’ Skill Evolution Pipeline
                                                                          โ†“
                              Smart Retrieval Pipeline โ† โ† โ† โ† โ† โ† โ† โ† โ†

Pipeline 1: Memory Write (auto on every agent turn)

Conversation โ†’ Capture (filter roles, strip system prompts)
โ†’ Semantic chunking (code blocks, paragraphs, error stacks)
โ†’ Content hash dedup โ†’ LLM summarize each chunk
โ†’ Vector embedding โ†’ Store (SQLite + FTS5 + Vector)

Pipeline 2: Task Generation (auto after memory write)

New chunks โ†’ Group into user-turns โ†’ Process one turn at a time
โ†’ Warm-up (first user turn): assign directly
โ†’ Each subsequent user turn: LLM topic judge
  โ†’ "NEW"? โ†’ Finalize current task, create new task
  โ†’ "SAME"? โ†’ Assign to current task
โ†’ Time gap > 2h? โ†’ Always split regardless of topic
โ†’ Finalize: Chunks โ‰ฅ 4 & turns โ‰ฅ 2? โ†’ LLM structured summary

Pipeline 3: Skill Evolution (auto after task completion)

Completed task โ†’ Rule filter (min chunks, non-trivial content)
โ†’ Search for related existing skills
  โ†’ Related skill found? โ†’ Evaluate upgrade โ†’ Merge โ†’ Version bump
  โ†’ No related skill? โ†’ Evaluate create โ†’ Generate SKILL.md + scripts
  โ†’ Quality score (0-10) โ†’ Install if score โ‰ฅ 6

Pipeline 4: Smart Retrieval

Query โ†’ FTS5 + Vector dual recall โ†’ RRF Fusion โ†’ MMR Rerank
โ†’ Recency Decay โ†’ Score Filter โ†’ Top-K
โ†’ LLM relevance filter โ†’ Dedup by excerpt overlap
โ†’ Return excerpts + metadata

Agent Tools

Tool Purpose
memory_search Search memories with hybrid retrieval (FTS5 + vector + RRF + MMR)
memory_get Get full original text of a memory chunk
memory_timeline Get surrounding conversation context around a chunk
task_summary Get structured summary of a completed task
skill_get Get skill content by skillId or taskId
skill_install Install a skill into the agent workspace
memory_viewer Get the URL of the Memory Viewer web UI

Search Parameters

Parameter Default Range Description
query โ€” โ€” Natural language search query
maxResults 20 1โ€“20 Maximum candidates before LLM filter
minScore 0.45 0.35โ€“1.0 Minimum relevance score
role โ€” user / assistant / tool Filter by message role

Memory Viewer

Open http://127.0.0.1:18901 in your browser after starting the daemon.

Page Features
Memories Timeline view, pagination, filters, CRUD, semantic search
Tasks Task list with status filters, chat-bubble chunk view, structured summaries
Skills Skill list with version history, quality scores, ZIP download
Analytics Daily write/read activity charts, memory/task/skill totals
Logs Tool call log with input/output and duration
Import Memory migration with real-time progress
Settings Online configuration and team sharing settings

Forgot password? Click "Forgot password?" on the login page.

Advanced Configuration

All optional โ€” shown with defaults:

# In .env or environment variables

# Recall tuning
RECALL_MAX_RESULTS=6          # Default search results
RECALL_MIN_SCORE=0.45         # Default min score threshold
RECALL_RRF_K=60               # RRF fusion constant
RECALL_MMR_LAMBDA=0.7         # MMR relevance vs diversity (0-1)
RECALL_RECENCY_HALF_LIFE=14   # Time decay half-life in days

# Deduplication
DEDUP_SIMILARITY_THRESHOLD=0.75  # Cosine similarity for dedup
DEDUP_ENABLE_SMART_MERGE=true    # LLM judge: DUPLICATE / UPDATE / NEW

# Skill Evolution
SKILL_EVOLUTION_ENABLED=true     # Enable skill evolution
SKILL_AUTO_EVALUATE=true         # Auto-evaluate tasks for skill generation
SKILL_AUTO_INSTALL=false         # Auto-install generated skills

# Viewer
VIEWER_PORT=18901                # Memory Viewer port

# Telemetry (opt-out)
TELEMETRY_ENABLED=true           # Set false to opt-out

Telemetry

MemOS collects anonymous usage analytics to help improve the plugin. Telemetry is enabled by default and can be disabled at any time.

What is collected

  • Plugin version, OS, Node.js version, architecture
  • Tool call names and latencies
  • Aggregate counts (chunks ingested, skills installed)
  • Daily active ping

What is NEVER collected

  • Memory content, search queries, or conversation text
  • API keys, file paths, or any personally identifiable information
  • Any data stored in your local database

How to disable

Set environment variable:

TELEMETRY_ENABLED=false

Project Structure

apps/memos-local-plugin/
โ”œโ”€โ”€ index.ts                 # Plugin entry โ€” hooks, tool registration, lifecycle
โ”œโ”€โ”€ bridge.cts               # JSON-RPC bridge (stdio + daemon modes)
โ”œโ”€โ”€ install.sh               # One-click installer script
โ”œโ”€โ”€ adapters/
โ”‚   โ”œโ”€โ”€ hermes/              # Python adapter for Hermes Agent
โ”‚   โ”‚   โ”œโ”€โ”€ plugin.yaml      # Plugin metadata
โ”‚   โ”‚   โ”œโ”€โ”€ config.py        # Configuration
โ”‚   โ”‚   โ”œโ”€โ”€ bridge_client.py # JSON-RPC client
โ”‚   โ”‚   โ”œโ”€โ”€ daemon_manager.py# Daemon lifecycle management
โ”‚   โ”‚   โ””โ”€โ”€ install.sh       # Adapter installer
โ”‚   โ””โ”€โ”€ openharness/         # OpenHarness adapter
โ”‚       โ”œโ”€โ”€ plugin.json      # Plugin metadata
โ”‚       โ”œโ”€โ”€ scripts/         # Python bridge scripts
โ”‚       โ””โ”€โ”€ install.sh       # Adapter installer
โ”œโ”€โ”€ src/
โ”‚   โ”œโ”€โ”€ config.ts            # Configuration schema & defaults
โ”‚   โ”œโ”€โ”€ types.ts             # TypeScript type definitions
โ”‚   โ”œโ”€โ”€ capture/             # Message capture & filtering
โ”‚   โ”œโ”€โ”€ embedding/           # Embedding providers
โ”‚   โ”œโ”€โ”€ ingest/              # Ingestion pipeline (chunker, dedup, tasks)
โ”‚   โ”œโ”€โ”€ recall/              # Hybrid retrieval engine (FTS5 + Vector + RRF + MMR)
โ”‚   โ”œโ”€โ”€ skill/               # Skill evolution pipeline
โ”‚   โ”œโ”€โ”€ storage/             # SQLite database layer + vector search
โ”‚   โ”œโ”€โ”€ tools/               # Tool implementations
โ”‚   โ”œโ”€โ”€ viewer/              # Memory Viewer web server
โ”‚   โ”œโ”€โ”€ client/              # Hub client & skill sync
โ”‚   โ”œโ”€โ”€ shared/              # Shared utilities (LLM fallback chain)
โ”‚   โ””โ”€โ”€ telemetry.ts         # Anonymous usage analytics
โ”œโ”€โ”€ www/docs/                # Documentation pages
โ”œโ”€โ”€ package.json
โ””โ”€โ”€ tsconfig.json

Development

Prerequisites

  • Node.js >= 18 (node -v)
  • npm >= 9 (npm -v)
  • C++ build tools (for better-sqlite3 native module):
    • macOS: xcode-select --install
    • Linux: sudo apt install build-essential python3

Clone & Setup

git clone https://github.com/MemTensor/MemOS.git
cd MemOS/apps/memos-local-plugin
npm install

Build

npm run build       # Compile TypeScript
npm run dev         # Watch mode

From Source

git clone https://github.com/MemTensor/MemOS.git
cd MemOS/apps/memos-local-plugin
npm install && npm run build

Data Location

File Path
Database ~/.hermes/memos-plugin/data/memos.db
Plugin code ~/.hermes/memos-plugin/
Gateway log ~/.hermes/memos-plugin/logs/

Troubleshooting

  1. better-sqlite3 native module error โ€” Could not locate the bindings file:

    cd ~/.hermes/memos-plugin && npm rebuild better-sqlite3

    If rebuild fails, install C++ build tools:

    • macOS: xcode-select --install
    • Linux: sudo apt install build-essential python3
  2. Viewer won't open โ€” The viewer starts in daemon mode only. Ensure the daemon is running:

    npx tsx bridge.cts --daemon --port 18992 --viewer-port 18901
  3. Node version โ€” Requires Node.js >= 18 and < 25. Check with node -v.

License

MIT โ€” See LICENSE for details.