Qoni

Qoni JournalGUMem

Does Your Agent Dream?

你的 Agent 会做梦吗?

Does your agent dream?你的 Agent 会做梦吗

AutoDream, layered memory, and what it means to remember you.

Stored chat logs only let an agent replay the past; refining, forgetting, and correcting make a memory

Computer science perfected storage: databases keep a record intact for decades, search engines answer across trillions of pages in milliseconds, cloud drives hold every photo you've ever taken. Thirty years of infrastructure, all answering one question: how do we store information exactly as it was, and retrieve it exactly as it was?

But memory was never that.

People don't remember each other that way. You can't recall every sentence a friend has said, yet you remember they won't touch cilantro. You can't replay last month's meetings, yet you've concluded they hate any meeting that runs past thirty minutes. Memory isn't storage and retrieval — it's processing. What gets forgotten, distilled, and corrected matters as much as what stays.

Everyone says agents need memory. But most of what ships as "memory" today is chat logs in storage, retrieved on demand. Everything you've said becomes rows of text waiting to be searched — less like remembering, more like scrubbing through security footage.

That's a database, not a memory.

GUMem is modeled on human memory: it refines, it forgets, it stays traceable

GUMem is Qoni's memory layer. Its overall shape comes down to three decisions:

  • It remembers not just what you said, but what you did. Conversation is one track; behavior is another — what you clicked, what you chose, what you abandoned. The two tracks are physically separated from ingestion to processing, each with a complete pipeline of its own;
  • Raw information is refined layer by layer: conversation → facts → summaries → topics. The higher you go, the denser it gets — and the closer to who this person is;
  • Every memory carries a source pointer, a confidence score, and time decay, traceable all the way back to the sentence or the click where it was born.
The GUMem memory plane: conversation and behavior enter as two tracks, refined layer by layer, recalled on demand
From sources to pipeline to recall: memory isn't something you deposit and forget — every layer keeps processing.

Let's take those three decisions apart, one at a time.

Six memory types, linked by six relation types, corroborate and correct one another

Human memory isn't one pool, and neither is GUMem's. Raw input first lands in working memory, the starting point of all processing. It then aggregates into episodic memory: what happened, and in what context. Episodes settle upward along two paths: semantic memory answers "who this person is, what they prefer," and procedural memory answers "how this task gets done."

The fifth kind comes from a different source: user feedback — satisfaction, frustration, correction — produces sentiment memory. It doesn't describe facts; it describes how the user feels about them.

The sixth is the most distinctive: associative memory weaves the web between the others. Supports, contradicts, extends, causes, resembles, co-occurs — six kinds of relation edges that let memories corroborate and correct one another.

Six kinds of memory: working, episodic, semantic, procedural, sentiment — and the associative web between them
Five kinds each own a stretch of the road; the sixth weaves the web between them — six edges that let memories corroborate and correct one another.

Every layer's output carries fields and anchors, so any memory can be traced to its source

"Refined layer by layer" isn't just atmosphere. Each layer's output is a structured object with fields:

  • The extraction layer produces facts and observations: the smallest reusable units of information, carrying entity, source, time range, and processing status;
  • The compression layer produces summaries and propositions: topic tags, confidence, a decay factor, retrieval weight — and an anchor pointing back to the original evidence;
  • The recall layer produces a five-layer ready context: recent messages, session context, the user's long-term memory, the session's long-term memory, and formatted injection text. Each layer has a quota, tunable per task (how many recent messages, how many long-term memories to inject).
The memory refinement pipeline: dual-track input, through extraction and compression, to the five-layer ready context
Every station has explicit inputs and products: not "stored," but "machined into shape."

The fields exist for verifiability: any recalled memory can trace through its anchor back to the original event; any confidence score can explain what reinforced it and what weakened it. A memory system that can't explain where its beliefs came from is a liability inside an enterprise, not an asset.

Recall first, then generate, then write back: flip the order and memory pollutes itself

The pipeline runs in a deliberate order: recall first, then generate, then write back.

Before the agent answers you, it recalls the memories that had already settled before this turn began. Only after the answer is generated does this turn's new information enter the pipeline. The order must not flip. Flip it, and you get a subtle disease: the model treats what it just said as "the user's historical facts," growing more confident and more wrong with every turn.

In a long-term memory system this self-pollution is especially dangerous because it compounds: one turn's small bias gets written into memory, recalled as fact the next turn, generating a more biased answer that writes back an even more biased memory. A memory system's first duty is not to remember more. It is not to pollute itself.

