Restore episodic Range filters (#40) + SDK client wrappers + docs for all new RPCs - #54
Merged
Conversation
Reconstructing one conversation (Zep get_session_messages, Letta recall) is a core recall primitive. R2 made role/session_id first-class Event fields, but Range only windowed by cursor/timestamp — so "get all messages for session X" forced an O(namespace) transfer for O(session) data that policy caps couldn't bound. - RangeRequest / RangeOptions gain session_id, role, and type equality predicates. Each is independent (empty = no filter) and ANDs with the other predicates and with the cursor/time window. Additive proto tags; gen/ regenerated via buf. - Postgres appends the predicates to the Range WHERE clause; migration 0005 adds a partial (namespace, session_id, cursor) index (WHERE session_id <> '') so the session-reconstruction path is index-backed and rows with no session stay out of the index. Memory filters in its existing scan. - Conformance (both harnesses) covers each predicate alone, their AND combination, ANDing with the cursor window, empty = no filter, and no-match. buf lint/format, go vet, golangci-lint, go test -race all clean; verified on memory and a real Postgres. Composes with the write-path parity work (#39); stacked on that branch. Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>
The Python SDK stubs were stale (no episodic Expire, kv MultiGet, artifact/lease List, admin) and the client had no wrappers for them. Regenerate all *_pb2 / *_pb2_grpc from the current proto (adds the admin package) and add idiomatic wrappers: - kv.multi_get(namespace, keys); kv.scan gains start_after (keyset cursor). - episodic.append gains dedup_key / supersedes / source; episodic.range gains include_deleted + session_id / role / type filters; new episodic.expire. - artifact.list (metadata filter + start_after cursor); lease.list. - New m.admin sub-client with list_namespaces. - Makefile proto-python now touches the graph + admin package __init__.py too. Verified: SDK imports, the new stub messages/fields exist, and every wrapper's request object constructs against the regenerated descriptors. Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>
Mirror the Python SDK additions in the TS client and regenerate the protobuf-es stubs from the current proto (adds the admin package). - kv.multiGet(namespace, keys); kv.scan gains a startAfter keyset cursor. - episodic.append gains dedupKey / supersedes / source; episodic.range gains includeDeleted + sessionId / role / type filters; new episodic.expire (its ExpireAction is re-exported as EpisodicExpireAction to avoid colliding with the semantic one). - artifact.list (metadata filter + startAfter cursor); lease.list. - New m.admin client with listNamespaces; admin message types re-exported. Verified: tsc typecheck + build clean and the offline smoke tests pass. Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>
Bring website/docs current with the episodic lifecycle/filter work and the enumerate/discovery parity RPCs. - episodic: Expire, dedup_key, supersedes/source, include_deleted, and the session_id/role/type Range filters — API, drivers, gRPC + Python examples, and the episodic.expire op. - kv: MultiGet, Scan start_after keyset cursor, KVItem.content_type on Scan/MultiGet, and the postgres COLLATE "C" note. - artifact: List (metadata filter + start_after cursor) + artifact.list op. - lease: List + lease.list op. - New Building blocks → Admin page (ListNamespaces, admin.inspect, has_count semantics) + sidebar entry + intro/grpc reflection listing. - Python SDK client page: new methods per block and an Admin section. Docusaurus build is clean (no broken links / MDX errors). Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>
7 tasks
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Brings the SDKs and docs up to date with the episodic lifecycle work and the enumerate/discovery parity RPCs — and restores a feature that was lost from
main.While auditing docs I found the
session_id/role/typeRange predicates + migration0005were missing frommain: PR #49 (which closed #40) was merged into the stacked #48 branch, but that content didn't reachmainwhen #48 landed. This PR cherry-picks the original, verified #40 commit back ontomain(proto tags 9/10/11 preserved for wire compatibility). Re-verified:buf,go vet,go test -race,golangci-lintall clean; conformance passes on memory + real Postgres.SDK client wrappers (Python + TypeScript)
The generated stubs were stale (no episodic
Expire, kvMultiGet, artifact/leaseList, admin) and neither client wrapped them. Regenerated both SDKs' stubs (adds theadminpackage) and added idiomatic wrappers:multiGet/multi_get;scangainsstartAfterkeyset cursor.appendgainsdedupKey/supersedes/source;rangegainsincludeDeleted+sessionId/role/type; newexpire.list; lease:list.m.admin.list_namespaces/m.admin.listNamespaces).tsctypecheck + build + offline smoke tests).Docs (
website/docs)Every new RPC/field/op documented: the episodic, kv, artifact, lease block pages (API, drivers, gRPC + Python examples, op tables), a new Admin page + sidebar/nav entry, and the Python SDK client page. Docusaurus build is clean (no broken links / MDX errors).
Closes #40 (again 😅) and finishes documenting #39/#41.