OpenBMB/ChatDev · error · ValueError

memory store {attachment.name} not found

Error message

memory store {attachment.name} not found

What it means

A memory attachment references a store name that is not in the stores dict passed to the memory attachment aggregator. Every attachment.name must match a key in stores, otherwise construction fails.

Source

Thrown at runtime/node/agent/memory/memory_base.py:240

        agent_role: str,
        query: MemoryContentSnapshot,
        top_k: int,
        similarity_threshold: float,
    ) -> List[MemoryItem]:
        raise NotImplementedError

    def update(self, payload: MemoryWritePayload) -> None:
        raise NotImplementedError


class MemoryManager:
    def __init__(self, attachments: List[MemoryAttachmentConfig], stores: Dict[str, MemoryBase]):
        self.attachments = attachments
        self.memories: Dict[str, MemoryBase] = {}
        for attachment in attachments:
            memory = stores.get(attachment.name)
            if not memory:
                raise ValueError(f"memory store {attachment.name} not found")
            self.memories[attachment.name] = memory

    def retrieve(
        self,
        agent_role: str,
        query: MemoryContentSnapshot,
        current_stage: AgentExecFlowStage,
    ) -> MemoryRetrievalResult | None:
        results: List[tuple[str, MemoryItem, float]] = []
        for attachment in self.attachments:
            if attachment.retrieve_stage and current_stage not in attachment.retrieve_stage:
                continue
            if not attachment.read:
                continue
            memory = self.memories.get(attachment.name)
            if not memory:
                continue
            items = memory.retrieve(agent_role, query, attachment.top_k, attachment.similarity_threshold)

View on GitHub (pinned to 4fb2db0ea9)

Solutions

  1. Make each attachment.name exactly match a key in the stores mapping
  2. If a store failed to build, fix or remove its attachment rather than proceeding
  3. Add a startup check that all attachment names exist in stores before constructing the agent

Example fix

# before
attachments=[MemoryAttachmentConfig(name='long_term')]
stores={'short_term': mem}

# after
attachments=[MemoryAttachmentConfig(name='short_term')]
stores={'short_term': mem}
Defensive patterns

Strategy: validation

Validate before calling

missing = [a.name for a in attachments if a.name not in stores]
if missing:
    raise ConfigError(f'attachments reference unknown stores: {missing}')
agg = MemoryAttachments(attachments, stores)

Prevention

When it happens

Trigger: An agent declares attachments: [{name: 'long_term'}] but the stores mapping only contains 'short_term'; renaming a store in one place (stores) but not in the attachment list; case mismatch in names.

Common situations: Editing YAML where store definitions and attachment references drift apart; dynamically built stores dict that skips failed store creation, leaving the name absent.

Related errors


AI-assisted analysis of OpenBMB/ChatDev@4fb2db0ea9 (2026-08-27). Data as JSON: /api/errors/018c510fcfe0ee6e. Report an issue: GitHub.