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:
jif-oai
2026-02-10 10:10:24 +00:00
committed by GitHub
parent 44ebf4588f
commit 6049ff02a0
27 changed files with 1998 additions and 82 deletions

View File

@@ -29,13 +29,13 @@ The public interface of this crate is intentionally small and uniform:
- Output: `Vec<ResponseItem>`.
- `CompactClient::compact_input(&CompactionInput, extra_headers)` wraps the JSON encoding and retry/telemetry wiring.
- **Memory trace summarize endpoint**
- Input: `MemoryTraceSummarizeInput` (re-exported as `codex_api::MemoryTraceSummarizeInput`):
- **Memory summarize endpoint**
- Input: `MemorySummarizeInput` (re-exported as `codex_api::MemorySummarizeInput`):
- `model: String`.
- `traces: Vec<MemoryTrace>`.
- `MemoryTrace` includes `id`, `metadata.source_path`, and normalized `items`.
- `raw_memories: Vec<RawMemory>` (serialized as `traces` for wire compatibility).
- `RawMemory` includes `id`, `metadata.source_path`, and normalized `items`.
- `reasoning: Option<Reasoning>`.
- Output: `Vec<MemoryTraceSummaryOutput>`.
- `MemoriesClient::trace_summarize_input(&MemoryTraceSummarizeInput, extra_headers)` wraps JSON encoding and retry/telemetry wiring.
- Output: `Vec<MemorySummarizeOutput>`.
- `MemoriesClient::summarize_input(&MemorySummarizeInput, extra_headers)` wraps JSON encoding and retry/telemetry wiring.
All HTTP details (URLs, headers, retry/backoff policies, SSE framing) are encapsulated in `codex-api` and `codex-client`. Callers construct prompts/inputs using protocol types and work with typed streams of `ResponseEvent` or compacted `ResponseItem` values.