Skip to content

Commit e061ddb

Browse files
committed
docs(soul): remove earlier traces under both forms of the agent id
memory.legacy_traces counts the traces under the agent's plain id and under its encoded form, which differs when the id holds '/', '%' or ':'. The documented removal deleted the plain form alone, so the line kept counting traces a learning layer had re-filed. The docs now delete both, and encodePlainScopeId is exported so a host can name the encoded form. Signed-off-by: jddunn <[email protected]>
1 parent 4f374fd commit e061ddb

2 files changed

Lines changed: 15 additions & 4 deletions

File tree

‎docs/SOUL_FILES.md‎

Lines changed: 14 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -155,10 +155,20 @@ traces it filed under the agent's plain id (one `memory.legacy_traces` log line
155155
them at start), the chunks of the pages it indexed there, and the page files it
156156
compiled into the folder. A call with no user still reads those page files through
157157
`read_memory_page`. Nothing of it is moved, rewritten or deleted by the library, since
158-
whose words it holds is not recorded. To remove it,
159-
`await agent.memory.deleteScope('persona', '<agentId>')` deletes the earlier traces and
160-
chunks under the agent's plain id for good; then delete the compiled page files (the
161-
ones whose front matter lists `sources`), and the next start writes `index.md` again.
158+
whose words it holds is not recorded. To remove it, delete the earlier traces and
159+
chunks under the agent's plain id for good, in both forms the line counts (they are
160+
one id unless the agent id holds `/`, `%` or `:`):
161+
162+
```ts
163+
import { encodePlainScopeId } from '@framers/agentos';
164+
165+
await agent.memory.deleteScope('persona', agentId);
166+
const encoded = encodePlainScopeId('persona', agentId);
167+
if (encoded !== agentId) await agent.memory.deleteScope('persona', encoded);
168+
```
169+
170+
Then delete the compiled page files (the ones whose front matter lists `sources`), and
171+
the next start writes `index.md` again and logs no `memory.legacy_traces` line.
162172

163173
The memory index in the system prompt is rendered from the operator's page files and
164174
the text migrated from `MEMORY.md` (below), not read from `index.md`; `loadSoul()` and

‎src/cognition/memory/index.ts‎

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -154,6 +154,7 @@ export {
154154
type ConversationSubject,
155155
} from './retrieval/store/conversationScopeKey.js';
156156
export { ensureScopeRow, registerUnregisteredConversationScopes } from './retrieval/store/conversationScopes.js';
157+
export { encodePlainScopeId } from './retrieval/store/scopeIdForm.js';
157158
export { SqlKnowledgeGraph } from './retrieval/store/SqlKnowledgeGraph.js';
158159
export { HnswSidecar, type HnswSidecarConfig, type HnswQueryResult } from './retrieval/store/HnswSidecar.js';
159160
export { SqlMemoryGraph } from './retrieval/store/SqlMemoryGraph.js';

0 commit comments

Comments
 (0)