Dense-Mem

The life of a memory

Follow a note from the fictional Atlas team through intake, Topic assignment, Recall, and back to its source.

Open the interactive lesson

Remember · Step 1

Send the original note

The submitted item

One source item moves into Remember.

One item contains two independent statements and the line break between them.

An engineer asks an assistant to remember an operations handoff for the Atlas team. The assistant sends both lines together in one remember call.

It supplies the exact text, a source label, the team_shared destination, and a fresh operation key. A later reader can ask about either line.

How would a private chat enter instead?

The request below uses a plain source label. Dense-Mem also accepts a source key and revision token for a versioned document. The example uses short labels E1, E2, and E3 for illustrative Evidence UUIDs.

For a chat, ingest_session stages the incoming user events in the caller’s private space. Extraction selects exact excerpts from the current events and preserves their original character offsets. Earlier events can supply context. An empty selection completes with no_memory.

Selected session excerpts go through assessment and required embeddings before private publication. The owner can recall them. Topic assignment applies to eligible team-shared Evidence.

remember arguments

See the tool's argument fields in the Technical Reference.

Remember · Step 2

Check who can write and replay

Admission and replay

The server authorizes the shared destination and checks the request key.

The destination comes from the request. Authentication supplies the actual space and owner.

Dense-Mem resolves the team-shared destination from the engineer’s grants. It validates the input, runs the initial security scan, and checks whether this request has already finished.

This key is new, so processing continues. If the reply gets lost after a successful commit, sending the same request and key retrieves its recorded result.

What if the same key arrives twice?

The service hashes the request and serializes attempts for that key within the authenticated team and owner. A simultaneous caller waits for the first attempt’s outcome. Changing the payload under that key produces a conflict.

The destination matters here. A read-only team member can write their own private memory. Writing into the shared space requires the appropriate shared grant. A payload field cannot grant that access.

Remember · Step 3

Split the note by meaning

The exact source spans

The server splits the original at the newline and preserves it in the first slice.

↵ marks the stored newline. The two slices join back into the exact original.

Snapshot retention and desk hours make sense independently. The server marks allowed cut points, and the partitioning model selects the boundary between these two statements.

Dense-Mem slices the original text itself. A includes the newline at the end of the first line. B starts on the next line. Offsets count Unicode code points, and each span’s end is exclusive.

Who controls the wording and boundaries?

The model returns server-issued boundary IDs in source order. Dense-Mem checks the request identity, coverage, ordering, and nonblank slices. Every character must belong to exactly one slice.

A heading and a dependent paragraph can stay together. An item can also yield one slice. A Remember item supports up to 16,384 code points. The whole request supports at most 100 partitions.

Watch the partition model exchange

One complete structured response determines where the server slices the item.

Valid response

Server sends the marked source

The JSON includes request-scoped boundary IDs. The source text and its newline belong to the original item.

Inspect example payload
See the cited contract for the full shape.

Model chooses one cut

The model returns a cut reference. Dense-Mem checks the reference and reconstructs both exact spans from the original.

Inspect example payload
See the cited contract for the full shape.

Server admits two exact spans

The first span ends immediately after the newline. The two spans reconstruct the entire original.

span A
First line and newline
span B
Second line

Unknown boundary

Server sends the same marked source

Each candidate boundary belongs only to this request and item.

Inspect example payload
See the cited contract for the full shape.

Model returns an unknown reference

The proposed cut is outside the supplied reference list. The entire response fails validation.

Inspect example payload
See the cited contract for the full shape.

Server requests a complete replacement

Dense-Mem retries within the bounded regeneration policy. If validation never succeeds, the request publishes zero new Evidence.

Published Evidence
0

Remember · Step 4

Look for existing Evidence

Duplicate candidates

Dense-Mem compares the new slice with the existing legal-hold passage.

E3 already exists in Atlas’s shared memory. A and B are still proposed slices.

The team already has a passage about legal holds. Dense-Mem checks eligible exact matches and can use embeddings to find passages worth comparing with each new slice.

E3 is a plausible comparison for A. It describes an exception to expiry. A supplies the ordinary duration. Both pieces of information are useful.

When can an existing ID be reused?

An embedding is a list of numbers representing a passage’s meaning. For ordinary intake, eligible exact duplicates can be resolved directly. For other eligible slices, the server embeds unique content as needed and consults a bounded list of nearby candidates. The assessment can choose reuse only from that list.

A reused canonical ID can acquire another occurrence with the new source and exact wording. Explicit force-insert and lifecycle-bearing inputs, including versioned-source submissions, have their own new-occurrence rules.

