Skip to content

feat(memory): brainId, subjectId, and predicate facets on admin.list - #23

Open
rrader26 wants to merge 1 commit into
mainfrom
feat/list-memory-brain-facets
Open

feat(memory): brainId, subjectId, and predicate facets on admin.list#23
rrader26 wants to merge 1 commit into
mainfrom
feat/list-memory-brain-facets

Conversation

@rrader26

Copy link
Copy Markdown
Contributor

Small follow-up to #21/#22, found while building the brain-scoped memory view
in the chat-with-memory example.

GET /admin/memory accepts brainId, subjectId, and predicate, and the
SDK's list() already forwards params verbatim as query string — so all three
worked at runtime. They were just absent from ListMemoryParams, so a
TypeScript caller had to cast to Record<string, unknown> to pass them, which
is exactly the kind of thing an SDK exists to prevent.

// before — reaches the server, but only via a cast
await tf.memory.admin.list({ limit: 50, brainId } as Record<string, unknown>)

// after
await tf.memory.admin.list({ limit: 50, brainId })

brainId gets a doc comment calling out the asymmetry that surprised me:
it is a real server-side filter on memories, while the knowledge graph is
still workspace-wide because entities dedupe across brains. Anyone building a
per-brain view will hit that difference and should not have to discover it by
comparing two screens.

Type-only change — no runtime behaviour differs. Typecheck and build clean.

The server's admin list route already accepts all three, and `list` passes
params straight through as query — so they worked at runtime and were
simply missing from ListMemoryParams, which meant TypeScript callers had to
cast to reach them.

brainId is a real server-side filter, unlike the knowledge graph, which
stays workspace-wide because entities dedupe across brains. The doc comment
says so, since the asymmetry is surprising.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants