Skip to main content

get_context

Method
This is a method of the Memory class in the memory module.
Return retrieved memory as a prompt-ready context string. Satisfies AgentMemoryProtocol (used by Agent.get_memory_context()) so the non-prompt-caching code path can inject memory into the system prompt. Without this, hasattr(memory, 'get_context') was False and the fallback branch always returned "".

Signature

Parameters

Optional[str]
No description available.

Returns

str
The result of the operation.

Uses

  • build_context_for_task

Used By

Source

View on GitHub

praisonaiagents/memory/memory.py at line 2081

Context Concept

Context Management

Context Strategies