Get Research Queries
GET /api/discovery/research/queries
Get research queries and semantic search results.
Retrieves comprehensive research data including query history, saved searches, semantic results from recent queries, and available ChromaDB collections for research discovery dashboard and API consumers.
Returns: ResearchResponse: Complete research data including: - queries: Recent query history with results - savedSearches: User-saved search configurations - semanticResults: Semantic search results from latest query - recentQueries: List of recent query strings - totalQueries: Count of queries in response - activeCollections: Available ChromaDB collections
Raises: HTTPException: 500 error if research query retrieval fails
Example Response:
json { "queries": [{"id": "1", "query": "AI patterns", "results": [...]}], "savedSearches": [{"id": "s1", "name": "AI Search", "query": "AI"}], "semanticResults": [{"documentId": "d1", "similarity": 0.92}], "recentQueries": ["AI patterns", "agent architecture"], "totalQueries": 1, "activeCollections": ["documents", "research"] }
Responses
Section titled “ Responses ”Successful Response
Research queries comprehensive response model.
Provides complete research query response including query history, saved searches, semantic results, and collection information for the research discovery dashboard and API endpoints.
Fields:
queries: List of ResearchQueryItem with recent query history and resultssaved_searches: List of ResearchSavedSearch for quick re-executionsemantic_results: List of ResearchSemanticResult from semantic searchrecent_queries: List of recent query strings (text only)total_queries: Total count of queries in response (non-negative integer)active_collections: List of available ChromaDB collection names
Usage: GET /api/discovery/research/queries returns this response model. Used by research_routes for comprehensive research data retrieval.
JSON Example:
{
"queries": [...],
"savedSearches": [...],
"semanticResults": [...],
"recentQueries": ["AI patterns", "agent architecture"],
"totalQueries": 2,
"activeCollections": ["documents", "research", "notes"]
}object
Query history with results
Research query with results model.
Represents a complete research query including the query text, matching results, and metadata for query history tracking and result display.
Fields:
id: Unique identifier for the queryquery: Original search query textresults: List of ResearchSearchResult itemstimestamp: Unix timestamp of query execution (non-negative integer)result_count: Total number of results found (non-negative integer)
Usage: Used within ResearchResponse to represent query history with results. Used by research_routes for query tracking and display.
JSON Example:
{
"id": "query_456",
"query": "AI agent patterns",
"results": [...],
"timestamp": 1706745600,
"resultCount": 15
}object
Query ID
Query text
Search results
Research search result item model.
Represents a single search result from research query operations including document content, similarity scoring, and metadata for comprehensive research discovery.
Fields:
id: Unique identifier for the search resultcontent: Document content or excerpt matching the querysimilarity: Similarity score (0.0-1.0) indicating match qualitymetadata: Dictionary containing result metadata (source, type, etc.)timestamp: Unix timestamp of result creation (non-negative integer)
Usage: Used within ResearchQueryItem to represent individual search results. Used by research_routes for semantic search result display.
JSON Example:
{
"id": "result_123",
"content": "The AI agent architecture...",
"similarity": 0.87,
"metadata": {"source": "documents", "type": "article"},
"timestamp": 1706745600
}object
Result ID
Document content
Similarity score (0.0-1.0)
Result metadata
object
Result timestamp (Unix)
Query timestamp (Unix)
Number of results
Saved searches
Research saved search model.
Represents a user-saved search configuration for quick re-execution including query text, filters, and usage tracking metadata.
Fields:
id: Unique identifier for the saved searchname: Human-readable name for the saved searchquery: Search query textfilters: Dictionary of search filters (optional, defaults to empty)created_at: Unix timestamp when search was saved (non-negative integer)last_used: Unix timestamp of last usage (optional, non-negative)
Usage: Used within ResearchResponse for saved search listing. Used by research_routes for saved search management.
JSON Example:
{
"id": "saved_789",
"name": "AI Documentation Search",
"query": "AI agent architecture",
"filters": {"collection": "documents"},
"createdAt": 1706745600,
"lastUsed": 1706832000
}object
Saved search ID
Search name
Search query
Creation timestamp (Unix)
Semantic search results
Research semantic search result model.
Represents a semantic search result with collection information for cross-collection research discovery and document similarity analysis.
Fields:
document_id: Unique identifier of the matched documentdocument: Document content or excerptsimilarity: Similarity score (0.0-1.0) indicating semantic match qualitymetadata: Dictionary containing document metadatacollection: Name of the ChromaDB collection containing the document
Usage: Used within ResearchResponse for semantic search results. Used by research_routes for cross-collection semantic search display.
JSON Example:
{
"documentId": "doc_123",
"document": "The multi-agent orchestration system...",
"similarity": 0.92,
"metadata": {"title": "Architecture Guide", "type": "documentation"},
"collection": "documents"
}object
Document ID
Document content
Similarity score (0.0-1.0)
Document metadata
object
Collection name
Recent query strings
Total queries count
Available ChromaDB collections