# Eve Memory, Grounding, and Continuity

Eve needs enough context to be useful without turning context into invisible
surveillance, memory into an unbounded profile, or retrieved text into asserted
fact. Page context, conversation state, memory, and grounding are separate
systems with separate disclosures and retention rules.

```mermaid
erDiagram
  MEMBER ||--o{ CONVERSATION : owns
  CONVERSATION ||--o{ TURN : contains
  PAGE_CONTEXT ||--o{ TURN : informs
  MEMBER ||--o{ MEMORY_RECORD : subjects
  CONSENT ||--o{ MEMORY_RECORD : permits
  TURN }o--o{ MEMORY_RECORD : may_recall
  TURN ||--o{ GROUNDING_REQUEST : asks
  GROUNDING_REQUEST }o--o{ SOURCE : retrieves
  GROUNDING_REQUEST ||--o{ CLAIM_SUPPORT : produces
  CLAIM_SUPPORT }o--o{ SOURCE : cites
  TURN ||--o{ DISCLOSURE : renders
  MEMORY_RECORD ||--o{ TOMBSTONE : forgets
```

The relationships are deliberately non-substitutable: page context informs a
turn, consent permits a memory record, and sources support claims. None of those
edges silently turns selected text or a retrieved passage into durable truth.

## Four context layers

| Layer                | Purpose                                                                             | Lifetime                                                     | User-visible expectation                                                       |
| -------------------- | ----------------------------------------------------------------------------------- | ------------------------------------------------------------ | ------------------------------------------------------------------------------ |
| Page context         | Understand the current route, artifact, selection, and evidence state.              | Current invocation/turn unless explicitly carried.           | The user can see what page or selection the assistant is using.                |
| Conversation history | Preserve turn order and local coherence.                                            | Session or durable thread under retention policy.            | History is inspectable and deletable according to the product contract.        |
| Iris memory          | Recall permitted preferences, facts, and continuity records across declared scopes. | Scope-specific retention, decay, compaction, and tombstones. | Memory posture, source, edit/pause/forget controls, and opt-out are available. |
| Sophia grounding     | Bind claims to governed sources and expose evidence state.                          | Source-set and answer records under evidence lifecycle.      | Citations, support state, and limitations accompany the answer.                |

Do not substitute one for another. Selected text is not profile memory; chat
history is not verified evidence; a retrieved passage is not automatically a
supported claim; an operator's session context is not durable operator memory.

## Page-context handoff

The client context envelope can carry route, active domain/workspace, artifact
kind and identifier, selected text, evidence state, and permitted tool grants.
The server must validate rather than trust these fields. It should resolve the
actor's access to referenced artifacts and remove data that the selected task
family does not need.

Useful context is minimal and typed:

- stable identifiers instead of scraped page prose where possible;
- explicit selection ranges instead of an entire document;
- evidence identifiers instead of decorative badge text;
- permitted grants instead of a client assertion that an action is allowed;
- freshness/version fields where stale context would change the answer.

The customer handoff is exercised by
[Assistant handoff context carry](../../../WALKTHROUGH/journeys/assistant-handoff-context-carry.md).

## Conversation continuity

Conversation storage is append-oriented and policy-bound. A durable thread
preserves actor, tenant, persona, turn ordering, tool receipts, retention class,
and erasure fences. History compaction may summarize earlier turns for the
model, but it must not rewrite the authoritative transcript or convert
unsupported statements into facts.

Reconnect and cross-device continuation use explicit tokens and conflict
handling. A resumed surface should show when context was restored, when some
state could not be carried, and when a fresh authorization check changed the
available tools.

## Iris memory

Iris owns the canonical memory scopes, governance metadata, retention windows,
decay, compaction, consent records, recall-resolution algorithm, conflict rules,
privacy-aware suppression, data-subject rights, and operator inspection regime.
The complete contract is
[Iris Memory and Identity](../../features/iris-memory-identity.md).

Assistant behavior must preserve these invariants:

- memory reads are bounded by actor, tenant, purpose, and scope;
- sensitive categories require their declared consent and suppression policy;
- inference is not silently promoted to confirmed memory;
- conflicting entries are resolved visibly and deterministically;
- pause/forget requests take effect at the server boundary, not only in UI copy;
- deletion leaves the required tombstone/erasure fence so old replicas or
  imports do not resurrect data;
- recalled items retain provenance and can be explained to the user.

Builder/operator continuity needs its own authorized scope and disclosure. It
must not reuse member profile memory or hide durable storage behind a label such
as “session only.”

## Sophia grounding

Sophia's grounded-answer path composes claims from governed sources, labels
support, and returns an answer envelope with evidence. Extractive behavior is
the safe default; optional abstractive enhancement is a gated seam. The source
credibility engine, corroboration floor, claim labels, and unwired/spec-only
surfaces are documented in
[Sophia Grounding](../../features/sophia-grounding.md).

Grounding presentation should answer:

1. Which claims are supported, mixed, unsupported, or refused?
2. Which source records support each claim?
3. How fresh and authoritative are those sources?
4. Was the answer extractive, transformed, or model-enhanced?
5. What limitation or contradiction should the reader know?

Evidence chips and badges must be derived from the answer/source state. The UI
must not infer “grounded” from the mere presence of a citation-like URL.

## Retrieval and docs search

Docs search is a bounded retrieval tool over the generated Docs Center corpus.
It should return canonical pages/sections and source links, preserve audience
and layer facets, and say when the corpus lacks an answer. Search results are
context for a response; factual claims still follow grounding policy.

When Eve assists a builder, documentation results may inform a proposal but do
not replace current database/workbench state. When Lilith assists a member,
internal-only docs must remain outside the permitted corpus.

## Privacy, retention, and data rights

Every persistence layer must name its controller/owner, purpose, actor and
tenant keys, retention policy, export behavior, deletion behavior, audit event,
and redaction boundary. The transcript, memory ledger, grounding records,
telemetry, and tool receipts may have different lawful purposes and retention;
“assistant data” is not one undifferentiated bucket.

The supported member flow is documented and tested in
[Memory edit, pause, and forget](../../../WALKTHROUGH/journeys/memory-edit-pause-forget.md)
and
[Account deletion and DSAR](../../../WALKTHROUGH/journeys/account-deletion-and-dsar.md).

## Degraded and conflict states

- No page context: answer generally and state that the current artifact was not
  available.
- Stale artifact version: refresh, ask for confirmation, or decline the action.
- Memory off/paused: do not recall or write durable entries; keep the disclosure
  truthful.
- Conflicting memory: surface the conflict and use the canonical resolution
  policy.
- Grounding below threshold: label the limitation or refuse the factual claim.
- Source revoked or retracted: invalidate downstream answers and avoid citing
  the stale source set.
- Resume authorization changed: remove inaccessible history attachments/tools
  while preserving an honest continuity notice.

## Related

- [Safety, governance, and privacy](./safety-governance-and-privacy.md)
- [Surfaces and invocation](./surfaces-and-invocation.md)
- [Iris Memory and Identity](../../features/iris-memory-identity.md)
- [Sophia Grounding](../../features/sophia-grounding.md)
- [Search, discovery, and knowledge graph](../../architecture/search-discovery-knowledge-graph.md)
