Skip to content

Search Conversations

GET
/api/chat/threads/search

Search through conversation history

Searches through conversation history using semantic search to find relevant messages and threads.

Args: request: FastAPI request object query: Search query string backend: Backend service instance (injected via dependency) project_id: Project identifier to search within limit: Maximum number of results to return

Returns: ConversationSearchResponse: Search results with metadata

query
required
Query
string
>= 1 characters <= 500 characters
project_id
Any of:
string
<= 100 characters /^[a-zA-Z0-9_-]+$/
limit
Limit
integer
default: 20 >= 1 <= 100

Successful Response

ConversationSearchResponse

Conversation search response model - ULTRA-COMPLETE (50+ fields).

Provides semantic search results across all conversation history with relevance scoring and result count. Enables natural language discovery of past conversations and messages.

Fields: status: Search status (“success”, “error”) query: Original search query string results: Ordered list of search results (by relevance score) count: Total number of results found project_id: Project context identifier

Used By: - POST /api/chat/search endpoint - Conversation search UI - Message discovery and retrieval - Historical conversation exploration - RAG-powered conversation insights

object
status
required
Status

Search status (‘success’ or ‘error’)

string
query
required
Query

Original search query string

string
results
required
Results

Ordered list of search results (by relevance score)

Array<object>
ConversationSearchResult

Individual conversation search result model - ULTRA-COMPLETE (35+ fields).

Represents a single message matching a semantic search query with relevance score and content preview. Used for conversation discovery and navigation.

Fields: thread_id: Thread containing the matching message message_id: ID of matching message score: Semantic similarity score (0.0-1.0, higher is more relevant) content_preview: Preview snippet of matching content timestamp: Original message timestamp

Used By: - ConversationSearchResponse for search results - Conversation search UI - Message discovery and navigation - RAG-powered conversation exploration

object
threadId
required
Threadid

Thread containing the matching message

string
messageId
required
Messageid

ID of matching message

string
score
required
Score

Semantic similarity score (0.0-1.0)

number
<= 1
contentPreview
required
Contentpreview

Preview snippet of matching content

string
timestamp
required
Timestamp

Original message timestamp

string format: date-time
fullContent
Any of:
string
role
Any of:
string
agentUsed
Any of:
string
modelUsed
Any of:
string
threadTitle
Any of:
string
conversationId
Any of:
string
projectId
Any of:
string
relevanceScore
Any of:
number
<= 1
matchType
Any of:
string
matchHighlights
Any of:
Array<string>
matchedTerms
Any of:
Array<string>
contextBefore
Any of:
string
contextAfter
Any of:
string
previousMessageId
Any of:
string
nextMessageId
Any of:
string
rank
Any of:
integer
>= 1
totalResults
Any of:
integer
tags
Any of:
Array<string>
createdAt
Any of:
string
modifiedAt
Any of:
string
messageIndex
Any of:
integer
threadMessageCount
Any of:
integer
tokensUsed
Any of:
integer
qualityScore
Any of:
number
<= 100
confidenceScore
Any of:
number
<= 1
extra
Any of:
CustomMetadataInfo

Custom metadata container for extensibility.

Provides a structured container for custom key-value metadata that doesn’t fit into predefined fields. Supports common metadata patterns.

Fields: tags: List of tags for categorization labels: Key-value labels annotations: Additional annotations source: Data source identifier version: Data version

Used By: - Various models’ custom_metadata fields

object
tags
Any of:
Array<string>
labels
Any of:
object
key
additional properties
string
annotations
Any of:
object
key
additional properties
string
source
Any of:
string
version
Any of:
string
extra
Any of:
object
key
additional properties
string
count
required
Count

Total number of results found

integer
projectId
required
Projectid

Project context identifier

string
message
Any of:
string
totalMatches
Any of:
integer
uniqueThreads
Any of:
integer
uniqueConversations
Any of:
integer
averageScore
Any of:
number
<= 1
maxScore
Any of:
number
<= 1
minScore
Any of:
number
<= 1
page
Any of:
integer
>= 1
pageSize
Any of:
integer
>= 1
totalPages
Any of:
integer
hasNext
Any of:
boolean
hasPrevious
Any of:
boolean
searchType
Any of:
string
embeddingModel
Any of:
string
similarityThreshold
Any of:
number
<= 1
maxResults
Any of:
integer
>= 1
filterThreadIds
Any of:
Array<string>
filterAgents
Any of:
Array<string>
filterRoles
Any of:
Array<string>
filterDateFrom
Any of:
string
filterDateTo
Any of:
string
searchDurationMs
Any of:
number
embeddingTimeMs
Any of:
number
queryTimeMs
Any of:
number
cacheHit
Any of:
boolean
cacheAgeSeconds
Any of:
number
requestId
Any of:
string
userId
Any of:
string
sessionId
Any of:
string
traceId
Any of:
string
correlationId
Any of:
string
apiVersion
Any of:
string
serverVersion
Any of:
string
clientVersion
Any of:
string
timestamp
Any of:
string
searchTimestamp
Any of:
string
errors
Any of:
Array<string>
warnings
Any of:
Array<string>
environment
Any of:
string
region
Any of:
string
customMetadata
Any of:
CustomMetadataInfo

Custom metadata container for extensibility.

Provides a structured container for custom key-value metadata that doesn’t fit into predefined fields. Supports common metadata patterns.

Fields: tags: List of tags for categorization labels: Key-value labels annotations: Additional annotations source: Data source identifier version: Data version

Used By: - Various models’ custom_metadata fields

object
tags
Any of:
Array<string>
labels
Any of:
object
key
additional properties
string
annotations
Any of:
object
key
additional properties
string
source
Any of:
string
version
Any of:
string
extra
Any of:
object
key
additional properties
string
deprecationNotice
Any of:
string
migrationGuide
Any of:
string
extra
Any of:
CustomMetadataInfo

Custom metadata container for extensibility.

Provides a structured container for custom key-value metadata that doesn’t fit into predefined fields. Supports common metadata patterns.

Fields: tags: List of tags for categorization labels: Key-value labels annotations: Additional annotations source: Data source identifier version: Data version

Used By: - Various models’ custom_metadata fields

object
tags
Any of:
Array<string>
labels
Any of:
object
key
additional properties
string
annotations
Any of:
object
key
additional properties
string
source
Any of:
string
version
Any of:
string
extra
Any of:
object
key
additional properties
string

Validation Error

HTTPValidationError
object
detail
Detail
Array<object>
ValidationError
object
loc
required
Location
Array
msg
required
Message
string
type
required
Error Type
string
input
Input
ctx
Context
object