E3 has the plain source label “Retention policy” in this example. Reading it for comparison does not submit it again.

Remember · Step 5

Validate the whole assessment

The intake decision

Both slices become new Evidence. The legal-hold passage remains independent.

The example yields two new passages. A policy and its legal-hold exception can coexist.

The assessor proposes structured decisions for the submitted slices and the candidates it was given. Here, A and B are both new and the legal-hold passage supplies a compatible exception.

The server checks the entire response, including required decisions, allowed IDs, and any quoted conflict positions. An invalid answer triggers bounded regeneration of the whole response.

What happens to incomplete or conflicting answers?

If a response omits a required item or names an unknown candidate, Dense-Mem asks for a complete replacement within the retry bound. Exhausting that bound fails the write before semantic publication.

When admitted Evidence genuinely disagrees, a conflict can preserve the competing positions with exact citations. Server policy checks scope and ownership for lifecycle actions. A model’s preference cannot grant permission to overwrite someone else’s Evidence.

Inspect the Evidence assessment

This example shows the generation route for equivalence and conflict assessment.

Accept both slices

Supply the original meanings

The assessor sees two submitted slices and a bounded list of authorized comparison candidates. The existing legal-hold passage is context for the first decision.

Inspect selected request fields
See the cited contract for the full shape.

Return every open decision

The response keeps the submitted passages distinct from the candidate and reports zero conflict proposals.

Inspect example payload
See the cited contract for the full shape.

Validate before preparing the commit

The server validates the response schema, coverage, candidate references, and cited spans. The two submitted fragments can proceed to the required search preparation.

Reject an invented candidate

Return an out-of-list reuse decision

The model names a candidate the server never supplied. An invented reference fails the entire assessment.

Inspect example payload
See the cited contract for the full shape.

Regenerate or fail

Request a complete corrected response within the retry bound. A persistent failure leaves the existing legal-hold Evidence available and publishes zero new Evidence.

New Evidence
0

Remember · Step 6

Commit Evidence, memberships, and search data

The PostgreSQL transaction

One committed transaction publishes the two Evidence IDs and their provenance.

The completed receipt marks the point when E1 and E2 exist as searchable shared Evidence.

Dense-Mem prepares the required search embeddings. One PostgreSQL transaction then saves the accepted passages, a record of each appearance in the source (an occurrence), and the data needed to search them.

A becomes E1 and B becomes E2. Their receipt can now be replayed. Recall can find E1 and E2 immediately. With organization enabled, their direct Topic memberships are already available. The next steps show how Dense-Mem assigns Topics and revisits them later.

What if an embedding or database write fails?

Embedding calls run before the final write transaction. The commit checks mutation authority, duplicate decisions, and the active embedding configuration again. It writes the original item, partition mapping, assessment history, applicable lifecycle or conflict records, eligible direct Topic memberships, search documents, vectors, and terminal receipt together.

A required embedding failure or a failed commit publishes zero new Evidence from this request. A failure record may still explain the attempt. Progress notifications, including waits and retries, acknowledge a stage only. The terminal reply reports the outcome.

Watch the PostgreSQL transaction

Selected row fields from a fictional write show what becomes visible at commit.

Successful commit

Prepare vectors

Prepare search outside the transaction

The server has validated the assessment and prepares any required vectors. Existing eligible vectors can be reused where the embedding and search contracts allow it.

New rows visible to readers
0

Inside transaction

Write the original item and lineage

The server rechecks authorization, idempotency, and the search contract inside the transaction. It writes the original item, the occurrence, and the partition link as part of the same commit.

Submitted item
Submitted item
E1 occurrence
E1 occurrence
Partition span
Partition span
Inspect selected row fields for E1
See the cited contract for the full shape.

Commit visible to readers

Publish search state and the receipt

The transaction also writes the decisions, direct Topic memberships, search documents, required vectors, and replay receipt. After commit, Recall can find E1 and E2. The worker handles Community placement.

Search document
Search document
Replay key
Replay key
Inspect selected search and receipt fields
See the cited contract for the full shape.

Roll back before commit

Inside transaction

Stage rows inside the transaction

The same lineage rows can be present inside the transaction while they remain invisible to readers.

Inspect example payload
See the cited contract for the full shape.

Rollback

Fail while writing search state

An error can occur before the transaction lands. The transaction rolls back every new write from this operation.

New lineage rows visible
0
New search rows visible
0
Completed replay receipt
Absent

Return the failed outcome

A separate failure record may explain the attempt. The caller follows the returned recovery policy and retains the original key and request for a retry where allowed.

Organize · Step 7

Pick up eligible shared Evidence

The maintenance worker

