Tools

Session Search

Search past conversations by content to find relevant sessions and retrieve conversation history.

Session Search

Session search lets you find past conversations by their content. Instead of scrolling through hundreds of sessions, you can search for specific topics, keywords, or phrases and get matching sessions with previews.

How It Works

Every message in a conversation is indexed for search. When you search, thinnestAI scans the full text of all messages (both user and agent) and returns sessions that contain matching content, ranked by relevance.

From the Dashboard

  1. Navigate to your agent's Sessions tab.
  2. Use the search bar at the top of the session list.
  3. Type your query (e.g., "refund policy" or "order #12345").
  4. Matching sessions appear with highlighted preview snippets.

Via the API

curl -X GET "https://api.thinnest.ai/api/agents/{agent_id}/sessions/search?q=refund+policy&limit=20" \
  -H "Authorization: Bearer YOUR_API_KEY"

Parameters:

ParameterTypeDefaultDescription
qstringrequiredSearch query — matches against message content
limitinteger20Maximum number of sessions to return (1-100)

Response:

{
  "sessions": [
    {
      "session_id": "sess_abc123",
      "created_at": "2026-03-07T14:30:00Z",
      "preview": "...customer asked about the refund policy for their recent order...",
      "message_count": 12,
      "last_message_at": "2026-03-07T14:45:00Z"
    },
    {
      "session_id": "sess_def456",
      "created_at": "2026-03-05T09:15:00Z",
      "preview": "...processed a refund for order #54321 per the standard policy...",
      "message_count": 8,
      "last_message_at": "2026-03-05T09:22:00Z"
    }
  ],
  "total": 2
}

Use Cases

  • Quality review — Search for sessions where a specific topic was discussed to audit agent responses.
  • Customer lookup — Find all conversations related to a particular customer or order.
  • Training data — Search for edge cases or complex conversations to use as evaluation examples.
  • Compliance — Locate sessions that discussed sensitive topics for audit purposes.

Tips

  • Search is case-insensitive and matches partial words.
  • Use specific terms for better results — "billing dispute March" works better than "problem".
  • Search covers both user messages and agent responses.
  • Results are ordered by relevance, with the best matches first.

On this page