Skip to content

feat: add conversation memory service prototype - #565

Draft
franciscojavierarceo wants to merge 2 commits into
mainfrom
codex/conversation-memory
Draft

franciscojavierarceo wants to merge 2 commits into
mainfrom
codex/conversation-memory

Conversation

@franciscojavierarceo

Copy link
Copy Markdown
Collaborator

Summary

Add an opt-in Rust memory-service prototype over the existing file-search ingestion and retrieval service. It stores summaries and bounded searchable transcripts, retrieves owner-filtered temporary model context, and supports forgetting; the demo verifies recall across a SQLite database restart.

Refs #563, which tracks automatic Responses integration. This PR is a library prototype: it adds no automatic recall/summarization hooks, HTTP memory settings, private-store ACLs, default-store provisioning, or background replacement jobs.

Changes by API

API What changed
Core Rust library Adds typed memory storage, recall, and deletion; no wire change.

Flow

flowchart LR
    App["Application: resolved owner, completed stored response, summary"] --> Memory["NEW MemoryService"]
    Memory --> Files["Existing FileSearchService"]
    Files --> Storage["Existing repository and blob store"]
    Files --> Recall["NEW bounded MemoryContext"]
    Recall --> App
Loading

New modules

  • types/memory.rs: resolved owner, options, and summary/transcript contracts.
  • tool/memory/mod.rs: memory operations composed with the existing file-search service.
  • tool/memory/context.rs: bounded JSON-encoded excerpts and temporary model-message projection.

Design, limitations, and supplementary class diagram.

Test Plan

  • cargo test -p agentic-server-core --lib --test memory_service --test file_search_service --test file_search_tool_test --offline: 1,533 passed, 9 ignored (existing manual/environment-dependent cases, including PostgreSQL).
  • Memory integration covers restart recall, mandatory owner filtering and authenticated-owner precedence, opt-out/read-only controls, unsuccessful/unstored responses, ordinary-file exclusion, transcript-only detail recall, Unicode/escaping limits, invalid options, failed ingestion cleanup, and retry after a failed SQL deletion.
  • Regression checks: injected SQL deletion failure reproduced the premature-detachment defect before the fix; forgetting now reuses the atomic Files deletion path. Escaped excerpts retain a useful fitting prefix.
  • cargo clippy -p agentic-server-core --all-targets --offline -- -D warnings: passed.
  • uvx --offline pre-commit run --all-files, formatting, and diff checks: passed.
  • cargo run -p agentic-server-core --example memory_demo --offline: passed; write → reopen database → recall → owner-isolation check → forget.
  • No cassettes changed: this slice adds no provider wire contract or automatic executor path. No live-model, new PostgreSQL memory, or shared-deployment privacy claim. The full workspace suite was not run.

Signed-off-by: Francisco Javier Arceo <4163062+franciscojavierarceo@users.noreply.github.com>
Signed-off-by: Francisco Javier Arceo <4163062+franciscojavierarceo@users.noreply.github.com>

This branch has not been deployed

No deployments
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant