Stash synthesis
Type: agentic-system-analyses/types/agentic-system-synthesis.md
Bounded synthesis
From caller reports to persistent memory
Stash is a self-hosted memory system for agents, not the runtime that owns an agent's task. It stores caller observations and typed state, uses models to derive and assess retained content, and returns selected memory through CLI and MCP interfaces. This account covers the shipped callers, instructions, maintenance drivers and storage at commit d34ed430c4348ef741ef95146b488aea8616f4fb, with an applicability cutoff of 2026-10-15. Its evidence is inspected implementation and doctrine/design from SRC-1, https://github.com/alash3al/stash. No target execution, model output trace or causal experiment was supplied. External agent decisions, dependency internals and the separately implemented Stash Cloud product are outside the boundary. See the boundary and evidence and Source register.
The ordinary interaction is caller → MCP/CLI handler → Go Brain API → embedding provider and PostgreSQL → serialized result. The caller supplies content and chooses the next task action. For remember, Brain validates input, resolves an exact existing namespace, embeds the text and inserts an episode. It does not verify the reported event or determine whether a human approved it. Successful return is an episode ID, not verification of the original task. Natural-language reports, dense vectors and symbolic metadata are distinct retained parts; model weights remain external. RT-RTE-remember-write, MEM-OBJ-episode, MEM-OBJ-memory-vectors.
The shipped session protocol asks agents to initialize, recall relevant history, store durable observations and save a closing summary. These instructions explain the intended workflow but do not enforce call order. The representative source-supported workflow is therefore remember a session observation → consolidate it → recall relevant memory later, not an observed successful session or an autonomous task-solving loop. Stash owns storage and maintenance; the external agent owns adherence, answer composition and user-facing delivery. RT-CLM-session-protocol, RT-BAP-agent-protocol, workflow account.
Maintenance proposes content; code admits it
Manual commands, MCP calls and service timers converge on an eight-stage maintenance controller: episode-to-fact processing, relationships, causal links, goal progress, failure patterns, abstractions, hypothesis assessment and confidence decay. Go code chooses stages and batches; bounded model calls propose semantic results, not tool executions or independent sub-agent plans. Model/endpoint labels are configurable, and the inspected adapters do not train weights or pin immutable deployed model versions. RT-RTE-consolidation-run, RT-CMP-openai-reasoner, RT-CMP-openai-embedder.
In the principal fact-admission route, checkpoint-selected episodes are clustered by vector similarity and their texts sent to the reasoner. Code decodes structured output, rejects copying, embeds nonempty summaries, suppresses similar facts and inserts retained beliefs. The extraction-only prompt requests faithfulness, but the lexical validator does not check entailment: the epistemic report's implementation countercase shows that an unrelated novel assertion passes while a verbatim source sentence fails. Confidence arithmetic and JSON validity supply narrower controls, not factual warrant. Source associations are attempted after insertion, with errors ignored. EPI-RTE-fact-synthesis, RT-BAP-extraction-policy.
Nor does every stored fact pass that route. Failure review directly admits embedded pattern facts without its source associations or extraction checks. Hypothesis confirmation copies an existing belief into a fact. Consequently the protocol's “verified facts” label cannot license uniform truth, provenance or admission guarantees. Relationship endpoint checks, pattern reference counts and causal-link ID checks similarly constrain structure rather than establish semantic or causal correctness. A traversable causal graph establishes reachability, not an experimentally demonstrated causal effect. MEM-OBJ-fact, MEM-RTE-failure-derivation, MEM-CLM-verified-facts, EPI-RTE-relationship-extraction, MEM-RTE-pattern-extraction, EPI-RTE-causal-links.
There is nevertheless genuine evidence-consuming assessment. The hypothesis scan compares open belief text with up to 30 new retained facts. Model support above a configured threshold moves a proposed belief to testing; a later eligible assessment can confirm a testing belief into fact use. Contradiction can reject it with retained reasoning. This is a consequential evaluation over supplied text, not execution of the stored verification plan or independent empirical validation. Supporting rationale and the particular supporting fact IDs are not retained as a complete acceptance record. Direct caller confirmation is different: it takes an ID and requests no evidence. CLI exposes the direct transition to testing; MCP confirmation needs testing status obtained elsewhere. EPI-RTE-hypothesis-assessment, EPI-RTE-hypothesis-control.
Other maintenance outputs have distinct consequences. Model goal judgments append advisory progress notes rather than complete goals; caller completion can aggregate to ancestors. Failure review retains repeat evidence as unembedded episodes, available to later consolidation but not ordinary semantic recall, while its embedded pattern facts can be recalled directly. Abstraction patterns have a library query affordance, but no concrete shipped reader was found in the inspected Go tree. These differences rule out treating all generated memory as equally available or equally authoritative. MEM-RTE-goal-maintenance, MEM-RTE-failure-derivation, MEM-OBJ-pattern.
Recovery and later delivery
The pipeline supports partial progress, not atomic maintenance. A structured parse/anti-copy failure can cause one further application-level model attempt. A later batch replay requires another caller or timer invocation. Stage errors can be embedded in a result despite a nil top-level error, and earlier writes survive. Stage-one errors inhibit its normal checkpoint advance, while some secondary stages advance despite output-write errors. Relationship processing also advances a fact watermark subsequently reused by causal extraction, so successful relationship processing can deprive that causal stage of the same batch. Completion counters establish neither all-stage success nor exactly-once processing. RT-RTE-consolidation-run, MEM-RTE-edge-extraction, workflow account.
Later recall embeds a caller query and resolves namespace subtrees. Facts fill slots first; episodes fill only remaining slots, and the selected set is then sorted. This is not a global joint ranking of both kinds. The default limit is 10 rows, capped at 100, not a model token budget. Returned fact text lacks source links and validity metadata. Typed tools expose other retained fields through separate requested reads. Maintenance independently selects and supplies retained batches to its reasoner; background persistence is not unsolicited delivery into a foreground agent's context. RT-RTE-recall-read, MEM-RTE-typed-read, MEM-BAP-maintenance-input.
Working focus is another requested route: one persistent, replaceable text per exact namespace. Its getter does not enforce the stored expiry. Neither focus nor durable recall controls which messages an external agent evicts or preserves in its own window. Namespace selection also does not establish caller authorization, and the secondary write interfaces do not uniformly share remember's exact-namespace targeting. RT-RTE-context-handoff, report verification limits.
Correction is especially local. Expiry and automatic supersession set fact validity metadata, but recall and maintenance fact selection do not filter it. Resolving a contradiction hides the conflict from unresolved listings without repairing either fact. Forgetting an episode excludes that episode from ordinary search but does not recompute its derived facts. Thus obsolete content can remain both retrieved context and input to further derivation. These inspected paths do not support complete withdrawal or erasure guarantees. MEM-RTE-fact-withdrawal, EPI-RTE-contradiction-review.
What the retained changes establish
The strongest supported experience-fed contribution is automatic failure review: reports of activity feed durable repeat evidence and pattern facts that have later maintenance or recall consumers. Session-bearing episodes can likewise feed retained summaries. This establishes implemented trace-fed artifact updates, without authenticating the reports or demonstrating improved future capacity. Their original input formats are unresolved, so they cannot be classified as recorded turns, tool traces, event streams or trajectories merely because Stash stores them as episodes. MEM-RTE-failure-derivation, MEM-OBJ-episode, profile verification.
For theory building, the supported account is conditional on a caller supplying an explanatory theory rather than arbitrary belief text. Condition 1, localized theory content, is afforded, with actual theory content uninspected. Condition 2, statement-dependent consumption, is wired. Condition 3, content-directed criticism identifying challenged content, result and blame, has no agreed demonstrated status: memory calls it claimed, while epistemic calls it uninspected. Condition 4 has wired status-sensitive later selection, but criticism-specific iteration remains uninspected. These partial mechanisms do not establish a complete theory builder. Whole beliefs/plans are addressable and persistent; finer assumption-level addressability is not established. MEM-RTE-hypothesis-maintenance, EPI-RTE-hypothesis-assessment, report verification limits.
Whether criticism of a consumed theory improves future action remains uninspected: no content-specific criticism history or capacity comparison was supplied. Reflection is separately uninspected, without an operative self-representation instance and both causal directions. Autonomous theory building is separately uninspected: internal evidence assessment does not establish computational ownership of every theory-building role or external testing. Scheduled maintenance does not settle those properties. At this self-hosted boundary, exercised self-improvement is also unestablished: retained content reaches later selection and model-input paths, but no trace closes subsequent behavior's causal dependence on an improvement-directed change. The /self protocol affords external standing advice, not demonstrated reflective or self-improving operation by Stash or its client. EPI-RTE-hypothesis-assessment, MEM-BAP-retained-advice, EPI-CLM-memory-learning.
For the representative session-memory scenario, the supported result is a connected implementation for persistence, model-driven curation and selective delivery. Verified truth, reliable correction and improved answers remain separate questions. Source/output comparisons and truth-labelled evaluations could establish semantic faithfulness and calibration; retained acceptance rationales could make promotions auditable. Consumer-side validity enforcement and derivative-withdrawal handling would change the correction assessment. An inspectable session/restart trace would establish bounded operation; a comparison varying retained updates, with later-consumer traces, could assess capacity benefit and self-improvement attribution. These would extend the evidence, not retroactively turn the present code account into observed success. EPI-RTE-fact-synthesis, MEM-RTE-fact-withdrawal, workflow account, EPI-RTE-hypothesis-assessment.
Limitations
| Limitation | Affected SRC IDs and record citations | Inspected boundary | Conclusion prevented | Evidence that would resolve it |
|---|---|---|---|---|
| Unresolved theory-builder condition-3 assessment: memory says claimed; epistemic says uninspected. | SRC-1; MEM-RTE-hypothesis-maintenance, EPI-RTE-hypothesis-assessment; report verification limits. | Hypothesis model inputs, rejection persistence and subsequent selectors at the reviewed commit. | One agreed or demonstrated condition-3 status, or a complete theory-builder conclusion based on it. Conditions 2 and 4 retain their independent supported mechanisms. | A retained theory/criticism instance identifying challenged claim, result and blame, its changed reliance or revision, and the later round consuming that result. |
| Secondary caller write targeting is incompletely characterized and differs from exact remember/focus lookup. | SRC-1; MEM-RTE-goal-maintenance, MEM-RTE-failure-derivation, MEM-RTE-hypothesis-maintenance, EPI-RTE-causal-links; report verification limits. | Secondary adapters select the first returned subtree namespace ID; the inspected lookup is unordered. | Uniform exact-write-namespace guarantees, particularly for root or parent namespaces with descendants. | A complete adapter/selector account establishing destination rules, or explicit exact-target selection in implementation, with corresponding tests or traces. |
| Implementation and instructions are not observed execution or causal benefit. | SRC-1; boundary, RT-RTE-consolidation-run, RT-RTE-recall-read, EPI-RTE-hypothesis-assessment, workflow account. | Frozen source only; no target execution, deployed configuration or client history. | Operational reliability, client adherence, learning benefit, content-specific reflection/autonomy and exercised self-improvement. | Linked execution and later-consumer traces; objective-specific comparisons with independently varied updates for causal attribution. |
| Upstream content, semantic relations and acceptance provenance remain unresolved. | SRC-1; MEM-OBJ-episode, MEM-OBJ-fact, EPI-RTE-fact-synthesis, EPI-RTE-hypothesis-assessment, MEM-RTE-failure-derivation. | Caller reports, formatted model inputs and producer-specific persistence. | Authenticated events, known original trace classes, calibrated truth, a complete retained rationale, or an accepted produced ampliative instance. | Original inputs with provenance; source/output comparisons; retained evidence-consuming decisions and quality evaluations scoped to intended use. |
| Available inspection and external dependencies do not constitute a complete interface, security, recovery or erasure audit. | SRC-1; MEM-RTE-typed-read, MEM-OBJ-pattern, MEM-OBJ-settings, MEM-RTE-fact-withdrawal, RT-CMP-openai-embedder; report verification. | Some secondary adapters/prose, schema recovery and further settings consumers incompletely inspected; provider/deployment internals outside source boundary; pattern/getter later consumers unresolved. | Exhaustive consumer inventories, complete derivative cleanup, deployed isolation, immutable model identity or semantic compatibility across models. | Focused inspection of relevant remaining adapters/constraints and actual consumers, plus registered deployment/provider evidence at a declared boundary. |