The worker reads eligible shared Evidence from the current generation.

The worker can organize the current shared generation. Private Evidence stays within its own space.

A periodic scheduler revisits eligible Evidence and places Topics under broader Topics. It processes bounded pages and records its progress.

The worker looks within the current shared generation. E1, E2, and E3 can be reassessed as their inputs change. Private session excerpts stay in the owner’s private space.

What happens while maintenance is paused?

A pause stops background admissions while enabled foreground assignment and Topic reads continue.

The scheduler discovers eligible older Evidence and indexed matches affected by Topic changes. It checks source and Topic revisions before starting provider work.

Organize · Step 8

Assign Topics to each passage

Direct Topic assignment

The organizer assigns the retention rule and its exception to the same topic.

A topic definition has a name and description. An assignment refers to that definition and to one Evidence source.

For each passage, the assignment assessor receives exact text and a shortlist of existing Topics. Atlas’s shortlist includes Snapshot retention and Support hours.

The proposal example illustrates a second direct Topic for E3 while retaining the existing Snapshot retention match. In the main example, E3 uses the retention Topic.

The scoped shortlist of up to 20 existing Topics.
What if a suitable topic does not exist?

With optional Decisions enabled, Dense-Mem checks each candidate and asks whether relevant meaning remains uncovered.

Structured generation can match several existing Topics and propose new ones in the same reply. It supplies an exact supporting quote for each selection or proposal.

An unclear passage can remain uncategorized. It is still searchable.

Watch how the AI assigns Topics

These fictional exchanges show the structured generation path for one Evidence passage.

Reuse an existing Topic

Dense-Mem → model

Send a bounded shortlist

Up to 20 current candidate Topics arrive with the exact passage.

Candidate Topic
Candidate Topic
Candidate Topic
Candidate Topic
Inspect example payload
See the cited contract for the full shape.

Model → Dense-Mem

Select a supplied Topic

The response selects a Topic ID and quotes the exact text that grounds the choice.

Inspect example payload
See the cited contract for the full shape.

Server policy and publication

Validate and publish direct membership

Dense-Mem verifies the Topic ID and source quote, then rechecks current eligibility and revisions before committing.

E3
Existing retention Topic

Propose a missing topic

Dense-Mem → model

Send eligible Evidence and candidates

The same passage also addresses legal holds. The existing shortlist has no Topic for that meaning.

Inspect example payload
See the cited contract for the full shape.

Model → Dense-Mem

Match one Topic and propose another

This alternative keeps the existing match and proposes a distinct Topic. Each result includes an exact supporting quote.

Inspect example payload
See the cited contract for the full shape.

Server policy and publication

Recheck and publish both memberships

Dense-Mem checks the new name against current Topics and aliases. The valid result commits with Evidence, search state, and the replay receipt.

Existing Topic
Existing Topic
Proposed Topic
Legal holds

Organize · Step 9

Check whether meanings are equivalent

An Evidence pair

Retention duration and the legal-hold exception answer different questions.

Two passages share a topic here. They remain separate answers to different questions.

The worker assesses Evidence equivalence separately from Topic assignment. E1 says how long routine snapshots last. E3 says what suspends expiry. Knowing either passage alone leaves a different question unanswered.

The pair decision is distinct. When two eligible passages do have the same meaning in compatible contexts, a published equivalence group can let Recall return one representative with alternate IDs.

How is this different from intake reuse?

Intake reuse chooses a canonical Evidence identity for a new occurrence. Evidence equivalence groups eligible stored Evidence with the same meaning. Each member retains its own text and provenance.

The worker checks labels, metadata, relative time, and owner-sensitive wording before recording an equivalence outcome. Ambiguous comparisons can remain unresolved.

Organize · Step 10

Publish the direct memberships

The current topic catalog

Two passages are directly assigned to retention and one to support hours.

Operations is a catalog parent. The Evidence labels sit under the topics to which they are directly assigned.

Before publishing, Dense-Mem rechecks relevant source and Topic revisions. Remember commits direct memberships with the Evidence, search state, and replay receipt. Community placement records a broader Topic or standalone outcome under its own revision checks.

Snapshot retention now points directly to E1 and E3. Support hours points to E2. Operations helps someone browse the catalog. Every factual statement in this example still comes from the original Evidence.

What if a source changes during classification?

A stale source or relevant dependency can block publication. Automatic work cannot overwrite a newer relevant decision. The worker records the outcome and later eligible work can reassess the affected sources.

A topic has an optional parent. The parent link organizes definitions. Selecting a parent reads its own current direct assignments. The filter experiment later shows this using all three Evidence IDs.

Inspect a direct membership

