Skip to main content

build_context_for_task

Method
This is a method of the Memory class in the memory module.
Merges relevant short-term, long-term, entity, user memories into a single text block with deduplication and clean formatting.

Signature

def build_context_for_task(task_descr: str, user_id: Optional[str], additional: str, max_items: int, include_in_output: Optional[bool]) -> str

Parameters

task_descr
str
required
No description available.
user_id
Optional
No description available.
additional
str
default:"''"
No description available.
max_items
int
default:"3"
No description available.
include_in_output
Optional
If None, memory content is only included when debug logging is enabled. If True, memory content is always included. If False, memory content is never included (only logged for debugging).

Returns

Returns
str
The result of the operation.