Skip to content

feat(hindsight): offer a starter memory template during setup - #73415

Closed
benfrank241 wants to merge 2 commits into
NousResearch:mainfrom
benfrank241:feat/hindsight-setup-templates
Closed

benfrank241 wants to merge 2 commits into
NousResearch:mainfrom
benfrank241:feat/hindsight-setup-templates

Conversation

@benfrank241

Copy link
Copy Markdown
Contributor

Summary

hermes memory setup currently leaves the user with a blank Hindsight bank — the "day-one empty brain." This adds an optional step that seeds the bank with a starter template so the agent's memory arrives already configured (mission, dispositions, mental models, directives) for its use case.

It reuses Hindsight's existing Bank Templates feature (the catalog behind hindsight.vectorize.io/templates) and its import API — nothing new server-side.

Flow

After config is saved (cloud / local_external), the wizard:

  1. Fetches the templates catalog and filters to entries tagged for the hermes integration.
  2. Shows a picker (with Blank always available).
  3. On selection, fetches the manifest and POSTs it to /v1/default/banks/{bank}/import (which creates the bank if needed and applies config + mental models + directives).

It's best-effort and non-fatal — any network/apply failure just prints a hint and continues. Skipped for local_embedded (its daemon isn't running during setup).

Details

  • New plugins/memory/hindsight/templates.py keeps the logic out of the provider module and testable.
  • Catalog source defaults to the Hindsight docs repo and is overridable via HINDSIGHT_TEMPLATES_URL (pin a version / point at a mirror).
  • Auth uses the API key from .env/environment; OAuth-only users (no hsk_ key) will see the graceful "apply one later" hint.

Tests

tests/plugins/memory/test_hindsight_templates.py (8, all passing):

  • hermes-only filtering of the catalog
  • manifest URL resolution (relative → absolute)
  • the import POST (correct endpoint + Authorization header + body; and omitted auth when no key)
  • picker orchestration: applies the selection, skips on Blank, no-ops with no templates, swallows fetch errors
scripts/run_tests.sh tests/plugins/memory/test_hindsight_templates.py   # 8 passed

(The 2 pre-existing test_hindsight_provider.py::TestConfig/TestAvailability failures reproduce on clean main and are unrelated.)

Depends on

The Hermes starter templates land in vectorize-io/hindsight#2996 (adds the hermes-tagged templates to the catalog). Until that merges, the picker filters an empty set and the step no-ops cleanly.

`hermes memory setup` left the user with a blank bank. Add an optional step
(cloud / local_external) that fetches the Hindsight Bank Templates catalog,
shows the ones tagged for Hermes, and applies the chosen manifest to the
bank via the import API — so the agent's memory arrives pre-configured with a
mission, dispositions, mental models, and directives for its use case.

- New `plugins/memory/hindsight/templates.py`: fetch catalog (filtered to the
  `hermes` integration), fetch a manifest, and POST it to
  `/v1/default/banks/{bank}/import` (which creates the bank). Catalog source is
  overridable via `HINDSIGHT_TEMPLATES_URL`.
- Wizard: after config is saved, offer a template picker (Blank is always an
  option). Best-effort and non-fatal — network/apply failures just skip.
- Skipped for local_embedded (its daemon isn't running during setup).
- Tests cover the hermes filter, manifest URL resolution, the import POST
  (endpoint + auth), and the picker orchestration (apply / blank / none / error).
@alt-glitch alt-glitch added type/feature New feature or request comp/plugins Plugin system and bundled plugins tool/memory Memory tool and memory providers area/memory Memory subsystem: store, providers, sync, background reviews P3 Low — cosmetic, nice to have labels Jul 28, 2026
…mplate step

Follow-ups on the setup-wizard starter-template step:

- Warn on re-apply: before applying a template, probe the bank (export
  endpoint). If it already has config / mental models / directives, confirm
  before overwriting ("Apply" vs "Keep existing"). Best-effort — a missing
  bank or any probe error is treated as not-customized and proceeds.
- Testable mode gate: extract `supported_for_mode()` (cloud / local_external)
  and use it in the wizard so local_embedded is provably skipped.
- Tests: apply-time failure (e.g. 401 for OAuth-only users) is swallowed with
  a hint; the customization probe (config present / empty / error); and the
  warn flow (keep-existing declines, confirm applies, fresh bank skips the
  prompt). 16 tests total.
@benfrank241

Copy link
Copy Markdown
Contributor Author

Follow-ups pushed:

  • Warn before overwriting — re-running setup on an already-configured bank now probes the bank (export endpoint) and, if it has config/mental-models/directives, confirms before applying (Apply vs Keep existing). Best-effort: a missing bank or any probe error is treated as not-customized and proceeds silently.
  • Provably skips local_embedded — extracted supported_for_mode() (cloud / local_external) and gate the wizard on it.
  • Hardened + tested — apply-time failures (e.g. a 401 for OAuth-only users) are swallowed with a hint; added tests for the probe (config present / empty / error) and the warn flow (decline keeps existing, confirm applies, fresh bank skips the prompt). 16 unit tests.

@benfrank241

Copy link
Copy Markdown
Contributor Author

Superseded by the combined PR #74379 — same changes bundled into a single review surface. Closing this one to consolidate.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

area/memory Memory subsystem: store, providers, sync, background reviews comp/plugins Plugin system and bundled plugins P3 Low — cosmetic, nice to have tool/memory Memory tool and memory providers type/feature New feature or request

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants