Skip to main content

SurrealDB Spectron memory provider for the Hermes Agent runtime

Project description

Spectron ⇄ Hermes Agent

A Hermes Agent memory provider backed by SurrealDB Spectron — provenance-first, tri-temporal agent memory with semantic, lexical, graph and temporal recall.

Once installed and selected, the agent automatically:

  • recalls relevant memories before every turn,
  • writes each completed turn back to Spectron (asynchronously),
  • consolidates memory when a session ends,

and gains six explicit memory tools it can call directly.

Requirements

  • Python 3.10+
  • A running Hermes Agent install (verified against Hermes Agent 0.18.2)
  • Spectron access (endpoint, context, API key). Spectron is in invite-only preview.

Install

pip install spectron-hermes

This pulls in the SurrealDB SDK (surrealdb v3, which bundles Spectron) and registers the plugin with Hermes via the hermes_agent.plugins entry point.

Alternative: drop-in directory

If your Hermes setup discovers memory providers by directory, copy the package into $HERMES_HOME/plugins/spectron/ (it ships a plugin.yaml manifest for this) and pip install "surrealdb>=3.0.0a4".

Configure & activate

Provide credentials via the environment (the API key is a secret and belongs in .env):

export SPECTRON_API_KEY="..."
export SPECTRON_ENDPOINT="https://your-instance.spectron.dev"
export SPECTRON_CONTEXT="my-context"

Then select the provider — Hermes will prompt for any missing settings:

hermes memory setup      # choose "spectron"
hermes memory status     # confirm it is active
hermes                   # run a session with Spectron-backed memory

Non-secret settings are written to $HERMES_HOME/spectron.json.

Configuration

Setting Env var Default Notes
api_key SPECTRON_API_KEY secret, required (stored in .env)
endpoint SPECTRON_ENDPOINT required, origin with no trailing slash
context SPECTRON_CONTEXT required; Spectron pins a client to one context
recall_mode SPECTRON_RECALL_MODE hybrid hybrid | context | tools
write_frequency SPECTRON_WRITE_FREQUENCY turn turn | session
top_k SPECTRON_TOP_K 5 memories recalled per turn
default_scope SPECTRON_DEFAULT_SCOPE e.g. user/tobie; scope for writes / lens for reads

Recall modes: hybrid injects raw recalled memories before each turn; context injects a synthesised answer instead; tools injects nothing and lets the model recall explicitly via spectron_recall / spectron_context.

Tools exposed to the agent

Tool Spectron call Purpose
spectron_recall(query, k?) recall Search memory (semantic/lexical/graph/temporal).
spectron_remember(text, scope?) remember Store a durable fact.
spectron_context(query, k?) query_context Synthesised answer from memory.
spectron_forget(query, purge?) forget Supersede (default) or hard-delete.
spectron_reflect(query, persist?) reflect Derive insights; optionally persist.
spectron_upload(path, title?) documents.upload Ingest a document into knowledge memory.

Reliability

The provider is built to never destabilise the agent:

  • Writes run on a background daemon thread — turns never block on I/O.
  • Every Spectron call is wrapped; failures are logged and degrade to empty results rather than raising into the agent loop (fail open).
  • After repeated failures (or an auth error) a circuit breaker disables memory for the rest of the session.

Development

pip install -e ".[dev]"
pytest

Tests use a mock Spectron client and need neither a live server nor the surrealdb SDK installed.

License

Apache-2.0

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

spectron_hermes-0.3.0.tar.gz (22.7 kB view details)

Uploaded Source

Built Distribution

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

spectron_hermes-0.3.0-py3-none-any.whl (19.4 kB view details)

Uploaded Python 3

File details

Details for the file spectron_hermes-0.3.0.tar.gz.

File metadata

  • Download URL: spectron_hermes-0.3.0.tar.gz
  • Upload date:
  • Size: 22.7 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? Yes
  • Uploaded via: twine/6.1.0 CPython/3.13.13

File hashes

Hashes for spectron_hermes-0.3.0.tar.gz
Algorithm Hash digest
SHA256 7b57c07af80b19524f731331366fa74219dbbc25b6b91fb1c46aeb8e28478b46
MD5 70c3ef9e92ff24231778868472666261
BLAKE2b-256 7463e9fc096acad7d39147a14583dff14e9d87c41a82abfee8cfa535de06130c

See more details on using hashes here.

Provenance

The following attestation bundles were made for spectron_hermes-0.3.0.tar.gz:

Publisher: release.yml on surrealdb/spectron-hermes

Attestations: Values shown here reflect the state when the release was signed and may no longer be current.

File details

Details for the file spectron_hermes-0.3.0-py3-none-any.whl.

File metadata

  • Download URL: spectron_hermes-0.3.0-py3-none-any.whl
  • Upload date:
  • Size: 19.4 kB
  • Tags: Python 3
  • Uploaded using Trusted Publishing? Yes
  • Uploaded via: twine/6.1.0 CPython/3.13.13

File hashes

Hashes for spectron_hermes-0.3.0-py3-none-any.whl
Algorithm Hash digest
SHA256 eae388152d796d807b577a67e4d4a089c78ac64678c1fbb6a4c8c2529bdf091f
MD5 3cec5f96ac263c70a465e0b3181136b1
BLAKE2b-256 0c3f08a97b856737f420a971a25a920df22b5c8ac4a705dff24130bb95c6f5c2

See more details on using hashes here.

Provenance

The following attestation bundles were made for spectron_hermes-0.3.0-py3-none-any.whl:

Publisher: release.yml on surrealdb/spectron-hermes

Attestations: Values shown here reflect the state when the release was signed and may no longer be current.

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