Follow the published membership from the Topic to its source.

Recheck source and Topic revisions

Publication verifies the current shared space, exact Evidence identity, and relevant Topic revisions.

Source
E1
Version
1

Publish the direct membership

A versioned membership records the Evidence source and its Topic. A broader Topic supports catalog navigation.

Inspect selected membership fields
See the cited contract for the full shape.

Read current direct membership

Recall checks authorization, lifecycle, and current dependencies before returning members.

Selected Topic
Retention Topic
Eligible direct Evidence
E1 and E3

Recall · Step 11

Turn a question into a recall request

The caller’s query

The host submits the search query and result limits.

The host chooses the search text and a one-result limit for this first pass.

A teammate asks how long Atlas keeps routine backups. The assistant calls recall_memory with the words “routine snapshots” and asks for one Evidence result plus up to two topic hints.

Recall resolves the caller’s allowed spaces and the active search configuration. It embeds the query once when possible. Ordinary search can consult the caller’s private and shared spaces. Here the private space is empty.

How are time and visibility handled?

Recall accepts a query, current topic IDs, or both. On a multi-space query it searches each authorized space separately, then combines the resulting ranks. Explicit topic filters use the shared branch only.

valid_at concerns real-world Evidence time. known_at concerns what the system knew at a given time. Topic membership is evaluated in the current view. This example uses current Evidence, a working embedding provider, and no optional decision reranker.

recall_memory arguments

See the tool's argument fields in the Technical Reference.

Recall · Step 12

Search by words and by meaning

Two candidate lists

Full-text and vector branches produce their own ordered candidates.

The displayed vector order is illustrative. In a real call it depends on the embeddings and index.

PostgreSQL full-text search finds E1 because its search document contains both query terms. pgvector compares the query vector with eligible Evidence vectors, so passages with different wording can also surface.

Smaller cosine distance means a closer vector match. In this example E1 ranks first in both lists. E3 ranks second by vector similarity, and E2 trails it. Recall compares these positions next.

Where can Topics help at this point?

The shared branch can also match a current topic’s normalized key or unambiguous alias and introduce direct members as candidates. Topic discovery by itself adds no rank-fusion points. An approximate vector search can check newly discovered candidates against the query and rank them by distance.

Our “routine snapshots” query has no matching key or alias in the example catalog. The topic hint that appears later comes from the winning Evidence’s direct membership. Eligibility filters apply to candidates before their IDs leave storage.

Inspect the query embedding

The query vector supports search. Recall itself returns stored Evidence.

Vector available

Embed the query text

The server uses the active search contract and submits the query to the configured embedding provider. The configured dimensions and the resulting vector belong to that contract.

Inspect the logical embedding input
See the cited contract for the full shape.

Search current vectors

PostgreSQL searches the eligible current vectors with the active contract. Its nearest results contribute to rank fusion alongside full-text matches.

Vector unavailable

The query embedding fails

A provider failure or unusable vector removes this optional search channel for the call.

Vector branch
Unavailable

Continue with eligible word matches

Full-text search still returns the passage with both query terms. The public result records a degradation.

Lexical result
E1
Degradation
Vector recall unavailable

Recall · Step 13

Combine the ranked lists

Reciprocal rank fusion

The first text and vector hit earns two reciprocal-rank contributions.

Switch search modes to recalculate the example. These scores describe order within the shared space.

Each text or vector hit contributes 1 ÷ (60 + its position in that list). E1 is first twice, so its score is 1/61 + 1/61. E3 receives 1/62 from the vector list.

Recall orders candidates by the sum. The score measures ranking support from the search channels. It cannot tell a reader whether the policy itself is true.

What changes if the vector is unavailable?

Choose Words only in the diagram. With the same eligible corpus, E1 still has a lexical match. E3 and E2 have no matching text hit and leave this candidate list. A failed query embedding produces an explicit optional degradation.

With optional decision reranking enabled, eligible hydrated candidates can be rescored for relevance before the final limit. A failed optional rerank retains the original authorized ranking and reports the degradation. Multiple allowed spaces have a further rank-fusion step.

Recall · Step 14

Return the passage and a topic hint

The first recall result

Recall returns the exact rule and hints at its retention topic.

Two eligible direct members belong to the hinted topic. One of them is the E1 just returned.

Recall loads the actual records and checks their visibility and lifecycle again. With limit 1, the caller gets E1’s exact passage, its Evidence ID, and its shared-space label.

The winning passage is a direct member of the hinted retention topic. The example includes the winner and the legal-hold passage in its eligible count because the request supplied no known IDs.

What else can be in the result?

