symfonic.memory.layers.prospective¶
prospective ¶
ProspectiveLayer -- triggers, reminders, and pending tasks.
Stores triggers as graph nodes with condition and task properties.
Supports resolution (marking triggers as completed).
ProspectiveLayer ¶
ProspectiveLayer(
graph_store: GraphMemoryStore,
embedding_provider: EmbeddingProvider | None = None,
embedding_cache: EmbeddingCache | None = None,
)
Prospective memory layer for triggers and reminders.
BaseMemoryStore contract
- retrieve: returns [] -- triggers are NOT generic hydration hits
- write: stores a trigger as a graph node
- summarize: returns empty string
- link: no-op
- delete: removes a trigger node
v7.3 Item 13.1: optional embedding_provider for auto-embed.
Default None preserves byte-identical pre-Item-13.1 behaviour.
When supplied, every set_trigger write runs through
:func:maybe_embed so prospective triggers auto-embed when the
caller leaves node.embedding=None. Caller-provided embeddings
always win.
Per-kind embedding-text rule: triggers always fall into the
default branch of
:func:symfonic.memory.embeddings.auto_embed.resolve_embedding_text
and embed properties['content'] (the trigger's human-readable
description) rather than the label.
Source code in src/symfonic/memory/layers/prospective.py
delete
async
¶
get_pending
async
¶
Get all unresolved triggers for the tenant.
Source code in src/symfonic/memory/layers/prospective.py
link
async
¶
render_for_prompt ¶
render_for_prompt(
entry: Any,
scrubber: Callable[[dict[str, Any]], dict[str, Any]]
| None = None,
) -> str
Render a prospective entry for MEMORY_CONTEXT.
v7.7: explicit override delegating to :func:render_legacy
for byte-identical pre-v7.7 output. Prospective triggers
don't carry the v7.5+ skill-aware metadata signals so a
layer-specific shape would have no upside.
Source code in src/symfonic/memory/layers/prospective.py
resolve_trigger
async
¶
retrieve
async
¶
Return [] -- prospective triggers are not generic hits.
Previously this bulk-dumped every unresolved trigger via
get_pending regardless of query, so a bare "Hello"
recited all pending reminders into MEMORY_CONTEXT. Pending
triggers surface only through the dedicated PROSPECTIVE_TASKS
prompt channel and the explicit :meth:get_pending API; they
must never enter per-turn semantic hydration. Callers that need
the trigger list must call :meth:get_pending directly.
v7.22 T-7.22.10: emits :class:MultiScopeIgnoredWarning on first
encounter of a scope carrying inherits_from. Consistency with
the other non-procedural layers -- even though the result is
always [], adopters wiring a multi-scope scope through every
layer get exactly one warning per layer rather than a silent gap.
Source code in src/symfonic/memory/layers/prospective.py
set_trigger
async
¶
Store a trigger with condition and task properties.
The trigger's metadata should include 'condition' (str) and 'task' (str) keys.