Skip to main content

Membase memory provider package for Hermes Agent

Project description

Membase Plugin for Hermes Agent

Hermes x Membase banner

Persistent long-term memory for Hermes Agent using hybrid vector search and a knowledge graph.

Follow on X Follow on LinkedIn Join Our Discord PyPI version

Website · Docs · Dashboard · Issues


Give your Hermes Agent persistent memory that survives across sessions. Membase uses hybrid vector search and a knowledge graph to remember not just text, but entities, relationships, and facts.

Free to start: Sign up at app.membase.so and connect in under a minute.

Install

uv tool install hermes-membase && hermes-membase install

Hermes installs uv automatically, so this works out of the box.
No uv? Use pip install hermes-membase && hermes-membase install instead.

This single command does everything:

  1. Copies the self-contained plugin into ~/.hermes/plugins/membase/
  2. Sets memory.provider: membase in ~/.hermes/config.yaml
  3. Writes default config to ~/.hermes/membase.json
  4. Opens a browser window for OAuth login

Pass --skip-login to defer the login step and run hermes-membase login later.

Setup

hermes-membase login

Opens a browser for OAuth authentication. Tokens are saved automatically, so there are no API keys to copy and paste.

How It Works

Once installed, the plugin runs automatically on every Hermes session:

User message
    │
    ▼
┌─────────────────────────┐
│  Auto-Recall            │  Searches Membase for relevant memories
│  (queue_prefetch)       │  and injects them as context next turn
└───────────┬─────────────┘
            ▼
┌─────────────────────────┐
│  AI Response            │  Agent can call memory and wiki tools
│                         │  (membase_search, membase_wiki_add, etc.)
└───────────┬─────────────┘
            ▼
┌─────────────────────────┐
│  Auto-Capture           │  Buffers messages, flushes to Membase
│  (on_session_end)       │  for entity/relationship extraction
└───────────┬─────────────┘
            ▼
┌─────────────────────────┐
│  Mirror Built-in        │  Mirrors Hermes MEMORY.md writes to
│  (on_memory_write)      │  Membase for cross-session persistence
└───────────┬─────────────┘
            ▼
┌─────────────────────────┐
│  Membase Backend        │  Hybrid vector search + knowledge graph
│  (api.membase.so)       │
└─────────────────────────┘
  • Auto-Recall: Before every AI turn, searches memory and wiki context (when enabled) and injects relevant snippets. Skips casual chat and short messages. Respects a maxRecallChars budget (default 4000) to avoid oversized context.
  • Auto-Capture: Buffers conversation turns and flushes them to Membase at session end. Flushes after 5 minutes of silence or 20 messages. Requires at least 2 messages and 50+ characters total to avoid capturing one-off queries.
  • Mirror Built-in: When Hermes writes to its built-in MEMORY.md via the memory tool, those writes are automatically mirrored to Membase in the background. A local hash index prevents duplicates.
  • Knowledge Graph: Unlike simple vector-only memory, Membase uses hybrid vector search and a knowledge graph to store entities, relationships, and facts.

AI Tools

The agent uses these tools autonomously during conversations:

Tool Description
membase_search Search memories by semantic similarity. Supports date filtering (date_from, date_to, timezone) and source filtering (sources). Returns episode bundles with related facts.
membase_store Save important information to long-term memory. Use for preferences, goals, decisions, and context.
membase_forget Delete a memory. Shows matches first, then deletes after confirmation (two-step).
membase_profile Retrieve user profile and related memories for session context.
membase_wiki_search Search wiki documents for stable factual references.
membase_wiki_add Create a wiki document from markdown content.
membase_wiki_update Update title, content, or collection of an existing wiki document.
membase_wiki_delete Delete a wiki document.

CLI Commands

