Skip to content

Dream Weaver: structured memory categories with merge rules #59

@lesaai

Description

@lesaai

Summary

Upgrade Dream Weaver's memory extraction from 5 flat categories (fact/preference/event/opinion/skill) to 6 structured categories with merge vs non-merge rules.

Proposed categories

Category Mergeable? What it captures
Profile Yes User/agent identity and attributes
Preferences Yes Choices, conventions, style rules
Entities Yes People, projects, repos, tools
Events No Decisions, incidents, milestones (preserve temporal context)
Cases (agent) No Problem-solution pairs for future reference
Patterns (agent) Yes Reusable approaches and workflows

Mergeable = dedup and update existing. Non-mergeable = always create new (events are unique).

What changes

  • dream-weaver-protocol/prompts.ts ... update MEMORIES section in both full and incremental prompts
  • dream-weaver-protocol/parser.ts ... parse new category prefixes
  • dream-weaver-protocol/types.ts ... update MemoryCategory type
  • Crystal schema ... add category column if not already present

Caveats (read before implementing)

  • Is the current 5-category model actually causing problems? If search quality is fine and dedup (#X) handles duplicates, better categories may not matter. Don't add complexity for taxonomy's sake.
  • The merge rules are the real value, not the categories. If we implement dedup (#X) with the existing categories and it works well, the category rename is cosmetic. Focus on merge behavior, not naming.
  • Dream Weaver prompts are fragile. Changing the extraction format means re-testing the full and incremental pipelines end to end. LLM output is probabilistic. New categories might produce worse extraction if the prompt isn't tuned carefully.
  • Consider: do we even need categories at all? Crystal search is semantic. If the text is good, the vector finds it regardless of category label. Categories help dedup (same-category comparison), but that's the only structural benefit.

Inspiration

OpenViking's 6-category memory extraction with merge/non-merge distinction (Apache 2.0, Volcengine).

Related

  • Dream Weaver protocol: dream-weaver-protocol-private/src/prompts.ts
  • Memory Crystal hook: memory-crystal-private/src/dream-weaver.ts

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions