> ## Documentation Index
> Fetch the complete documentation index at: https://docs.sequency.sh/llms.txt
> Use this file to discover all available pages before exploring further.

# AI analysis of backtest results

> Run LLM analysis on a completed backtest to assess edge quality.



## OpenAPI

````yaml /api/openapi.json post /api/graph/v1/backtest/{run_id}/analyze
openapi: 3.1.0
info:
  title: Sequency Graph API
  description: >

    # Sequency Graph-Native Trading API


    Graph-native API for trading intelligence, built on FalkorDB.


    ## Features


    - **Screener**: Filter stocks using graph-native queries with relationship
    expansion

    - **Stock Detail**: Complete stock context with all relationships

    - **Confluence Scoring**: Setup quality assessment with weighted components

    - **Strategy Matching**: Find matching options strategies via graph
    traversal

    - **Market Context**: Current market-wide context for trading decisions


    ## Data Sources


    All data is sourced from the FalkorDB knowledge graph, populated by:

    - Pattern detector (Go) - Technical indicators, patterns

    - Graph sync service - Levels, volume profiles, news, day classification
  version: 1.0.0
servers: []
security: []
paths:
  /api/graph/v1/backtest/{run_id}/analyze:
    post:
      tags:
        - Backtest
      summary: AI analysis of backtest results
      description: Run LLM analysis on a completed backtest to assess edge quality.
      operationId: analyze_backtest_api_graph_v1_backtest__run_id__analyze_post
      parameters:
        - name: run_id
          in: path
          required: true
          schema:
            type: string
            format: uuid
            title: Run Id
      responses:
        '200':
          description: Analysis completed
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/BacktestAnalysisResponse'
        '404':
          description: Run not found or not completed
        '422':
          description: Validation Error
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/HTTPValidationError'
        '429':
          description: Rate limited
components:
  schemas:
    BacktestAnalysisResponse:
      properties:
        summary:
          type: string
          title: Summary
        signal_insights:
          items:
            $ref: '#/components/schemas/SignalInsight'
          type: array
          title: Signal Insights
        risk_assessment:
          type: string
          title: Risk Assessment
        parameter_suggestions:
          items:
            type: string
          type: array
          title: Parameter Suggestions
        edge_quality:
          type: string
          title: Edge Quality
        edge_confidence:
          type: number
          maximum: 100
          minimum: 0
          title: Edge Confidence
        analyzed_at:
          type: string
          title: Analyzed At
        tokens_used:
          anyOf:
            - type: integer
            - type: 'null'
          title: Tokens Used
      type: object
      required:
        - summary
        - signal_insights
        - risk_assessment
        - parameter_suggestions
        - edge_quality
        - edge_confidence
        - analyzed_at
      title: BacktestAnalysisResponse
      description: Structured response from the backtest analysis LLM agent.
    HTTPValidationError:
      properties:
        detail:
          items:
            $ref: '#/components/schemas/ValidationError'
          type: array
          title: Detail
      type: object
      title: HTTPValidationError
    SignalInsight:
      properties:
        signal_type:
          type: string
          title: Signal Type
        assessment:
          type: string
          title: Assessment
        reasoning:
          type: string
          title: Reasoning
        suggestion:
          type: string
          title: Suggestion
      type: object
      required:
        - signal_type
        - assessment
        - reasoning
        - suggestion
      title: SignalInsight
      description: Per-signal-type insight from the backtest analysis agent.
    ValidationError:
      properties:
        loc:
          items:
            anyOf:
              - type: string
              - type: integer
          type: array
          title: Location
        msg:
          type: string
          title: Message
        type:
          type: string
          title: Error Type
        input:
          title: Input
        ctx:
          type: object
          title: Context
      type: object
      required:
        - loc
        - msg
        - type
      title: ValidationError

````