agentlens_context
Retrieve past session summaries and lessons ranked by relevance for any topic to load history, build informed prompts, or audit past activity.
Instructions
Retrieve cross-session context for a topic — related session summaries and lessons ranked by relevance.
When to use: At the start of a session to load relevant history, when building a system prompt with past experience, when starting work on a topic the agent has handled before, or to audit what happened with a specific topic.
What it returns: Related sessions (with summaries, key events, and relevance scores) and related lessons, all ranked by relevance to the topic. Includes an overall summary.
Example: agentlens_context({ topic: "database migrations", limit: 5 }) → returns past sessions about DB migrations with key events, plus any lessons learned about migrations.
Input Schema
| Name | Required | Description | Default |
|---|---|---|---|
| topic | Yes | Topic to retrieve context for (natural language) | |
| userId | No | Filter by user ID | |
| agentId | No | Filter by agent ID | |
| from | No | Start date filter (ISO 8601) | |
| to | No | End date filter (ISO 8601) | |
| limit | No | Maximum number of sessions to include (default: 5) |