All plugins

galaxymem

Entity-scoped memory provider with four epistemic networks (world, experience, opinion, observation), decay, hybrid vector and keyword recall, temporal queries, spreading activation and autonomous reflection, all in one local SQLite file. Exposes 18 gm_* tools and injects bright memories into the prompt. Disclosure — batched extraction, reflection, query expansion, reasoning and session-summary compression send turn text to the LLM configured for auxiliary.galaxymem through Hermes credentials, which follows your active model unless you set an override; embeddings run locally with fastembed, and first use downloads BAAI/bge-small-en-v1.5 from Hugging Face (about 100 MB); the optional reranker downloads cross-encoder/ms-marco-MiniLM-L-6-v2 from Hugging Face; the model can change the persistent reflection mission and directives through gm_config; data lives in $HERMES_HOME/galaxymem/ or GALAXYMEM_DB_PATH; no telemetry, no self-updater.

k1ng0marMemoryv0.2.3Updated 8 days ago

About

Entity-scoped memory provider with four epistemic networks (world, experience, opinion, observation), decay, hybrid vector and keyword recall, temporal queries, spreading activation and autonomous reflection, all in one local SQLite file. Exposes 18 gm_* tools and injects bright memories into the prompt. Disclosure — batched extraction, reflection, query expansion, reasoning and session-summary compression send turn text to the LLM configured for auxiliary.galaxymem through Hermes credentials, which follows your active model unless you set an override; embeddings run locally with fastembed, and first use downloads BAAI/bge-small-en-v1.5 from Hugging Face (about 100 MB); the optional reranker downloads cross-encoder/ms-marco-MiniLM-L-6-v2 from Hugging Face; the model can change the persistent reflection mission and directives through gm_config; data lives in $HERMES_HOME/galaxymem/ or GALAXYMEM_DB_PATH; no telemetry, no self-updater.

GalaxyMem

GalaxyMem — connected memory nodes in a spiral galaxy

Entity-scoped memory for AI agents — four epistemic networks, decay, evidence-backed reasoning, and autonomous reflection.

License: MIT
Python
SQLite
Local-first

Local-first agent memory built for Hermes Agent, usable anywhere Python runs. Hybrid vector + keyword recall fused with RRF, cross-encoder reranking, temporal queries, spreading activation, decay-based relevance, evidence-quoted opinions, staleness re-verification, usefulness feedback, and a reasoning loop you can call on demand.

Everything lives in one SQLite file. No server, no cloud account, no per-memory LLM cost. Embeddings run on-device via fastembed.


Why

Most agent memory is a flat list of facts in a vector database. Find similar text, return the top matches, done. That works until the agent has to remember who a preference belongs to, notice that a fact went stale, or explain why it believes something.

GalaxyMem models memory closer to how it actually works:

Four epistemic networksMemories are world facts, experience events, opinion preferences, or observation patterns. Each decays and reflects differently
Entity scopingEvery memory is scoped to who or what it's about, not who said it. Recall filters to the entities active in the conversation
Hybrid retrievalVector + BM25 keyword, fused via Reciprocal Rank Fusion, then cross-encoder reranked. Names, error codes, and paraphrases all land
Temporal queriesAsk "what did I believe in July" and get what was true then, not what's true now
Decay with recall arrestMemories fade over a 30-day half-life by default. Every recall touches a memory and arrests decay — things you use stay fresh
Spreading activationRecall walks out through entity and temporal edges, surfacing connected memories you didn't ask for but probably wanted
Evidence-quoted consolidationReflection forms opinions from corroborating facts and stores the verbatim source quotes. Every belief can be checked against its evidence
Staleness re-verificationExisting opinions get re-checked against newer evidence. Contradicted ones are demoted, not quietly left wrong
Usefulness feedbackMemories that surface but never help get demoted. Consistently useful ones stay
On-demand reasoninggm_reason returns a cited answer with confidence, conflicts, and gaps — not a raw memory dump
Secret redactionCredential-shaped spans get redacted at ingest, so an API key ends up in neither storage nor the prompt
Explicit identityCross-platform identity links are explicit only. Telegram user X maps to an entity because you said so, never because a model guessed

How it works

┌──────────────────────────────────────────────────────────┐
│ Turn ──► Pass 1 (flag + redact) ──► Pass 2 (extract) ──► store
│                                                            │
│ Prompt ◄── Hot cache ◄── Deep recall ◄── RRF fusion        │
│                │                  │                        │
│                │         Spreading activation              │
│                │                  │                        │
│         Reflect ◄── 100+ new memories (or gm_reflect_now)  │
│                │   ├─ conflicts → supersede / contest      │
│                │   ├─ opinions with evidence quotes        │
│                │   ├─ staleness re-verify                  │
│                │   └─ usefulness policy                    │
│                │                                           │
│ gm_reason ◄── opinions + facts + confidence ──► answer    │
└──────────────────────────────────────────────────────────┘
StageWhenWhat happens
Pass 1Every turn, no LLMRules decide if a turn is worth remembering. Credential-shaped spans get redacted before anything is stored
Pass 212+ flags, 20 min idle, gm_flush, or session endOne batched LLM call extracts entity-scoped memories
Hot cacheEvery promptTop-K brightest memories for active entities (token-budgeted) injected as context
Deep recallgm_recallVector + keyword → RRF → decay boost → spreading activation → rerank
Reflect100+ new memories or on demandResolves contradictions, merges opinions, demotes stale beliefs
Reasongm_reasonAgentic loop over opinions and facts, returns a cited answer
PromoteAfter reflectionDrafts vault proposals for memories worth promoting — human-gated

Install

As a Hermes Agent plugin:

git clone https://github.com/k1ng0mar/galaxymem.git ~/.hermes/plugins/galaxymem
cd ~/.hermes/plugins/galaxymem
pip install -e ".[dev]"

then point Hermes at it:

hermes config set memory.provider galaxymem

The plugin registers on the next session start. Built-in MEMORY.md and USER.md keep working underneath; GalaxyMem is additive.

Standalone, as a library:

git clone https://github.com/k1ng0mar/galaxymem.git
cd galaxymem
pip install -e .
from pathlib import Path
from galaxymem.store_sqlite import Store
from galaxymem.models import MemoryRecord, Network

store = Store(db_path=Path("./my_memory")).open()

store.add_memory(MemoryRecord(
    id="example-1",
    text="The API runs on port 8010",
    network=Network.world,
    entity_ids=["self"],
))

results = store.vector_search("what port is the API on", k=5)
for mem, score in results:
    print(f"{score:.3f}  {mem.text}")

Configuration

Everything is an environment variable with a GALAXYMEM_ prefix:

VariableDefaultWhat it controls
GALAXYMEM_DB_PATH~/.galaxymem/dbWhere the database lives
GALAXYMEM_DECAY_HALF_LIFE_DAYS30Memory fade rate
GALAXYMEM_HOT_CACHE_K8Memories in the hot cache
GALAXYMEM_HOT_CACHE_TOKEN_BUDGET800Token cap for injected context
GALAXYMEM_PASS2_FLAG_THRESHOLD12Flags before extraction runs
GALAXYMEM_REFLECT_VOLUME_TRIGGER100New memories before reflection
GALAXYMEM_MAX_MEMORIES50000Hard cap on stored memories
GALAXYMEM_EMBEDDING_MODELBAAI/bge-small-en-v1.5Local embedding model
GALAXYMEM_RERANKER_MODELcross-encoder/ms-marco-MiniLM-L-6-v2Recall reranker
GALAXYMEM_AUX_PROVIDERactive modelOptional provider override for extraction and reflection
GALAXYMEM_AUX_MODELactive modelOptional model override for extraction and reflection

Tools (inside Hermes)

ToolWhat it does
gm_recallDeep recall: hybrid search, fusion, activation, rerank
gm_explain_recallSame results with provenance — which retrieval arms selected each memory and why
gm_reasonCited, evidence-backed answer over memories
gm_storeManually store a memory
gm_statsStore statistics
gm_reflectKick off a reflection cycle in the background
gm_reflect_nowExtraction + reflection, blocking
gm_flushForce Pass 2 extraction of pending flags
gm_forgetArchive a memory (soft delete — it's never destroyed)
gm_create_entity / gm_update_entity / gm_merge_entityEntity lifecycle
gm_entity_cardFull entity profile with links and memories
gm_link_identityMap a platform identity to an entity
gm_session_searchSearch past sessions by summary

Project layout

galaxymem/                 # repo root (also the Hermes plugin dir)
├── __init__.py            # Hermes entry point — lazy register()
├── plugin.yaml            # plugin manifest
├── conftest.py            # pytest boundary (do not delete)
├── pyproject.toml
└── galaxymem/             # the installable package
    ├── config.py          # tunables, env-overridable
    ├── models.py          # MemoryRecord, EntityRecord, EdgeRecord, ...
    ├── store_sqlite.py    # storage layer: CRUD, vector + keyword search, edges
    ├── embed.py           # embeddings (fastembed, with a deterministic fallback)
    ├── entities.py        # entity lifecycle + provisioning
    ├── identity.py        # cross-platform identity links
    ├── retain.py          # Pass 1 flagging + Pass 2 extraction
    ├── redact.py          # credential detection and redaction
    ├── recall.py          # hybrid search, RRF, hot cache, spreading activation
    ├── rerank.py          # cross-encoder reranking
    ├── temporal_parse.py  # "last July", "in March" → date windows
    ├── queryexpansion.py  # LLM query expansion
    ├── reflect.py         # supersession, opinions, staleness, usefulness
    ├── reason.py          # the gm_reason loop
    ├── promote.py         # vault proposal bridge
    ├── summaries.py       # rolling session summaries
    └── tests/             # 280+ tests

Development

pip install -e ".[dev]"
pytest galaxymem/tests/ -v

See ARCHITECTURE.md for module boundaries and design decisions, CONTRIBUTING.md for how to contribute, and AGENTS.md if you're an AI agent setting this up for someone.

Disclosure

GalaxyMem writes one SQLite database under $HERMES_HOME/galaxymem/db, or at GALAXYMEM_DB_PATH when set. Non-secret settings live in $HERMES_HOME/galaxymem.json.

Pass 1 runs locally. Batched extraction, reflection, query expansion and reasoning call an LLM through the auxiliary.galaxymem task, using Hermes's provider configuration and credentials. The task follows your active model unless you set a provider and model in galaxymem.json or through GALAXYMEM_AUX_PROVIDER and GALAXYMEM_AUX_MODEL. The plugin does not read auth.json or .env, and it stores no API key for those calls.

Embeddings run locally through fastembed. The first run downloads BAAI/bge-small-en-v1.5 from Hugging Face, about 100 MB. The optional reranker downloads cross-encoder/ms-marco-MiniLM-L-6-v2 from Hugging Face.

Prefetch, turn sync and reflection run on background threads. Vault promotion writes proposal files only to paths you configure. There is no telemetry, no self-updater, no shell command and no compiled binary.

License

MIT — see LICENSE.

Built on SQLite with sqlite-vec and fastembed. Made for Hermes Agent.

README from the reviewed commit ccac81a; it updates when the author re-pins.

Developer Mode

Explore built-in Hermes toolsets and actions.

HermesAgent

Developer?

Create a Hermes extension for Desktop or agent workflows.

Developer Section