mirror of
https://github.com/openai/codex.git
synced 2026-04-29 17:06:51 +00:00
memories: add extraction and prompt module foundation (#11200)
## Summary - add the new `core/src/memories` module (phase-one parsing, rollout filtering, storage, selection, prompts) - add Askama-backed memory templates for stage-one input/system and consolidation prompts - add module tests for parsing, filtering, path bucketing, and summary maintenance ## Testing - just fmt - cargo test -p codex-core --lib memories::
This commit is contained in:
@@ -38,30 +38,32 @@ pub struct CompactionInput<'a> {
|
||||
pub instructions: &'a str,
|
||||
}
|
||||
|
||||
/// Canonical input payload for the memory trace summarize endpoint.
|
||||
/// Canonical input payload for the memory summarize endpoint.
|
||||
#[derive(Debug, Clone, Serialize)]
|
||||
pub struct MemoryTraceSummarizeInput {
|
||||
pub struct MemorySummarizeInput {
|
||||
pub model: String,
|
||||
pub traces: Vec<MemoryTrace>,
|
||||
#[serde(rename = "traces")]
|
||||
pub raw_memories: Vec<RawMemory>,
|
||||
#[serde(skip_serializing_if = "Option::is_none")]
|
||||
pub reasoning: Option<Reasoning>,
|
||||
}
|
||||
|
||||
#[derive(Debug, Clone, Serialize)]
|
||||
pub struct MemoryTrace {
|
||||
pub struct RawMemory {
|
||||
pub id: String,
|
||||
pub metadata: MemoryTraceMetadata,
|
||||
pub metadata: RawMemoryMetadata,
|
||||
pub items: Vec<Value>,
|
||||
}
|
||||
|
||||
#[derive(Debug, Clone, Serialize)]
|
||||
pub struct MemoryTraceMetadata {
|
||||
pub struct RawMemoryMetadata {
|
||||
pub source_path: String,
|
||||
}
|
||||
|
||||
#[derive(Debug, Clone, Deserialize, PartialEq, Eq)]
|
||||
pub struct MemoryTraceSummaryOutput {
|
||||
pub trace_summary: String,
|
||||
pub struct MemorySummarizeOutput {
|
||||
#[serde(rename = "trace_summary", alias = "raw_memory")]
|
||||
pub raw_memory: String,
|
||||
pub memory_summary: String,
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user