Skip to content

Generate Insights

POST
/api/agents/research/insights

Generate strategic insights from research results.

Routes through :class:LaganResearchInsightsHandler after Phase A12 of the M15 migration; the legacy Lagan-LLM fallback was retired with the LLM provider stack.

InsightsGenerationRequest

Request for strategic insight generation.

Generates strategic insights from provided research results at configurable depth levels.

Fields:

  • query: Research question or topic for context
  • results: List of results to analyze for insights (required, non-empty)
  • insight_level: Depth of insight generation

Insight Levels:

  • surface: Quick summary insights
  • analytical: Detailed analytical insights
  • strategic: Strategic patterns and implications
  • prophetic: Predictive insights and future implications

Usage: Used to generate insights from existing research results.

Integration:

  • ResearchRoutes: Request validation for /research/insights endpoint
  • LaganAgent: Insight generation processing
object
query
required
Query

Research question or topic

string
results
required
Results

Results to analyze for insights

Array<object>
>= 1 items
object
key
additional properties
string
insightLevel
Insightlevel

Depth of insight generation

string
default: strategic
Allowed values: surface analytical strategic prophetic

Successful Response

InsightsGenerationResponse

Response with generated strategic insights.

Provides generated insights, key themes, and actionable recommendations derived from analyzed results.

Fields:

  • success: Whether insight generation was successful
  • query: Original query for context
  • insights: List of generated strategic insights
  • key_themes: Key themes identified across results
  • recommendations: Actionable recommendations based on insights
  • confidence: Overall insight confidence score (0.0-1.0)

Usage: Returned by insight generation endpoints.

Integration:

  • ResearchRoutes: Response model for /research/insights endpoint
  • Frontend: Insights display and recommendations
object
success
required
Success

Whether insight generation was successful

boolean
query
required
Query

Original query

string
insights
Insights

Generated strategic insights

Array<string>
keyThemes
Keythemes

Key themes identified across results

Array<string>
recommendations
Recommendations

Actionable recommendations

Array<string>
confidence
required
Confidence

Insight confidence score

number
<= 1

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