Skip to content

Implement memory retrieval, ranking, and context injection #41

@Aureliolo

Description

@Aureliolo

Context

Build the memory retrieval pipeline that fetches relevant memories and injects them into the agent's context before LLM calls. This is what makes memory actually useful — without injection, stored memories are never consulted.

Acceptance Criteria

Retrieval Pipeline

  • Retrieve relevant memories based on current task/query context
  • Rank results by relevance and recency (configurable weighting)
  • Token budget enforcement for memory injection (don't exceed context window)
  • Graceful degradation when too many relevant memories exist (truncate/summarize)

Context Injection

  • Inject retrieved memories into system prompt or conversation history
  • Configurable injection point (system prompt vs user context vs both)
  • Clear formatting of injected memories (agent can distinguish memory from instruction)

Shared Knowledge

  • Retrieve from shared knowledge base (cross-agent memories)
  • Merge personal and shared memories with appropriate priority

Testing

  • Unit tests for retrieval and ranking logic (>80% coverage)
  • Integration test demonstrating agent behavior change when memories are available vs absent

Dependencies

Design Spec Reference

  • Section 7 — Memory System

Metadata

Metadata

Assignees

No one assigned

    Labels

    prio:highImportant, should be prioritizedscope:medium1-3 days of workspec:memoryDESIGN_SPEC Section 7 - Memory & Persistencetype:featureNew feature implementation

    Projects

    No projects

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions