Interface TranscriptStore
- All Known Implementing Classes:
FilesystemTranscriptStore,ObjectStoreTranscriptStore
public interface TranscriptStore
Narrow append-oriented store for session transcripts.
Orthogonal to BaseStore (document
KV). Writes are immutable segments — never in-place append on a shared object — so
concurrent writers cannot silently overwrite each other.
Key layout:
{tenant}/{agentId}/{sessionId}/events/{seqStart}-{seqEnd}-{writerId}.jsonl
-
Nested Class Summary
Nested ClassesModifier and TypeInterfaceDescriptionstatic final recordMetadata for one immutable segment. -
Method Summary
Modifier and TypeMethodDescriptionappendSegment(TranscriptRef ref, long seqStart, long seqEnd, String writerId, byte[] jsonl) Appends one immutable JSONL segment and returns its storage key.default voidcompact(TranscriptRef ref) Optional compaction of small segments into a single object.voiddelete(TranscriptRef ref) Deletes all segments for the transcript.Lists segments ordered byseqStartascending.readSegment(String segmentKey) Opens a segment for reading; caller must close the stream.default TranscriptStorewithRuntimeContext(io.agentscope.core.agent.RuntimeContext rc) Returns a store view bound to the given per-callRuntimeContextso that namespace-scoped backends (e.g., per-user local filesystems) route transcript segments into the caller's namespace instead of the un-namespaced root.
-
Method Details
-
appendSegment
Appends one immutable JSONL segment and returns its storage key.- Parameters:
ref- transcript identityseqStart- inclusive start sequence (caller-assigned, contiguous preferred)seqEnd- inclusive end sequencewriterId- unique writer / replica id (prevents key collisions)jsonl- UTF-8 JSONL payload (oneSessionEntryper line)- Returns:
- storage key of the written segment
-
listSegments
Lists segments ordered byseqStartascending. -
readSegment
Opens a segment for reading; caller must close the stream. -
compact
Optional compaction of small segments into a single object. -
withRuntimeContext
Returns a store view bound to the given per-callRuntimeContextso that namespace-scoped backends (e.g., per-user local filesystems) route transcript segments into the caller's namespace instead of the un-namespaced root.Stores whose location is fixed at construction time may ignore the context and return
this. -
delete
Deletes all segments for the transcript.
-