A current, eligible equivalence group can produce one representative and bounded alternate IDs. Recall can also attach conflict positions with exact quotes, search state, and explicit degradations. Long historical contexts and bounded alternate lists can report truncation.

Topic hints come from the returned Evidence and its visible equivalents. Recall ranks topics by overlap with these hits, then by additional eligible Evidence. It reports truncation when the topic limit cuts the list.

See the eligible read and hydration

Follow the candidate from a search projection to the exact authorized Evidence.

Search projection

Scope each search branch

The SQL adapter applies the authorized space, lifecycle, and requested eligibility filters. Each candidate can identify its search projection.

Inspect selected candidate fields
See the cited contract for the full shape.

Authorized Evidence

Hydrate eligible Evidence

Dense-Mem loads the original Evidence text for the ranked candidate and checks eligibility again. The selected result uses the Evidence ID and the shared space label.

Inspect selected result fields
See the cited contract for the full shape.

Current topic membership

Look up the direct topic hint

The topic read follows current assignments and counts eligible direct Evidence. The hint gives the caller a topic ID to use in a new request.

Hint
Retention topic
Eligible Evidence
Two passages

Follow up · Step 15

Follow the topic to the exception

Try a direct-membership filter

Excluding E1 leaves E3 in the retention topic.

Each filter uses known_evidence_ids = [E1]. Compare a child topic, its parent, and both children.

The assistant follows Snapshot retention in a second recall_memory call and supplies E1 as already seen. E3 is the remaining direct member, so the caller discovers the legal-hold exception.

Try the parent by itself. It has no direct members. Select both child topics to take their union, exclude the known passage, and return the other direct members.

What goes into the follow-up call?

The query is optional when topic IDs are present. In ordinary use, the caller copies the current topic ID from a previous hint and supplies the Evidence IDs it already has. The selector also exposes two catalog alternatives to make the membership rule visible.

A valid current topic with zero direct members can return an empty result. A missing, stale, or inaccessible explicit topic returns topic_unavailable. The filter never silently broadens into a general search. With known eligible members of an equivalence group, duplicate group results can also be suppressed.

recall_memory arguments for the selected filter

See the tool's argument fields in the Technical Reference.

Follow up · Step 16

Trace E1 back to the original line

The provenance chain

The original item and its character offsets establish provenance.

Follow E1 through the occurrence to the submitted item and its exclusive source span.

The assistant passes the returned E1 ID to trace_memory. Its occurrence identifies the operations handoff and the exact span that supplied the routine retention rule.

The partition entry identifies the submitted item, its index, its original hash, and the start and end of this slice. That is how a reader can check the quote against the original submission.

Which history can Trace show?

Requesting content and transitions lets an authorized reader inspect exact occurrences, available source revisions, decisions, lifecycle, and search projection information. Here the handoff supplies a plain source label. A versioned source would also carry a revision identity.

The span uses zero-based Unicode code points. Its end is exclusive and includes the newline in the first partition. The stored SHA-256 covers the original UTF-8 bytes. Trace has content and event bounds and exposes omissions.

trace_memory arguments

See the tool's argument fields in the Technical Reference.
Follow the database provenance links

The occurrence and partition connect the canonical ID to the exact original.

Start from the Evidence ID

Trace uses the authenticated actor’s allowed spaces and returns bounded evidence history.

E1
Evidence ID
Occurrence
Occurrence ID

Resolve the partition mapping

The occurrence links to partition zero of submitted item zero. The mapping supplies offsets and the original item’s content hash.

Inspect example payload
See the cited contract for the full shape.

Verify the source slice

Slice the original text by Unicode code points. The displayed end is exclusive and the newline is part of E1.

Exact span
First partition
Exact Evidence
The original retention line

Follow up · Step 17

Answer with the rule and its exception

The host’s answer

The host combines the rule and its exception in the answer.

The assistant can cite E1 for duration and E3 for the exception. E2 answers a separate question.

The assistant can now answer the teammate in one sentence. E1 establishes the routine retention period. E3 adds the condition that changes when expiry runs.

The wording of the answer belongs to the host. Its two supporting IDs lead to the exact stored passages. The answer itself becomes memory only if someone submits it through an intake tool.

What if the policy changes later?

An authorized owner can submit a new retention policy with the old Evidence ID in supersedes_evidence_ids and a fresh operation key. The old Evidence drops out of current Recall. Trace retains the link to its replacement. Stale assignments lose current eligibility.

After using a result, the host can submit voluntary feedback against its recall_id. For a portable record, export_memory_pack accepts authorized Evidence IDs and returns provenance, a content hash, and explicit omissions.

Walkthrough steps