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

Parameters

str
required
No description available.
Optional[str]
No description available.
str
default:"''"
No description available.
int
default:"3"
No description available.
Optional[bool]
If None, memory content is included (the primary purpose of this method is to feed retrieved memory into the prompt). If True, memory content is always included. If False, memory content is never included (only logged for debugging).

Returns

str
The result of the operation.

Uses

  • c.isspace
  • content.rfind
  • format_content
  • normalize_content
  • seen_contents.add
  • logger.debug
  • search_short_term
  • search_long_term
  • search_entity
  • search_user_memory

Used By

Source

View on GitHub

praisonaiagents/memory/memory.py at line 1879

Tasks Concept

Task Configuration

Task Validation

Context Concept

Context Management