Recall first, then generate, then write back: a loop that turns in one direction only
The order itself is the discipline: the next turn starts from the new memory state, but this turn's generation never eats what it just wrote.

Decay by half-life, revise on evidence: stale preferences don't get believed forever

A real memory system must answer three questions no database ever answers.

Does memory forget? Yes — and it forgets by physical law. GUMem assigns every memory a half-life: identity memories (he's an engineer) are measured in decades, stable relationships in years, preferences and habits in quarters, temporary plans fade in two weeks, passing moods vanish in two days. A memory's activity is set by a decay function: confidence multiplied by exponential decay parameterized on the half-life. High-activity memories get recalled first; those that sink to the bottom exit the stage on their own. Not all memories are born equal, nor should they be equally immortal.

Does memory harden? Yes. A preference confirmed again and again gets its confidence raised and its decay slowed — like an impression a person keeps deepening.

Can memory be overturned? Yes — and overturning has its own discipline. The user says "I've stopped drinking americanos, I drink lattes now": the old memory isn't physically deleted, it's marked invalidated and pointed at the new memory that overturned it; an old preference narrowed by conditions gets down-weighted and decays faster, but stays present. Every rewrite leaves a complete evidence chain. We call this audit-friendly forgetting: memory can be corrected, but the correction itself is always on the record.

The physics of memory: five half-life tiers each decay on their own; activity drives recall; overturning leaves an evidence chain
Identity in decades, moods in days: every memory decays on its own half-life; reinforcement has grounds, overturning leaves a trail.

Vector, graph, and transactional stores each do one job, and any failed layer can be rebuilt independently

This memory physics lands on a storage layer with equally clean separation: the vector index handles semantic similarity ("find the memories most like this sentence"), the graph store handles relational reasoning (who supports whom, who overturned whom, what caused what), and the transactional database handles the ledger and idempotency (which message has been processed, which is in flight).

The three stores don't depend on each other; any layer can be rebuilt independently if it breaks.

A query agent plans recall by question type and cross-checks evidence: precise context, never out of scope

Storing well is half the job. Recalling precisely is the other half.

In most memory systems, "recall" is one vector search: take the question, compare against the store, hand over the closest matches. GUMem's recall is a query agent that plans. It carries a toolbox of memory access (recent messages, session context, record lookup, vector search, graph relations) and decides which memory to consult first based on the question's type: "how do I" goes to procedural memory first, "what happened" goes to episodic, relationship questions walk the graph, preference questions check the sentiment track first. Evidence is cross-checked across types, then assembled into exactly the context this task needs. No more, no less.

It also obeys an honesty protocol hard-coded into the system: only memories actually retrieved count as evidence — fabrication is forbidden; when evidence is thin, it must say so instead of guessing; when evidence conflicts, it resolves by a fixed priority (the user's explicit correction beats an inferred preference, the current session beats old memory, a specific constraint beats a broad liking), and what can't be resolved gets laid out on the table: "there's a disagreement here."

And one hard boundary: the data scope of project and user is enforced by the system. The query agent passes business parameters only — it doesn't even have the power to construct a query statement. Clever is welcome. Crossing the line is not.

The query agent: a memory toolbox, routed by question type, bound by the honesty protocol
Recall that plans: pick the memory by the question, cross-check the evidence across types; the honesty protocol is hard-coded, the data scope is system-enforced.

AutoDream digests behavior logs while the agent idles, asking what you didn't think to ask

When people rest, the brain keeps working.

Inside Qoni there's a mechanism that works while the agent idles, and its name says it: AutoDream. It digests the user's accumulated behavioral logs into genuine insights. Things like: "this user tends to order late at night," or "for three weeks they've been looking at flights to Tokyo."

Dreaming is a metaphor. What it does is concrete: it turns piles of logs nobody reads into judgments someone can use. And here's what makes it different: this is not a pre-written statistics report. The agent decides what to analyze, writes the analysis code itself, and runs the analysis to produce its own findings. The question you didn't think to ask — it asks for you.

The engineering underneath is worth more than the metaphor:

  • The model never sees your raw data. Behavioral logs first pass through a deterministic statistics layer that involves no model at all, compressed into a "data digest"; natural-language content keeps only statistical features like length — the original text never leaves. The model sees only this digest, and proposes its analyses on top of it.
  • The code the agent writes runs in a sandbox. Generated statistical code may not import dependencies and may not touch storage or the network; it can only call a controlled set of statistical interfaces. The data scope is enforced by the backend — however clever the code, it cannot reach one line of logs beyond the boundary.
  • The insights ship with evidence. Every insight is structured: metric, dimension, current value, baseline, delta, evidence and confidence — verifiable, not just a nice sentence.
The AutoDream pipeline: deterministic statistics first, the model sees only the digest, code runs sandboxed, insights carry evidence
It dreams, and it dreams by the rules: the model can't see raw data, the code can't leave the sandbox, the insight carries its evidence.

Memory sovereignty belongs to the user: see, fix, and delete what the agent remembers

The stronger the memory, the more urgent the other question: do you know what the agent remembers about you?

In GUMem, the answer is three capabilities:

  • You can see it. Every memory sits in the open, with its source and its confidence: why it believes what it believes, and how sure it is, at a glance.
  • You can fix it, and delete it. Wrong? Correct it. Don't want it remembered? Delete it. Memory belongs to the user, not to the model.
  • You can watch it grow. After writing in a batch of messages, you can subscribe to its processing in real time: facts extracted, summaries generated, topics updated — one event per stage, pushed to you. The stream returns stages and counts only, never the content itself, and secret-like strings are always masked: observable, never leaky.
Memory sovereignty: see it, fix and delete it, watch it grow
Three capabilities: sources and confidence in the open, the power to fix and delete in the user's hands, and processing that's observable without leaking.

We call this memory sovereignty: not an agent quietly remembering you, but you deciding what it may remember.

Enterprise rules attach at three hooks with shrinking authority, never crossing the data boundary

When an enterprise adopts a memory layer, the first question is usually: "where do my business rules and compliance requirements attach?" GUMem leaves three hooks on the pipeline — and deliberately gives each one less authority than the last:

  • Before write: may rewrite data. Scrubbing sensitive fields, enriching business context, normalizing formats — all before anything lands in memory;
  • Before the model: may only append instructions. Business rules and compliance constraints are injected as directives, but the memory itself cannot be tampered with;
  • After the model: read-only notification. Audit pipelines, CRM or recommender sync — they see the results and can change nothing.

Rewrite, append-only, read-only: the shrinking sequence is itself the governance philosophy. And the real hard boundary isn't on the hooks at all: it's the system-enforced data scope. Project and user scope is set by the backend, and no hook, no query crosses it.

Three governance hooks: rewrite, append-only, read-only — authority shrinks step by step
Hooks handle extension, scope handles the boundary: shrinking authority is the philosophy, backend enforcement is the floor.

Users say "just browsing"; the behavior track recovers the preferences their clicks reveal

A typical deployment scenario: an e-commerce shopping agent.

The user says "just browsing." But the behavior track tells another story: repeatedly opening light-colored sneakers, filtering size 42, clicking into carbon-plate runners again and again — and backing out within seconds. The preferences the conversation track never carried, the behavior track spoke for them: light colors, size 42, skip the carbon plates. Next recommendation, the agent already knows.

That's what dual-track memory is for: not one more log to store, but the half of the story people never say out loud.

Recall across sessions: in a brand-new chat, it still knows what you cared about last week

Now a knowledge-work scene. In a brand-new session, the user asks: "compare this vendor with the one I liked last week."

No pasted context, no re-briefing. The query agent recalls across sessions: what last week's vendor was called, that the user cared most about deployment risk, that he prefers concise answers. So the answer lands in one step: "cheaper than last week's, but weaker on audit export and deployment controls." Every supporting memory carries its source pointer — some from conversation, some from the click stream.

To the user, this is "it remembers me." To the engineer, it's a verifiable evidence chain.

Memory access runs on GenAuth delegation: a key to one user, not the whole store

Inside an enterprise, the memory layer is never an island. GUMem shares its identity boundary with GenAuth: when an agent mounts memory, it must declare which user it acts for and which actions it's allowed — recall only, no writes, for instance. That declaration is itself a narrowed delegation: the agent doesn't get "the keys to the memory store" — it gets a key that can only recall this one user. Every memory access, like every tool call and every web operation, runs through the same identity, boundary, and audit.

A few lines store and recall chat and behavior; once behavior is recorded, AutoDream needs no extra code

Everything so far has been the machine's insides. Developers care about a different question: how many lines to plug in.

The SDK ships as @qoniai/qoni (Node 18+, ESM / CommonJS dual build, full TypeScript types), initialized with the AK / SK from Qoni Console. Step one is, again, delegation: GUMem's scopes are fine-grained (gumem.memory:read / gumem.memory:write / gumem.message:write), and the common session / write / recall path has a preset bundle, QoniScopeBundles.GUMEM_SESSION_RECALL.

Storing and recalling the conversation track takes three calls:

import { Qoni } from "@qoniai/qoni";

const qoni = new Qoni({ accessKey, secretKey });

const { data } = await qoni.delegateToken({
  user: { id: userId },
  scopes: ["gumem.memory:read", "gumem.memory:write", "gumem.message:write"],
});

// Store chat: open a session, write messages
await qoni.gumem.createSession({
  token: data.token,
  userId,
  sessionId: "daily-assistant",
  title: "Daily assistant memory",
});
await qoni.gumem.addMessages({
  token: data.token,
  sessionId: "daily-assistant",
  messages: [{ role: "user", content: "Keep daily planning suggestions concise — next action only." }],
});

// Recall: not a keyword search, but retrieval aimed at the task at hand
const context = await qoni.gumem.recall({
  token: data.token,
  sessionId: "daily-assistant",
  query: "What confirmed preferences should I consider for this user's reply style?",
  details: true,
});
// context.data is the ready context from earlier sections — feed it straight into your prompt assembly

The behavior track is a symmetric trio: qoni.gumem.actions.record (store), actions.recall (recall), and actions.stream (subscribe). Click streams, choices, abandonments land here — physically separate from the conversation track.

AutoDream has no "integration code" to speak of: once behavior lands through actions.record, idle-time analysis runs on its own — not one extra line from you. The insights it produces are the structured objects described earlier, with metric, baseline, delta, evidence, and confidence.

Delegation narrowing takes effect right here, too: an agent holding only gumem.memory:read gets rejected on any write. That's not a documentation convention — it's the credential boundary.

Don't trust a black-box memory: verify recall, correction, and scope item by item

Everything above lands as checkable items on a POC acceptance sheet:

  • Any recalled memory can trace through its anchor back to the original event;
  • After the user corrects or deletes a memory, subsequent recalls stop returning the old value;
  • Overturn an old preference with an explicit correction: the old memory is marked invalidated and points to the new one, with a complete, queryable evidence chain;
  • Subscribe to the memory-formation event stream: stages and counts only, no original content, secret-like strings masked;
  • Ask a question the memory store has no grounds for: the query agent says the evidence is thin instead of fabricating;
  • An answer generated this turn is not recalled within the same turn as "the user's historical fact";
  • Queries beyond the scope are rejected, no matter how clever the query agent is;
  • Take a recall-only delegation and attempt a write: rejected, and the rejection is on the record.

One quick-reference table to gather everything this piece covered:

Capability In one line
Dual-track memory Conversation + behavior, physically separated from ingestion to processing
Six kinds of memory Working / episodic / semantic / procedural / sentiment, plus the associative web
Refinement pipeline Conversation → facts → summaries → topics; every layer's product has fields and anchors
Memory physics Five half-life tiers of decay; reinforcement on confirmation; overturning leaves a chain
Three stores Vectors for similarity, graph for relations, transactions for the ledger — each independently rebuildable
The query agent Plans the recall path by question type, cross-checks evidence across types
Honesty protocol Only retrieved memories count; say so when evidence is thin; conflicts resolve by fixed priority
AutoDream Autonomous idle-time analysis: the model sees digests only, code runs sandboxed, insights carry evidence
Memory sovereignty See it, fix it, delete it; watch it grow without leaks
Governance & delegation Three hooks with shrinking authority; backend-enforced scope; recall via GenAuth delegation
SDK @qoniai/qoni; session / write / recall in three calls, a symmetric trio for the behavior track

92.9% on LoCoMo: weeks later, it still remembers you

On LoCoMo, the long-conversation memory benchmark, GUMem scored 92.9% (verifiable on our website).

Behind that number is a plain sentence: across dozens of sessions and weeks of silence, it still remembers who you are and what you want.

Memory is the line between a tool and a companion: a companion remembers where you left off

Memory isn't an item on a feature list. It's where agents and "tools" part ways: a tool meets you for the first time every time; a companion remembers where the conversation left off.

Not storing every sentence you've said — understanding who you are.

GUMem is currently in private build and will roll out in stages as part of Qoni. You can join the waitlist on our website.

AutoDream、多层记忆,与「记得你」这件事

只存聊天记录,Agent 只能翻旧账;会提炼、会遗忘、会纠错,才叫记忆

计算机科学把"存储"这件事做到了极致:数据库保证一条记录几十年不丢,搜索引擎让万亿网页毫秒可查,云盘替你存下每一张照片。三十年的基础设施,回答的都是同一个问题:怎么把信息原样存下来、原样找出来。

但"记忆"从来不是这个问题的答案。

人不是这样记住彼此的。你记不住朋友说过的每一句话,却记得他不吃香菜;你想不起上个月每一次会议,却总结出了"他不喜欢开会超过半小时"。记忆的本质不是存取,是加工:遗忘掉的、提炼出的、纠正过的,和留下来的一样重要。

大家都说 Agent 需要记忆。但今天大多数所谓的"记忆",只是把聊天记录存起来,要用的时候再搜出来。你说过的话,变成一条条等着被检索的文本,像翻监控录像,不像回忆。

那是数据库,不是记忆。

GUMem 照着人的记忆系统建模:会提炼、会遗忘、可追溯

GUMem 是 Qoni 的记忆层。它的整体形状由三个决定组成:

  • 不只记你说过什么,还记你做过什么。 对话是一条轨道,行为是另一条:点过什么、选过什么、放弃过什么。两条轨道从采集到加工物理分离,各有一套完整管线;
  • 原始信息被一层层提炼:对话 → 事实 → 摘要 → 主题。 越往上越浓缩,越往上越接近"这个人是谁";
  • 每一条记忆都带着来源指针、可信度和时间衰减,可以一路追溯回它诞生的那句话、那次点击。
GUMem 记忆平面:对话与行为双轨进入管线,逐层提炼,按需取用
从来源到管线,再到取用:记忆不是存进去就完了,每一层都在继续加工。

下面把这三个决定逐一拆开。

六种记忆各司其职,关系边让它们互相印证、互相纠错

人的记忆不是一个池子,GUMem 的也不是。原始输入先进入工作记忆,这是所有加工的起点;随后聚合成一段段情节记忆:发生过什么、在什么语境下发生;情节再往上沉淀,分出两条去向:语义记忆回答"这个人是谁、偏好什么",流程记忆回答"这件事该怎么做"。

第五种来自另一个源头:用户的反馈(满意、不满、纠正)生成情感记忆。它不描述事实,描述的是用户对事实的态度。

第六种最特别:关联记忆在其他记忆之间织网。支持、矛盾、引申、因果、相似、共用,六种关系边让记忆之间可以互相印证、互相纠错。

六种记忆:工作、情节、语义、流程、情感,与在它们之间织网的关联记忆
五种记忆各管一段,第六种在它们之间织网:六种关系边,让记忆可以互相印证、互相纠错。

每道工序的产物都带字段和锚点,任何记忆都能核验来历

"逐层提炼"不是一句气氛话,每一层的产物都是带字段的结构化对象:

  • 提取层产出事实与观察:可复用的最小信息单元,带着实体、来源、时间范围和处理状态;
  • 压缩层产出摘要与命题:带主题标签、置信度、衰减因子、检索权重,以及一枚指回原始证据的锚点;
  • 取用层产出五层就绪上下文:最近消息、会话上下文、用户长期记忆、会话长期记忆、已格式化的注入文本,五层各有配额,按任务可调(比如最近消息取几条、长期记忆注入几条)。
记忆的提炼流水线:双轨输入,经提取、压缩,到五层就绪上下文
每道工序都有明确的输入与产物:不是"存起来",是"加工成型"。

字段的意义在于可核验:任何一条被召回的记忆,都能顺着锚点回到它的原始事件;任何一个置信度,都能说清是被什么加固、被什么削弱的。一套说不清来历的记忆,在企业里是负债,不是资产。

先召回、再生成、再写回:顺序倒了,记忆会污染自己

管线的运转顺序,是一条刻意的纪律:先召回,再生成,再写回。

Agent 回答你之前,先取用进入本轮之前已经沉淀好的记忆;回答生成之后,这一轮的新信息才进入管线加工。顺序不能倒,倒了会出一种很隐蔽的病:模型把自己刚说的话当成了"用户的历史事实",越聊越自信,越聊越偏。

这种自我污染在长期记忆系统里格外危险,因为它是复利的:一轮的小偏差写进记忆,下一轮当作事实召回,再生成更偏的回答、写回更偏的记忆。记忆系统的第一要务不是记得多,是不污染自己

先召回,再生成,再写回:只朝一个方向转动的循环
顺序本身就是纪律:下一轮从新的记忆状态开始,但这一轮的生成永远不吃自己刚写下的东西。

按半衰期遗忘、按证据加固或推翻,过时的偏好不会永远当真

真正的记忆系统,必须回答三个数据库从不回答的问题。

记忆会遗忘吗? 会,而且按物理规律遗忘。GUMem 给每条记忆分配一个"半衰期":身份类记忆(他是工程师)以十年计,稳定关系以年计,偏好习惯以季度计,临时计划两周就淡,瞬时情绪两天即逝。一条记忆的活性由一个衰减函数决定:可信度乘上以半衰期为参数的指数衰减。活性高的优先被召回,活性沉底的自动退出舞台。不是所有记忆生而平等,也不该平等地永生。

记忆会变结实吗? 会。同一个偏好被反复印证,它的可信度上调、衰减放慢,像人反复加深的印象。

记忆能被推翻吗? 能,而且推翻有它的纪律。用户说"我不再喝美式了,改喝拿铁",旧记忆不会被物理删除,而是被标记为已失效,并指向推翻它的那条新记忆;条件收窄的旧偏好被降权、加速衰减但仍然在场。每一次改写都留下完整的证据链。我们把这叫审计友好的遗忘:记忆可以被纠正,但纠正本身永远有据可查。

记忆的物理学:五档半衰期各自衰减,活性决定召回,推翻留证据链
身份以十年计,情绪两天即逝:每条记忆按自己的半衰期衰减;加固有据,推翻留痕。

向量、图、事务库各管一件事,坏了都能独立重建

这套记忆物理学落在存储层,分工同样明确:向量索引负责语义相似("找和这句话最像的记忆"),图存储负责关系推理(谁支持谁、谁推翻谁、谁导致谁),事务数据库负责账本与幂等(哪条消息处理过了、哪条正在处理)。

三种存储互不依赖,每一层坏了都能独立重建。

查询 Agent 按问题类型规划取用、交叉核对证据,召回更准也不越权

存得好只是一半,取得准才是另一半。

大多数记忆系统的"取用",是一次向量搜索:拿问题去库里比对,把最像的几条捞出来交差。GUMem 的取用是一个会规划的查询 Agent:它手里有一套记忆工具箱(最近消息、会话上下文、记录检索、向量检索、图关系),按问题的类型决定先查哪种记忆:问"怎么做"先查流程记忆,问"发生过什么"先查情节记忆,问关系走图,问偏好先看情感轨。查到的证据跨类型交叉核对,最后组装成这项任务刚好需要的上下文。不多,也不少。

它还遵守一份写死在系统里的诚实协议:只有真正查到的记忆才算证据,禁止编造;证据不够时,它必须明说,而不是硬猜;证据互相冲突时,按固定的优先级消解(用户的显式更正压过推断出的偏好,本次会话压过旧记忆,具体约束压过宽泛喜好),解不开的,就把两边都摆出来告诉你"这里有分歧"。

还有一条硬边界:项目与用户的数据范围由系统强制,查询 Agent 只能传业务参数,连构造一条查询语句的权力都没有。聪明可以有,越权不可以。

查询 Agent:一套记忆工具箱,按问题类型路由,受诚实协议约束
会规划的取用:按问题选记忆、跨类型核对证据;诚实协议写死在系统里,数据范围由系统强制。

AutoDream 趁空闲消化行为日志,替你想到没想到的问题

人休息的时候,大脑也没有闲着。

Qoni 里有个趁 Agent 空闲时干活的机制,名字就叫 AutoDream:它自动把用户日积月累的行为流水,消化成真正的洞察。比如:"这位用户总在深夜下单""最近三周都在看去东京的机票"。

做梦,是个比喻。它做的事很实在:把一堆没人看的行为日志,变成能用的判断。而它特别的地方在于:这不是工程师预先写好的统计报表。是 Agent 自己决定分析什么、自己写分析代码、自己跑出结论。 你没想到要问的问题,它先替你想到了。

这套机制的工程内幕,比比喻更值得一讲:

  • 模型从头到尾看不到你的原始数据。 行为日志先经过一层不涉及任何模型的确定性统计,压缩成一份"数据概要";自然语言内容只保留长度等统计特征,原文从不外传。模型看到的只是这份概要,然后基于它提出分析需求。
  • Agent 写的代码跑在沙箱里。 生成的统计代码禁止引入依赖、禁止访问存储与网络,只能调用一套受控的统计接口;数据范围由后端强制划定,代码写得再聪明,也摸不到边界之外的一行日志。
  • 产出的洞察带着证据。 每条洞察都是结构化的:指标、维度、当前值、基线、变化幅度、证据与可信度,能核验,而不是一句漂亮话。
AutoDream 流水线:确定性统计先行,模型只看概要,代码跑在沙箱,洞察带证据
会做梦,而且做的是规矩的梦:模型看不到原始数据,代码出不了沙箱,洞察带着证据。

记忆主权归用户:Agent 记了什么,你能看、能改、能删

记忆越强,另一个问题就越重要:Agent 记了你什么,你自己知道吗?

在 GUMem 里,答案是三个"能":

  • 能看。 每一条记忆都摆在明面上,带着来源和可信度:它为什么这么认为、有多确定,一目了然。
  • 能改,能删。 记错了就改,不想被记住就删。记忆属于用户,不属于模型。
  • 能看着它长出来。 写入一批消息后,可以实时订阅它的加工过程:事实提取好了、摘要生成了、主题更新了,一个阶段一个事件推给你。这条事件流只回阶段和计数、不回内容本身,密钥类字符一律脱敏:可观察,但不泄密。
记忆主权:能看、能改能删、能看着它长出来
三个"能":来源与可信度摆在明面上,改删的权力在用户手里,加工过程可观察但不泄密。

我们把这叫记忆主权:不是 Agent 悄悄记住你,而是你允许它记住什么。

企业规则挂进三个挂点,权限逐级收窄,越不过数据边界

企业接入记忆层,第一个问题往往是:"我的业务规则和合规要求,挂在哪里?" GUMem 在管线上留了三个挂点,且刻意让它们的权限一级比一级小:

  • 写入之前:可以改写数据。清洗敏感字段、补全业务信息、纠正格式,都发生在记忆落库之前;
  • 进模型之前:只能追加指令。业务规则、合规约束以指令形式注入,但不能篡改记忆本身;
  • 模型之后:只读通知。审计管道、同步 CRM 或推荐系统,看得到结果,改不了任何东西。

可改写、只可追加、只读:这个递减序列本身就是治理理念。而真正的硬边界不在挂点上,在系统强制的数据范围里:项目与用户的 scope 由后端划定,任何挂点、任何查询都越不过去。

三个治理挂点:可改写、只可追加、只读,权限一级比一级小
挂点管扩展,scope 管边界:权限递减是理念,后端强制是底线。

用户嘴上"随便看看",行为轨从点击流里补出没说出口的偏好

一个典型的落地场景:电商导购 Agent。

用户嘴上说"随便看看",但行为轨里写着另一个故事:反复打开浅色球鞋、筛选 42 码、一次次点开碳板跑鞋、又几秒就退出。对话轨里没有的偏好,行为轨替他说了:**浅色、42 码、避开碳板。**下一次推荐,Agent 已经懂了。

这就是双轨记忆的意义:不是多存一份日志,而是补上"人不会说出口"的那一半。

跨会话召回:新会话里它依然记得你上周关心什么

再看一个知识工作场景。用户在一个全新的会话里问:"帮我比一比这家供应商,跟我上周看中的那家怎么样?"

没有粘贴上下文,没有重新交代背景。查询 Agent 跨会话召回:上周那家叫什么、用户当时最关心部署风险、他喜欢简洁的回答风格。于是答案一步到位:"比上周的那家便宜,但审计导出和部署管控更弱。"每一条支撑记忆都带来源凭证:有的来自对话,有的来自点击流。

对用户,这是"它记得我";对工程师,这是一条可以核验的证据链。

记忆取用凭 GenAuth 委托:拿到的是一把钥匙,不是整个库

在企业里,记忆层从来不是孤岛。GUMem 与 GenAuth 的身份边界是打通的:Agent 挂载记忆时,要声明为哪个用户、允许哪些动作,比如只允许召回、不允许写入。这份声明本身,就是一张范围收窄的委托:Agent 拿到的不是"记忆库的钥匙",而是"只能召回这一个用户"的钥匙。 记忆的每一次取用,和工具调用、网页操作一样,走同一套身份、边界与审计。

几行代码接入 Chat 与行为的存取;行为落轨后,AutoDream 不用多写一行

前面讲的都是机器内部。开发者关心的是另一件事:接进来要几行代码。

SDK 包名是 @qoniai/qoni(Node 18+,ESM / CommonJS 双构建,TypeScript 类型齐备),凭 Qoni Console 的 AK / SK 初始化。第一步同样是委托:GUMem 的 scope 拆得很细(gumem.memory:read / gumem.memory:write / gumem.message:write),会话、写入、召回这条常用链路有预置组合 QoniScopeBundles.GUMEM_SESSION_RECALL

对话轨的存入与召回,三个调用:

import { Qoni } from "@qoniai/qoni";

const qoni = new Qoni({ accessKey, secretKey });

const { data } = await qoni.delegateToken({
  user: { id: userId },
  scopes: ["gumem.memory:read", "gumem.memory:write", "gumem.message:write"],
});

// Chat 存入:开一个会话,写入消息
await qoni.gumem.createSession({
  token: data.token,
  userId,
  sessionId: "daily-assistant",
  title: "日常助理记忆",
});
await qoni.gumem.addMessages({
  token: data.token,
  sessionId: "daily-assistant",
  messages: [{ role: "user", content: "日报建议尽量简短,只给下一步行动。" }],
});

// 召回:不是关键词搜索,是面向当前任务的取用
const context = await qoni.gumem.recall({
  token: data.token,
  sessionId: "daily-assistant",
  query: "这个用户对回复风格有什么已确认的偏好?",
  details: true,
});
// context.data 就是前文说的就绪上下文,直接进你的提示词组装

行为轨是对称的三个动作:qoni.gumem.actions.record(存入)、actions.recall(召回)、actions.stream(订阅)。点击流、选择、放弃,从这里落轨,物理上与对话轨分开。

AutoDream 则没有"接入代码"这个概念:行为一旦经 actions.record 落轨,空闲期的分析就自动运转,不需要你多写一行。产出的洞察是前文说过的结构化对象,带指标、基线、变化幅度、证据与可信度。

委托的收窄在这里也直接生效:一个只拿到 gumem.memory:read 的 Agent,调用任何写入都会被拒。这不是文档约定,是凭证边界。

不用轻信黑盒记忆:召回、更正、越权场景逐项验收

以上能力,都能落成 POC 验收单上可以打钩的条目:

  • 任意一条被召回的记忆,可以顺着锚点回溯到它的原始事件;
  • 用户改写或删除一条记忆后,后续召回不再返回旧值;
  • 用显式更正推翻一条旧偏好:旧记忆被标记为已失效并指向新记忆,证据链完整可查;
  • 订阅记忆形成的事件流:只回阶段与计数、不含内容原文,密钥类字符已脱敏;
  • 提一个记忆库里没有依据的问题:查询 Agent 明说证据不够,而不是编造;
  • 同一轮刚生成的回答,不会在本轮被当作"用户的历史事实"召回;
  • scope 之外的查询,无论查询 Agent 多聪明,一律被拒;
  • 只授予"召回"的委托去尝试写入:被拒,且拒绝有记录。

一张速查表,收拢全文讲过的能力:

能力 一句话说明
双轨记忆 对话轨 + 行为轨,从采集到加工物理分离,各有完整管线
六种记忆 工作 / 情节 / 语义 / 流程 / 情感,加上织网的关联记忆
提炼管线 对话 → 事实 → 摘要 → 主题,每层产物带字段、带锚点
记忆物理学 五档半衰期衰减,反复印证加固,推翻留证据链
三存储分工 向量管相似、图管关系、事务库管账本,各自可独立重建
查询 Agent 按问题类型规划取用路径,跨类型交叉核对证据
诚实协议 查到的才算证据,不够必须明说,冲突按固定优先级消解
AutoDream 空闲时自主分析行为流水:模型只看概要,代码跑沙箱,洞察带证据
记忆主权 能看、能改、能删,加工过程可订阅且不泄密
治理与委托 三挂点权限递减,scope 后端强制,取用凭 GenAuth 委托
SDK 接入 @qoniai/qoni,会话 / 写入 / 召回三调用,行为轨对称三动作

LoCoMo 长对话记忆测试 92.9%:隔几周它还记得你

在长对话记忆测试 LoCoMo 上,GUMem 拿到了 92.9% 的成绩(官网可查)。

这个分数背后是一句朴素的话:隔着几十个会话、隔着几个星期,它依然记得你是谁、你要什么。

记忆是工具与伙伴的分界线:伙伴记得上次聊到哪里

记忆不是功能列表里的一项。它是 Agent 和"工具"分道扬镳的地方:工具每次见你都是初次见面,伙伴才会记得上次聊到哪里。

不是存下你说过的每句话,而是理解你是谁。

GUMem 目前处于 private build,将随 Qoni 分阶段开放,可以在官网加入 waitlist。