hermes-membase install              # One-shot install and OAuth login
hermes-membase login                # OAuth login (PKCE): opens browser
hermes-membase logout               # Remove stored tokens
hermes-membase status               # Check API connectivity and profile
hermes-membase search "<query>"     # Search memories from the terminal
hermes-membase resync               # Rebuild mirror index from MEMORY.md
hermes-membase resync --dry-run     # Preview resync without writing

These are also available as hermes membase <cmd> from inside the Hermes TUI after installation.

Configuration

Config is stored in ~/.hermes/membase.json. All keys are optional and have sensible defaults:

Key Type Default Description
tokenFile string ~/.hermes/credentials/membase.json OAuth token cache path. Stored outside the plugin directory so it survives updates.
autoRecall boolean false Inject relevant memories before every AI turn.
autoWikiRecall boolean false Inject relevant wiki documents before every AI turn.
autoCapture boolean true Automatically store conversations to Membase.
mirrorBuiltin boolean true Mirror Hermes built-in memory writes to Membase.
maxRecallChars number 4000 Max characters of injected memory context per turn (500-16000).
debug boolean false Enable verbose debug logs.

Example ~/.hermes/membase.json:

{
  "autoRecall": true,
  "autoCapture": true,
  "mirrorBuiltin": true,
  "maxRecallChars": 4000
}

How Membase Differs

Simple vector memory Membase
Storage Flat embeddings Hybrid: vector embeddings + knowledge graph
Search Vector similarity only Vector + graph traversal (entities, relationships, facts)
Extraction Store raw text AI-powered entity/relationship extraction
Auth API key OAuth 2.0 with PKCE (no secrets to manage)
Ingest Synchronous Async pipeline (~100ms response, background graph sync)

Development

git clone https://github.com/aristoapp/hermes-membase.git
cd hermes-membase
python3 -m venv .venv
.venv/bin/pip install -e .

Contributing

Contributions welcome. See CONTRIBUTING.md for guidelines.

Links

License

MIT

Project details


Download files

Download the file for your platform. If you're not sure which to choose, learn more about installing packages.

Source Distribution

hermes_membase-0.1.2.tar.gz (26.6 kB view details)

Uploaded Source

Built Distribution

If you're not sure about the file name format, learn more about wheel file names.

hermes_membase-0.1.2-py3-none-any.whl (32.5 kB view details)

Uploaded Python 3

File details

Details for the file hermes_membase-0.1.2.tar.gz.

File metadata

  • Download URL: hermes_membase-0.1.2.tar.gz
  • Upload date:
  • Size: 26.6 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/6.2.0 CPython/3.9.6

File hashes

Hashes for hermes_membase-0.1.2.tar.gz
Algorithm Hash digest
SHA256 e11d3f661c24c7bfefed592e16b0353216aa80fc1ef88dfac0c6ae62ecaf531e
MD5 184c5547698cfad148639691d2d57034
BLAKE2b-256 4f7d7c69c5c760833a23dd0077ae2ebbf9d6a2202f2db44bd1531e61958a52d9

See more details on using hashes here.

File details

Details for the file hermes_membase-0.1.2-py3-none-any.whl.

File metadata

  • Download URL: hermes_membase-0.1.2-py3-none-any.whl
  • Upload date:
  • Size: 32.5 kB
  • Tags: Python 3
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/6.2.0 CPython/3.9.6

File hashes

Hashes for hermes_membase-0.1.2-py3-none-any.whl
Algorithm Hash digest
SHA256 9983e7f4cf6798c59093e6f5d310ffb8a526b4e4b7aa10117ba4103dd22fda5a
MD5 007f51f1e793f3f4d5b41d538afe6fa6
BLAKE2b-256 624d2f1634968c4b70352971836ed48d8bd4b1692224a63697879880b77c196c

See more details on using hashes here.

Supported by

AWS Cloud computing and Security Sponsor Datadog Monitoring Depot Continuous Integration Fastly CDN Google Download Analytics Pingdom Monitoring Sentry Error logging StatusPage Status page