MCPcopy Create free account
hub / github.com/1jehuang/jcode / extract_from_transcript

Method extract_from_transcript

crates/jcode-base/src/memory.rs:1115–1147  ·  view source on GitHub ↗

Extract memories from a session transcript using the Haiku sidecar

(
        &self,
        transcript: &str,
        session_id: &str,
    )

Source from the content-addressed store, hash-verified

1113
1114 /// Extract memories from a session transcript using the Haiku sidecar
1115 pub async fn extract_from_transcript(
1116 &self,
1117 transcript: &str,
1118 session_id: &str,
1119 ) -> Result<Vec<String>> {
1120 if !memory_llm_judge_available() {
1121 crate::logging::info("Memory transcript extraction skipped: LLM judge unavailable");
1122 return Ok(Vec::new());
1123 }
1124
1125 let sidecar = Sidecar::new();
1126 let extracted = sidecar.extract_memories(transcript).await?;
1127
1128 let mut ids = Vec::new();
1129 for memory in extracted {
1130 let category: MemoryCategory = memory.category.parse().unwrap_or(MemoryCategory::Fact);
1131 let trust = match memory.trust.as_str() {
1132 "high" => TrustLevel::High,
1133 "medium" => TrustLevel::Medium,
1134 _ => TrustLevel::Low,
1135 };
1136
1137 let entry = MemoryEntry::new(category, memory.content)
1138 .with_source(session_id)
1139 .with_trust(trust);
1140
1141 // Store in project scope by default
1142 let id = self.remember_project(entry)?;
1143 ids.push(id);
1144 }
1145
1146 Ok(ids)
1147 }
1148
1149 /// Check if stored memories are relevant to the current context
1150 /// Returns memories that the sidecar deems relevant

Callers

nothing calls this directly

Calls 9

extract_memoriesMethod · 0.80
with_trustMethod · 0.80
with_sourceMethod · 0.80
remember_projectMethod · 0.80
infoFunction · 0.50
parseMethod · 0.45
as_strMethod · 0.45
pushMethod · 0.45

Tested by

no test coverage detected