HarnessRuntime.recall when the host has bounded source discovery/read APIs, and add taskSummary when archived history should contribute incremental summaries. Both are optional; they do not require a built-in database or a persistent learning service.
This guide describes Agentium 4.9.0. Use session history for ordinary conversation reuse and release and upgrade guidance for package versions and compatibility.
Separate canonical history from request context
The harness session store owns controlled canonical history.residentHistory keeps bounded complete message groups in memory and writes evicted groups to a host HistoryArchive before committing the new boundary. Recall and summaries change the task’s model request; they do not turn source content into host instructions.
A summary citation identifies evidence; it does not restore raw source text that was omitted from the prompt. Summary-only context and raw archive inclusion provide different evidence. Preserve uncertainty and avoid treating one task example as a project-wide requirement.
Connect host-owned adapters
This is a complete integration factory. The application supplies a provider, archive, recall store and current-evidence verifier; it does not provision storage or run a model when constructed.runtime.run() with verified { tenantId, userId }, a session ID and optional recallScope: { projectId, repositoryId }. After admitted runs settle, close the session through runtime.resources.closeSession(identity, sessionId) and inspect cleanup diagnostics. The host retains ownership of shared provider/database clients.
Make scope and backend capabilities truthful
RecallStore must advertise bounded discovery/reads, revision validation and bounded current validation. Summary-enabled recall additionally requires canonicalArchiveReads: true, attesting direct bounded seeks of complete canonical archive groups. Constructor checks validate declared capabilities; they cannot certify backend behavior.
open(scope, limits) returns a scoped RecallSession with discover, read, validate and close. Each operation receives its signal, deadline, remaining bytes and remaining estimated tokens. The adapter must enforce authorization and physical I/O bounds, stop backend work on abort, return truthful revisions, and close acquired resources even after cancellation.
Scope includes tenant, user and session, with optional project/repository IDs. A meaningful legacy snapshot without memoryScope requires attestLegacyMemoryScope: true after the host verifies its exact scope. This is an attestation of verified existing data and cannot bypass a mismatched scope. Do not accept caller-provided identity as authentication.
Keep evidence whole and expose omissions
Recall budgets bound queries, candidates, discovery/source/excerpt bytes, estimated evidence tokens, latency and validation. Excerpts include completeness and omitted source/correction/negation context. Evidence is assembled whole; wrapper metadata also consumes the prompt budget. Retrieval policy may stop, request bounded clarification or explicitly continue with uncertainty.currentSessionRecallPolicy stops failed/partial evidence and permits no_accessible_evidence; applications requiring evidence for every answer should reject that status too. Its query is the latest user text; production ranking and query formulation remain host decisions.
Allocation omissions change recall to partial. At that stage the policy must stop or explicitly continue; a clarification request returns recall_assembly_omitted because more input cannot repair an unchanged prompt ceiling. Summary additions advance only across complete canonical groups. Unavailable, changed or incomplete coverage stays explicit and does not silently advance a summary frontier.
Current-view validation runs before task dispatch and session commit. A backend authorization/deletion race can still occur after a validation fence; applications needing atomic publication must supply conditional publication or reconciliation across their stores. Keep sourceViewRevision, summary policy/version, scope and uncertainty with retained records.
Verify completion using current facts
CompletionVerifier.verify(candidate, ctx) reads current host evidence such as artifact digests and test records. verifiedCompletionPolicy() accepts pass; fail stops by default or requests a configured revision; unknown always stops. Candidate claims and successful tool settlement do not prove completion.
Evidence is bounded to at most 32 entries and 8192 serialized bytes, and can be narrowed. Revisions share the original budget. New effects during revisions remain disabled unless allowRevisionEffects: true is explicitly configured, alongside ordinary grants and policy.
Use the optional createHarnessEvalTarget() adapter from @agentium/harness/testing with @agentium/eval to evaluate the actual runtime. Separate discovered/read evidence, prompt inclusion, supported answers, stale facts, abstention and scope. Failed graders retain generated output and report infrastructure failures plus valid-grade denominators; absent grades are not successes. Local recorded-provider evaluations establish contracts, without proving live-model quality gains.
Own memory lifecycle and correction
The host decides which facts become durable memory, their validity, access, correction and forgetting. Ordinary Agent memory remains a separate path; avoid duplicate extraction when the harness owns canonical sessions. Memory injected into model requests is labeled source data and budgets its full wrapper.MemoryManager.rememberWithResult() exposes acknowledgment. Its drain() tracks owned summary/extraction/final-write work, and Agent.close() drains that work before teardown. Inspect truthful drain results and MemoryDrainError; cancel and await active work before close. Busy/closing/closed Agents reject new admission through AgentLifecycleError. Failed teardown remains retryable without reopening execution, and borrowed resources remain host-owned.
See Agent memory, storage identity migration, and the generated continuity contracts before choosing adapters.