pub struct SubagentJsonl { /* private fields */ }Expand description
Adapter for subagent JSONL transcripts.
Each line in the transcript is a TranscriptEntry. The adapter produces one
IngestDocument per entry whose flat text content is non-empty. Context for
each entry is the plain text of the context_window preceding entries.
§Examples
use zeph_memory::graph::ingest::{SubagentJsonl, IngestSourceAdapter, ImportBatchId};
let raw = r#"{"seq":0,"timestamp":"2026-01-01T00:00:00Z","message":{"role":"user","content":"hello","parts":[]}}"#;
let adapter = SubagentJsonl::new("task-42");
let batch = ImportBatchId::new();
let docs = adapter.parse(raw, &batch).unwrap();
assert!(!docs.is_empty());Implementations§
Source§impl SubagentJsonl
impl SubagentJsonl
Sourcepub fn new(task_id: impl Into<String>) -> Self
pub fn new(task_id: impl Into<String>) -> Self
Creates a new SubagentJsonl adapter for the given task ID.
task_id is embedded in every document’s source_uri as
"subagent:<task_id>#<seq>".
The context_window defaults to 3 preceding messages.
Sourcepub fn with_context_window(self, n: usize) -> Self
pub fn with_context_window(self, n: usize) -> Self
Overrides the context window size.
Trait Implementations§
Source§impl IngestSourceAdapter for SubagentJsonl
impl IngestSourceAdapter for SubagentJsonl
Source§fn parse(
&self,
raw: &str,
batch_id: &ImportBatchId,
) -> Result<Vec<IngestDocument>, MemoryError>
fn parse( &self, raw: &str, batch_id: &ImportBatchId, ) -> Result<Vec<IngestDocument>, MemoryError>
Parse a JSONL transcript string.
Lines that fail to parse are skipped with a warning; entries whose flat text content is empty are also skipped (nothing to extract).
Auto Trait Implementations§
impl Freeze for SubagentJsonl
impl RefUnwindSafe for SubagentJsonl
impl Send for SubagentJsonl
impl Sync for SubagentJsonl
impl Unpin for SubagentJsonl
impl UnsafeUnpin for SubagentJsonl
impl UnwindSafe for SubagentJsonl
Blanket Implementations§
Source§impl<T> BorrowMut<T> for Twhere
T: ?Sized,
impl<T> BorrowMut<T> for Twhere
T: ?Sized,
Source§fn borrow_mut(&mut self) -> &mut T
fn borrow_mut(&mut self) -> &mut T
Mutably borrows from an owned value. Read more
Source§impl<T> Instrument for T
impl<T> Instrument for T
Source§fn instrument(self, span: Span) -> Instrumented<Self> ⓘ
fn instrument(self, span: Span) -> Instrumented<Self> ⓘ
Source§fn in_current_span(self) -> Instrumented<Self> ⓘ
fn in_current_span(self) -> Instrumented<Self> ⓘ
Source§impl<T> IntoEither for T
impl<T> IntoEither for T
Source§fn into_either(self, into_left: bool) -> Either<Self, Self> ⓘ
fn into_either(self, into_left: bool) -> Either<Self, Self> ⓘ
Converts
self into a Left variant of Either<Self, Self>
if into_left is true.
Converts self into a Right variant of Either<Self, Self>
otherwise. Read moreSource§fn into_either_with<F>(self, into_left: F) -> Either<Self, Self> ⓘ
fn into_either_with<F>(self, into_left: F) -> Either<Self, Self> ⓘ
Converts
self into a Left variant of Either<Self, Self>
if into_left(&self) returns true.
Converts self into a Right variant of Either<Self, Self>
otherwise. Read moreSource§impl<T> IntoRequest<T> for T
impl<T> IntoRequest<T> for T
Source§fn into_request(self) -> Request<T>
fn into_request(self) -> Request<T>
Wrap the input message
T in a tonic::Request