Skip to main content
<Memory> provides one memory configuration to every descendant <Task>. Each task receives that configuration in TaskDescriptor.memoryConfig. A task-level memory={...} prop replaces the inherited configuration for that task. Provider and task-level configurations use the same validation and defaults, including the positive safe-integer maxTokens bound and the bank/banks exclusivity check.

Props

At least one non-empty bank is required after inheritance. Nested <Memory> components inherit omitted fields. Setting bank or banks on an inner component replaces the parent bank selection.

Prompt injection

Before an agent task starts, Smithers fetches the configured primers and recalls memories from every bank. It prepends the result inside a fenced <smithers_memory_context> block. maxTokens caps the complete block so recalled context cannot crowd out the task instructions. Smithers applies a conservative UTF-8 byte ceiling to remain within the limit without depending on a specific model tokenizer. The same ceiling covers the complete serialized result returned by the recall tool. Tasks with an active bank or banks memory configuration bypass task-output caching. Their recalled snapshot can change while the prompt, agent, and worktree stay the same, so reusing an older task result would skip recall and return stale output. Legacy-only memory metadata is inert and keeps the task’s existing cache semantics. The memory snapshot itself remains frozen across retries of one task execution. Recall and primer reads are advisory. A timeout or backend error logs a warning and runs the task with its original prompt. A memory failure never fails the task. Missing mental-model ids are handled per bank. For example, user-primer can exist only in the user bank and project-primer only in the project bank; both valid primers are still injected.
Set recall={false} for tools-only memory:

Banks, tags, and run identity

Banks are isolation boundaries. Use a user bank for personal preferences and a project bank for team knowledge. Use stable, recall-relevant tags below the bank boundary:
Do not put run ids, task ids, session ids, or project ids in tags. Smithers records volatile identity in Hindsight metadata and uses a stable per-run document id with append mode. This preserves provenance without fragmenting Hindsight observation consolidation. Use scope:main only with branch:main. Use scope:branch for branch-local writes. You may omit the scope tag on a project bank; Smithers derives it from the single configured branch tag. A tagless project-bank write defaults to scope:main, which matches the canonical project recall filter. A conflicting explicit scope is rejected before retention. Smithers applies the standard two-bank recall policy automatically:
  • user-* banks do not receive project branch, stream, or scope filters.
  • project-* banks use a tag_groups-only filter for (scope:main OR branch:current), then apply configured stream:* and other tags as additional constraints.
  • Other bank names use all configured tags as a strict filter.
The recall tool preserves those base filters. Tags passed by the agent add stable constraints and cannot widen the configured branch or stream scope. The remember tool rejects volatile tags and rejects project scope tags when writing to a user bank. The local SQLite fallback evaluates the same strict filters before keyword scoring, so branch-local facts cannot cross into another branch recall.

Backend selection

Hindsight is a Postgres-family feature. The Hindsight service stores its data in Postgres 15 or later with pgvector. Smithers selects it only when HINDSIGHT_URL is set. openSmithersBackend performs this selection and attaches the resulting memory service to every workflow it creates.
Use one HindsightMemoryStore writer instance per transactional contract store. Same-document projections are serialized inside that instance only. Separate instances can project competing mutations out of order because the process-local queues do not share a durable version fence.
When workflow state uses PGlite or Postgres and Hindsight is unset, Smithers keeps the fallback facts in the local .smithers/smithers.db sidecar. The workflow database remains on its selected backend.
HINDSIGHT_API_KEY and HINDSIGHT_BANK_PREFIX are optional. The prefix is applied to every configured bank before requests are sent.

Task-level override

The existing Task.memory prop uses the same TaskMemoryConfig shape and wins over context:
Legacy namespace, remember, threadId, and object-form recall fields remain accepted and preserved on Task.memory for compatibility. They are inert metadata: the engine does not use them for prompt injection, retention, or message history. Use banks, tags, recall mode, primers, retention, and tools for runtime memory.