Get Chat History
GET /api/chat/history
Get chat conversation history with optional filtering
Retrieves conversation history from SQLite persistence layer with support for filtering by thread_id and limiting result count.
Query Parameters:
thread_id: Optional thread identifier to filter (replaces conversation_id)limit: Maximum number of messages to return (default: 50)
Returns:
messages: List of conversation messagestotal: Total message countconversation_id: Thread identifier if filtered
Use Case: Chat history display, conversation retrieval, context loading
Parameters
Section titled “ Parameters ”Query Parameters
Section titled “Query Parameters ”Responses
Section titled “ Responses ”Successful Response
Response for /api/chat/history endpoint - ULTRA-COMPLETE (50+ fields).
Provides chat conversation history with optional filtering by conversation ID.
object
List of chat messages
Chat message information for history retrieval - ULTRA-COMPLETE (45+ fields)
object
Message unique identifier
Message role (user or assistant)
Message content text
Message creation timestamp
RAG context source information for chat responses.
Represents a single document or source used to provide context for AI responses through Retrieval-Augmented Generation (RAG). Includes relevance scoring and source metadata for attribution and transparency.
Fields: source: Document or source identifier score: Semantic similarity score (0.0-1.0, higher is more relevant) title: Human-readable source title content_preview: Preview snippet of relevant content document_type: Type of document (e.g., ‘lore’, ‘character’, ‘world’) collection: ChromaDB collection name
Used By: - ChatResponse.context_sources - EnhancedChatResponse.context_sources - ChatMessage.context_sources - ChatMessageInfo.context_sources
object
Document or source identifier
Semantic similarity score (0.0-1.0)
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
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
Total number of messages
Status or informational message
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
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
Validation Error