Skip to content

ReWOOReasoning.aplan() calls sync add_to_memory instead of async aadd_to_memory #184

@BhoomiAgrawal12

Description

@BhoomiAgrawal12

Describe the bug
While going through the files I found a inconsistency in the way, add_to_memory is used for async calls in ReWoo reasoning. It works currently fine as aadd_to_memory is also just a wrapper for sync one in the parent class but in future if anything extra is added to the async parent class then this will violate it and will remain uncaught as that is the purpose this parent class is seperately designed for.

It breaks the async API contract for the memory module. If a Memory subclass overrides aadd_to_memory to do genuinely async work (async lock, async persistence, database write), ReWOOReasoning.aplan() silently bypasses that override and calls the sync base implementation instead.

Expected behavior
await self.agent.memory.aadd_to_memory( #this should be async
type="plan",
content={"content": rsp.choices[0].message.content}
)

To Reproduce
Use ReWOOReasoning with enable_automatic_parallel_stepping() or step_agents_parallel(). Verify that aplan() is called. The plan is stored via the sync path rather than the async path.

Additional context
Both CoTReasoning.aplan() and ReActReasoning.aplan() correctly use await aadd_to_memory() for all memory writes in their async paths and ReWOOReasoning.aplan() is the only exception.

This be a small change, but I think should be there.
will be fixing it soon!

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