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
  • 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.0a1".

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.1.0.tar.gz (22.6 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.1.0-py3-none-any.whl (19.4 kB view details)

Uploaded Python 3

File details

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

File metadata

  • Download URL: spectron_hermes-0.1.0.tar.gz
  • Upload date:
  • Size: 22.6 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.1.0.tar.gz
Algorithm Hash digest
SHA256 85c769b5cfb76c8733f60be012dada48d9955f923f2e21be344166f5d970d11b
MD5 b12a135e3db262da147e6f3cc79b8863
BLAKE2b-256 2c7fbfab0f1634f7d19552ea56096459b4d9a0bbffe5571b93d711a054d92e1f

See more details on using hashes here.

Provenance

The following attestation bundles were made for spectron_hermes-0.1.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.1.0-py3-none-any.whl.

File metadata

  • Download URL: spectron_hermes-0.1.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.1.0-py3-none-any.whl
Algorithm Hash digest
SHA256 2d5567c36906e5cf3678084c763fdd53681e07abb4e311dc0be97e0620d06f32
MD5 a5deda795e118e78eb6707e726258896
BLAKE2b-256 36ee265f324ec2096cbc2040d445ed5bd9534b82bfbf8e6fd9914ca3e6a11702

See more details on using hashes here.

Provenance

The following attestation bundles were made for spectron_hermes-0.1.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