> ## 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 chart analysis: deterministic pattern geometry + LLM narrative



## OpenAPI

````yaml /api/openapi.json post /api/graph/v1/chart/{symbol}/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/chart/{symbol}/analyze:
    post:
      tags:
        - Chart Analysis
      summary: 'AI chart analysis: deterministic pattern geometry + LLM narrative'
      operationId: analyze_chart_api_graph_v1_chart__symbol__analyze_post
      parameters:
        - name: symbol
          in: path
          required: true
          schema:
            type: string
            title: Symbol
      requestBody:
        required: true
        content:
          application/json:
            schema:
              $ref: '#/components/schemas/ChartAnalysisRequest'
      responses:
        '200':
          description: Successful Response
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/ChartAnalysisResponse'
        '422':
          description: Validation Error
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/HTTPValidationError'
components:
  schemas:
    ChartAnalysisRequest:
      properties:
        interval:
          type: string
          enum:
            - 1m
            - 2m
            - 5m
            - 15m
            - 30m
            - 1h
            - 1d
          title: Interval
          description: Candle interval of the supplied bars
        period:
          type: string
          enum:
            - 1d
            - 5d
            - 1m
            - 3m
            - 6m
            - 1y
            - 5y
          title: Period
          description: Chart period of the supplied bars
        candles:
          items:
            $ref: '#/components/schemas/CandleIn'
          type: array
          maxItems: 1500
          minItems: 20
          title: Candles
          description: OHLCV bars in chart order (oldest first), warmup excluded
      type: object
      required:
        - interval
        - period
        - candles
      title: ChartAnalysisRequest
      description: Analyze the candles currently rendered on the client's chart.
    ChartAnalysisResponse:
      properties:
        symbol:
          type: string
          title: Symbol
        interval:
          type: string
          enum:
            - 1m
            - 2m
            - 5m
            - 15m
            - 30m
            - 1h
            - 1d
          title: Interval
        period:
          type: string
          enum:
            - 1d
            - 5d
            - 1m
            - 3m
            - 6m
            - 1y
            - 5y
          title: Period
        pattern:
          anyOf:
            - type: string
            - type: 'null'
          title: Pattern
          description: Detected pattern label
        bias:
          anyOf:
            - type: string
              enum:
                - bullish
                - bearish
                - neutral
            - type: 'null'
          title: Bias
        note:
          anyOf:
            - type: string
            - type: 'null'
          title: Note
          description: LLM narrative (None if unavailable)
        resistance:
          anyOf:
            - type: number
            - type: 'null'
          title: Resistance
          description: Resistance trendline at last bar
        support:
          anyOf:
            - type: number
            - type: 'null'
          title: Support
          description: Support trendline at last bar
        target:
          anyOf:
            - type: number
            - type: 'null'
          title: Target
          description: Breakout target (res + 0.32*range)
        invalidation:
          anyOf:
            - type: number
            - type: 'null'
          title: Invalidation
          description: Invalidation (sup - 0.12*range)
        trendlines:
          anyOf:
            - $ref: '#/components/schemas/TrendlinesOut'
            - type: 'null'
        provider:
          anyOf:
            - type: string
            - type: 'null'
          title: Provider
        model:
          anyOf:
            - type: string
            - type: 'null'
          title: Model
        cached:
          type: boolean
          title: Cached
          default: false
        error:
          anyOf:
            - type: string
            - type: 'null'
          title: Error
      type: object
      required:
        - symbol
        - interval
        - period
      title: ChartAnalysisResponse
      description: Deterministic geometry + LLM narrative. Levels never come from the LLM.
    HTTPValidationError:
      properties:
        detail:
          items:
            $ref: '#/components/schemas/ValidationError'
          type: array
          title: Detail
      type: object
      title: HTTPValidationError
    CandleIn:
      properties:
        t:
          type: string
          title: T
          description: Bar time (ISO 8601, as rendered on the chart)
        o:
          type: number
          maximum: 1000000000000
          minimum: -1000000000000
          title: O
          description: Open
        h:
          type: number
          maximum: 1000000000000
          minimum: -1000000000000
          title: H
          description: High
        l:
          type: number
          maximum: 1000000000000
          minimum: -1000000000000
          title: L
          description: Low
        c:
          type: number
          maximum: 1000000000000
          minimum: -1000000000000
          title: C
          description: Close
        v:
          type: number
          maximum: 1000000000000000
          minimum: 0
          title: V
          description: Volume
      type: object
      required:
        - t
        - o
        - h
        - l
        - c
        - v
      title: CandleIn
      description: >-
        A client-sent OHLCV candle (the exact bars the user is looking at).


        ``allow_inf_nan=False``: JSON ``NaN``/``Infinity`` literals are accepted
        by

        pydantic's default float parsing, but a non-finite value poisons the

        geometry (support/resistance/target become NaN/inf) and then crashes

        strict JSON response serialization with a 500. Reject at validation →
        422.
    TrendlinesOut:
      properties:
        support:
          $ref: '#/components/schemas/TrendlineOut'
        resistance:
          $ref: '#/components/schemas/TrendlineOut'
      type: object
      required:
        - support
        - resistance
      title: TrendlinesOut
    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
    TrendlineOut:
      properties:
        from:
          $ref: '#/components/schemas/PointOut'
          description: Endpoint at the first candle
        to:
          $ref: '#/components/schemas/PointOut'
          description: Endpoint at the last candle
      type: object
      required:
        - from
        - to
      title: TrendlineOut
      description: A two-point trendline segment (first candle → last candle).
    PointOut:
      properties:
        t:
          type: string
          title: T
          description: Candle time (ISO 8601)
        price:
          type: number
          title: Price
          description: Trendline price at this candle
      type: object
      required:
        - t
        - price
      title: PointOut
      description: A trendline endpoint the frontend plots directly.

````