textrawl
byJeff Green

query_conversations

Query past conversations by search, retrieval, or listing

Query past conversations using three modes: semantic search, get by ID/key, or paginated listing.

Parameters

ParameterTypeRequiredDefaultDescription
modeenumYes-Query mode: search, get, or list
querystringmode=search-Search query (1-1000 chars)
searchModeenumNosummarySearch mode: summary, turns, or both (mode=search only)
includeTranscriptbooleanNofalseInclude recent turns from matches (mode=search only)
maxTurnsPerConversationnumberNo10Max turns per conversation in search results (mode=search only)
sessionIdstringmode=get-Session UUID
sessionKeystringmode=get-Session key string
maxTurnsnumberNo50Max turns to include (mode=get only, 1-200)
limitnumberNo20Max results (1-50)
offsetnumberNo0Pagination offset (mode=list only)

Semantic search across past conversations by summary, individual turns, or both. Replaces the former recall_conversation tool.

Example

{
  "mode": "search",
  "query": "database migration decisions",
  "searchMode": "summary",
  "includeTranscript": true,
  "limit": 5
}

Search Modes

ModeDescription
summarySearch conversation summaries only (fastest)
turnsSearch individual turn content
bothSearch summaries and turns

Response (Compact)

{"n":2,"c":[{"id":"550e8400","k":"db-migration-2026-01","t":"Database Migration Planning","s":0.91,"sum":"Discussed migration strategy from MySQL to PostgreSQL..."},{"id":"7c9e6679","k":null,"t":"API Design Review","s":0.78,"sum":"Reviewed REST API design patterns..."}]}

Key mapping: n=count, c=conversations, id=sessionId, k=sessionKey, t=title, s=score, sum=summary

Response (Verbose)

{
  "query": "database migration decisions",
  "totalResults": 2,
  "conversations": [
    {
      "sessionId": "550e8400",
      "sessionKey": "db-migration-2026-01",
      "title": "Database Migration Planning",
      "summary": "Discussed migration strategy from MySQL to PostgreSQL...",
      "score": 0.91,
      "turns": [
        { "role": "user", "content": "What's the plan for the database migration?", "turn_index": 0 },
        { "role": "assistant", "content": "We should start with...", "turn_index": 1 }
      ]
    }
  ]
}

turns is only included when includeTranscript=true. matchedTurns appears when searchMode is turns or both.

Mode: get

Retrieve a complete conversation session including summary and turns. Must provide either sessionId or sessionKey. Replaces the former get_conversation tool.

Example

{
  "mode": "get",
  "sessionKey": "db-migration-2026-01",
  "maxTurns": 50
}

Response (Compact)

{"id":"550e8400","k":"db-migration-2026-01","t":"Database Migration Planning","sum":"Discussed migration strategy...","n":15,"turns":[{"r":"u","c":"What's the plan?"},{"r":"a","c":"We should start with..."}]}

Key mapping: id=sessionId, k=sessionKey, t=title, sum=summary, n=turnCount, r=role (first char), c=content

Response (Verbose)

{
  "found": true,
  "session": {
    "id": "550e8400",
    "sessionKey": "db-migration-2026-01",
    "title": "Database Migration Planning",
    "summary": "Discussed migration strategy...",
    "turnCount": 15,
    "lastActivity": "2026-01-05T10:00:00Z",
    "createdAt": "2026-01-04T09:30:00Z"
  },
  "turns": [
    { "role": "user", "content": "What's the plan?", "turnIndex": 0, "createdAt": "2026-01-04T09:30:00Z" },
    { "role": "assistant", "content": "We should start with...", "turnIndex": 1, "createdAt": "2026-01-04T09:30:05Z" }
  ]
}

Mode: list

Browse conversation sessions with pagination. Replaces the former list_conversations tool.

Example

{
  "mode": "list",
  "limit": 10,
  "offset": 0
}

Response (Compact)

{"n":45,"c":[{"id":"550e8400","k":"db-migration-2026-01","t":"Database Migration Planning","turns":15,"last":"2026-01-05T10:00:00Z"},{"id":"7c9e6679","k":null,"t":"API Design Review","turns":8,"last":"2026-01-04T15:30:00Z"}]}

Key mapping: n=total, c=conversations, turns=turnCount, last=lastActivity

Response (Verbose)

{
  "total": 45,
  "returned": 10,
  "offset": 0,
  "conversations": [
    {
      "sessionId": "550e8400",
      "sessionKey": "db-migration-2026-01",
      "title": "Database Migration Planning",
      "turnCount": 15,
      "lastActivity": "2026-01-05T10:00:00Z",
      "createdAt": "2026-01-04T09:30:00Z"
    }
  ]
}

Output Schema

This tool MUST return structuredContent alongside the text response. The structuredContent object MUST use canonical verbose keys regardless of the COMPACT_RESPONSES setting. Fields vary by mode:

Search Mode

FieldTypeDescription
mode"search"Query mode
totalResultsintegerNumber of matching conversations
conversationsarrayMatching conversations
conversations[].sessionIdstringSession UUID
conversations[].sessionKeystring?Session key
conversations[].titlestring?Session title
conversations[].summarystring?Session summary
conversations[].scorenumberRelevance score
conversations[].turnsarrayRecent turns (when includeTranscript=true)
conversations[].matchedTurnsarrayMatched turns (when searchMode=turns or both)

Get Mode

FieldTypeDescription
mode"get"Query mode
foundbooleanWhether the session was found
sessionobjectSession details
session.idstringSession UUID
session.sessionKeystring?Session key
session.titlestring?Session title
session.summarystring?Session summary
session.turnCountintegerTotal turn count
session.lastActivitystring?Last activity timestamp
session.createdAtstringISO creation timestamp
turnsarrayConversation turns
turns[].rolestringTurn role (user, assistant, system)
turns[].contentstringTurn content
turns[].turnIndexintegerTurn index
turns[].createdAtstringISO timestamp

List Mode

FieldTypeDescription
mode"list"Query mode
totalintegerTotal session count
returnedintegerSessions in this page
offsetintegerCurrent offset
conversationsarraySession summaries
conversations[].sessionIdstringSession UUID
conversations[].sessionKeystring?Session key
conversations[].titlestring?Session title
conversations[].turnCountintegerNumber of turns
conversations[].lastActivitystring?Last activity timestamp
conversations[].createdAtstringISO creation timestamp

Errors

ErrorCauseFix
Conversations not enabledENABLE_CONVERSATIONS feature flag is falseSet ENABLE_CONVERSATIONS=true
Missing querymode=search without queryProvide query parameter
Missing session identifiermode=get without sessionId or sessionKeyProvide one identifier
Embedding service not configuredMissing API keySet OPENAI_API_KEY or configure Ollama
Session not foundInvalid session ID or keyCheck with mode=list
  • save_conversation_context - Save conversations for later recall
  • delete_conversation - Delete a conversation session

On this page