Get Learn Context • AI Agent SDK

get_learn_context: Get learning context for injection into system prompt.

get_learn_context

Method

</div>

This is a method of the Agent class in the agent module.

Get learning context for injection into system prompt.

Returns learned preferences, insights, and patterns when memory=”learn” is enabled. Returns empty string when learn is not enabled (zero overhead).

Signature

python
def get_learn_context() -> str

Returns

ResponseField str

Formatted learning context string, or empty string if learn not enabled

Uses

  • get_learn_context

Used By

Source

View on GitHub

praisonaiagents/agent/agent.py at line 6483


Related Documentation