Get User Context
get_user_contextRetrieve ranked user memories for LLM prompts, focusing on recent or query-specific context with optional team inclusion.
Instructions
Retrieve a pre-formatted context string for a user, ready to inject into an LLM system prompt. Ranked by Temporal Memory Scoring. Can be called without a query to get the most important recent memories. When a team is configured, includes team memories automatically.
Input Schema
| Name | Required | Description | Default |
|---|---|---|---|
| user_id | Yes | User to get context for | |
| q | No | Optional query to focus the context on a topic | |
| top_n | No | Number of top memories to include | |
| namespace | No | Memory namespace (default: from env or 'default') | |
| team_id | No | Team ID to include team context from. Defaults to SMARA_TEAM_ID env var. | |
| include_team | No | Include team memories in context. Defaults to true when a team is configured. |