ClouisleClouisle

Memory and Context

Configure cross-conversation memory graphs, background extraction, and tiered context management for long conversations

Clouisle solves conversation continuity and cost with two layers:

  1. In-conversation context (message branches + tiered compression): the live history during a conversation. When the assembled request exceeds budget, earlier history is summarized, completed tool results fold into readable references, and tools are discovered on demand, keeping the model window from overflowing.
  2. Cross-conversation memory graph (Memory Graph): a persistent knowledge network across conversations, capturing user preferences, project background, and core facts as entities and directed relations.

Compression produces a model view, not a replacement for stored history: original messages and tool records remain. Memory itself is an entity/relation graph, not an accumulation of raw conversation text.

Enable Cross-Conversation Memory

  1. Open the Agent orchestration > Memory.
  2. Turn on Enable memory (off by default).
  3. Set the maximum memories per retrieval, range 1-50, default 10.
  4. Optionally turn on Automatic memory extraction (on by default).
  5. Save and publish the Agent. As users talk in different conversations, the Agent recalls previously recorded facts.
SettingDefaultRangeDescription
Max memories per retrieval101-50Maximum entities injected into the model per memory retrieval
Automatic extractionOnOn/offWhether memories are extracted and saved from conversations automatically; when off, memory is read-only
Importance thresholdMediumLow / Medium / HighAutomatic extraction only saves content meeting this importance
Agent memory settings
Agent memory settings

Memory Graph

Persistent memory is not flat text; it is a directed knowledge network of entities and relations.

Explore and manage it under the personal menu > My memory (/app/memories) or in the admin console (/memories).

Memory graph canvas
Memory graph canvas: entity nodes, relation edges, layout switching, and entity details

Entity types

Ten entity types are predefined to categorize memory content:

Entity typeDescriptionExample
PreferenceA personal preference or habit"Prefers concise code style", "Usually writes TypeScript"
ProjectA project in progress or joined"E-commerce rebuild", "Internal knowledge base"
PersonA person or role mentioned"Manager Zhang (product owner)"
OrganizationA company, department, or team"R&D department", "Vendor A"
SkillA technology or expertise"Python", "PostgreSQL performance tuning"
GoalA stage goal or intent"Ship docs-site i18n this quarter"
FactAn objective fact or specific detail"Production cluster runs in Tokyo"
ConceptA domain concept or term"RAG hybrid retrieval"
LocationA place or physical location"Shanghai Zhangjiang office"
CustomAnything that does not fit the othersUser-defined fact labels

Relation types

Entities can be linked by nine directed relation types, used to follow related memories:

Relation typeMeaning
PrefersPrefers something
UsesUses a tool or technology
Works onWorks on or participates in something
Works atWorks at an organization
KnowsKnows a person or technology
Part ofBelongs to a higher-level entity
Has goalHas a certain goal
Located inIs located at a place
Related toIs related to something

Graph management

  • Multiple layouts: grid, hierarchical, and radial layouts, with zoom in, zoom out, and fit view.
  • Entity search and filtering: search entity names and descriptions by keyword, or filter by one or more entity types.
  • Relation drawer: click an entity to see its outgoing and incoming relations, edit its properties directly, or delete a specific directed relation.
  • Bulk and safe deletion: use select mode to delete stale or sensitive entities in bulk; deleting an entity also removes all of its relations.

Memory Retrieval and Recency

When an Agent retrieves memories, it weighs both semantic similarity and recency: semantically close memories that were updated recently rank higher. By default a memory not updated for about 30 days has half the weight; newer memories are more likely to be recalled.

  • Filter by time: retrieve only memories created or updated within the last N days — useful for questions like “what did we discuss last week”.
  • Expand by relation: after a hit, expand outward 1-3 levels along relations (default 1), starting from at most 5 entities, with direction limited to incoming relations, outgoing relations, or both. Only relations that actually exist are returned; the model does not infer missing links and does not create entities this way.
  • Filter by type: retrieve only one kind of entity, such as preferences or projects.

With Automatic memory extraction off, the Agent can only search and read existing memories and never writes new entities or relations.

Background Extraction (Admin)

Administrators configure background memory extraction under Site settings > Memory (/site-settings/memory):

SettingDefaultConstraintDescription
Background extractionOffOn/offGlobal switch for asynchronous background extraction
Extraction modelEmptyAn enabled language modelThe model that performs extraction; blank uses the default fallback model
Cooldown180 seconds10-3600 secondsMinimum interval between extractions to avoid repeated triggers in one conversation
Pending turn threshold6 turns1-50 turnsExtraction starts as soon as this many user turns are pending

The Agent must have both Enable memory and Automatic memory extraction checked in its orchestration, and the site-level background extraction switch must be on, before conversations with that Agent queue background extraction.

How Long Conversations Compress

Context compression is on by default. The goal is not to delete history but to give the model a view that fits the window without losing the task. Original messages, tool calls, and results remain in the conversation; compression only changes what the current request contains.

Agent context compression settings
Agent orchestration → Context Compression: switch, summary token budget, and progress display
SettingDefaultRangeDescription
Enable context compressionOnOn/offWhen off, requests are not trimmed and an over-window request fails
Summary token budget1000128-8000Target size of the history summary; larger keeps more detail but leaves less room for the conversation
Show compression progressOnOn/offEmits compression start/end events to the chat stream; off compresses silently

Tiered order

  1. History summary: older turns are summarized into one entry that replaces the original history; the latest turn and unfinished tool calls are never split.
  2. Active-round compaction: results from repeated tool calls in the same round are folded by group, keeping the tool name, status, and a readable reference.
  3. Result readback: folded tool results are not deleted. The model can call a read tool to fetch part of the original result instead of loading everything at once.
  4. On-demand tool discovery: with many tools, only a necessary subset is exposed first; the model can search and load other authorized tools. Unauthorized tools are never discovered or executed.
  5. Provider overflow retry: when estimates differ from the provider count, a bounded reduction retry happens before streaming starts, and completed side effects are not replayed.

Behavior boundaries

  • Original records stay: messages, tool arguments, and results remain in the conversation; refreshing or reviewing history loses nothing.
  • Consistent recovery: after a pause (question or tool confirmation) or a worker restart, the same model view is rebuilt without re-running completed calls.
  • Explicit failure: if non-compressible content such as user instructions or pending calls still cannot fit, the turn fails with a clear error instead of silently dropping it.
  • Branch isolation: editing a message or switching versions compresses only the active branch; older branch records never leak in.
  • Visible usage: compression events show before/after token estimates, and persisted records remain visible after history reload.

Compression only affects the current request; it never deletes history. Long-term facts across conversations belong to the memory graph, which is a separate mechanism.

Troubleshooting

  • Preferences are not remembered: confirm the Agent has memory enabled, the information meets the importance threshold, and you use the same signed-in user.
  • Replies ignore early details: a long conversation may have compressed early history into a summary; restate the key constraints or start a new conversation.
  • Compression happens too often: check the model's context window, output reserve, and tool result sizes; large tool outputs fill the budget faster.
  • The memory graph contains a wrong fact: go to /app/memories, search for the entity, click Edit to fix the description, or Delete it.
  • The same fact is recorded repeatedly: check the site background-extraction switch and the Agent's automatic extraction setting; with extraction off, memory is read-only.

Related: Conversations and chats, Attachments and media, Memories API.

How is this guide?

On this page