Skip to content

feat: add per-agent memory summarization and retrieval to control context growth #28

@XD319

Description

@XD319

Summary

Add a lightweight per-agent memory system that summarizes completed interactions and retrieves only relevant memories for future prompts.

Problem

As the simulation runs longer, agents either:

  • lose continuity because old interactions are dropped, or
  • become expensive / noisy if too much history is kept in prompts

This makes long-running worlds less believable and less scalable.

Proposal

Introduce:

  1. memory summarization after interactions
  2. memory retrieval before future prompts

Instead of replaying full history, each agent stores short memory summaries and only a small relevant subset is injected into the prompt.

Initial scope

  • store short memory summaries per agent
  • persist them in server-side state
  • retrieve top-N relevant memories by partner / location / recency
  • inject them into the prompt

Non-goals

  • vector DB
  • advanced ranking
  • reflection
  • lifecycle / aging systems
  • memory UI

Acceptance criteria

  • interactions create memory summaries
  • memories persist outside active prompt context
  • only bounded relevant memories are injected
  • agent continuity improves without unbounded context growth

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions