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

# Expand rows through the graph

> A caller hands over the rows a search or a statement returned, named by
the table they came from, and gets back the rows of every other table
those rows point at, with the facts the graph holds for them.

Preview: this route may change between releases. It needs the agent APIs enabled on your account, and answers 403 until they are.



## OpenAPI

````yaml /api-reference/openapi.json post /v1/graph_expand/{database}
openapi: 3.1.0
info:
  title: Infino API
  description: >-
    The Infino hosted data-plane API: per-database table operations — create,
    ingest, search, and SQL.
  version: 0.1.0
servers:
  - url: https://api.platform.infino.ws
    description: Infino Cloud
security:
  - api_key: []
tags:
  - name: Databases
    description: Create, list, and delete the databases in your account.
  - name: Tables
    description: Create, drop, and list tables, and describe a table's schema.
  - name: Rows
    description: Append, update, and delete rows.
  - name: Search
    description: BM25, vector, and hybrid search, token and exact match, count, and SQL.
  - name: Agent
    description: >-
      Preview routes for agents: table cards, join keys, line search, result
      checks, graph lookups, and the retrieval sub-agent. They need the agent
      APIs enabled on your account.
  - name: Hydrate
    description: >-
      Preview routes for loading a dataset: start a load of files from object
      storage into a table, follow it, cancel or clear it, and run a sync pass.
paths:
  /v1/graph_expand/{database}:
    post:
      tags:
        - Agent
      summary: Expand rows through the graph
      description: >-
        A caller hands over the rows a search or a statement returned, named by

        the table they came from, and gets back the rows of every other table

        those rows point at, with the facts the graph holds for them.


        Preview: this route may change between releases. It needs the agent APIs
        enabled on your account, and answers 403 until they are.
      operationId: graph_expand
      parameters:
        - name: database
          in: path
          description: Target database.
          required: true
          schema:
            type: string
      requestBody:
        content:
          application/json:
            schema:
              $ref: '#/components/schemas/GraphExpandRequest'
            example:
              table_name: issues
              rows:
                - _id: '1048'
                  title: Checkout fails when the cart is empty
              query: checkout empty cart
        required: true
      responses:
        '200':
          description: >-
            The rows of every other table the given rows point at, by table,
            strongest first: the rows a verified join reaches from their key
            values, the definitions of the names a code row uses (`relation:
            defines <name>`, first), and the rows the service read as mentioning
            the same entities. Each row carries the table's placing columns and
            its text cut short. `seeds` is how many of the given rows seeded the
            walk; `note` says why nothing was reached when nothing was.
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/GraphExpandResponse'
              example:
                seeds: 1
                connected:
                  - table: code
                    rows:
                      - path: src/checkout/cart.rs
                        start_line: 88
                        content: >-
                          pub fn checkout(cart: &Cart) -> Result<Order,
                          CheckoutError> {
                        relation: defines checkout
                facts:
                  - subject: checkout
                    relation: rejects
                    object: an empty cart
                    table: issues
                    via: row
        '400':
          description: >-
            Invalid request body, a table or database name that is not an
            identifier, or more than 200 rows.
        '401':
          description: Missing or invalid API key.
        '402':
          description: >-
            The account is suspended for non-payment, or its free period has
            ended.
        '403':
          description: >-
            The agent APIs are not enabled for this account, or the API key
            lacks read access to this database.
        '404':
          description: >-
            The database does not exist, or the named table has no card yet: it
            has not been described since it was created, or does not exist.
        '410':
          description: The database is being purged.
        '503':
          description: >-
            The database is still activating, or no capacity is free to serve
            it. Transient: retry after the `Retry-After` interval.
      security:
        - api_key: []
components:
  schemas:
    GraphExpandRequest:
      type: object
      description: |-
        `POST /v1/graph_expand/{database}`: the rows a retrieval returned, to be
        expanded to the rows of other tables they point at. An unknown field is
        refused.
      required:
        - table_name
        - rows
      properties:
        query:
          type:
            - string
            - 'null'
          description: |-
            The words the retrieval searched by, when it was a search: the facts
            matching them come back too, from every document, not only from the
            rows the search returned.
        rows:
          type: array
          items:
            type: object
          description: |-
            The rows a search or a statement returned, each a JSON object of
            column name to cell value, 200 at most (the walk seeds from the
            first twenty). A row carrying `_id` seeds by it; one carrying the
            table's key columns, or a path and a start line, is looked up; any
            other seeds nothing.
        statement:
          type:
            - string
            - 'null'
          description: |-
            The statement that returned the rows, when it was one: the words its
            keyword search ranks by are searched in the facts like a query.
        table_name:
          type: string
          description: The table the rows came from.
      additionalProperties: false
    GraphExpandResponse:
      type: object
      description: |-
        The answer: the tables reached and their rows, the facts the graph holds
        for them, how many of the given rows seeded the walk, and a note when
        nothing was reached and why.
      required:
        - connected
        - seeds
      properties:
        connected:
          type: array
          items:
            $ref: '#/components/schemas/Connected'
          description: The other tables reached and their rows, one entry per table.
        facts:
          type: array
          items:
            $ref: '#/components/schemas/ConnectedFact'
          description: |-
            The facts the graph holds for the given rows. Absent when there are
            none.
        note:
          type:
            - string
            - 'null'
          description: Why nothing was reached, when nothing was. Absent otherwise.
        seeds:
          type: integer
          description: How many of the given rows seeded the walk.
          minimum: 0
    Connected:
      type: object
      description: |-
        The rows of one table the expansion reached, strongest first, as that
        table's search would show them: its placing columns and its text cut
        short. A code row that defines a name the result uses carries
        `relation: defines <name>` and comes first.
      required:
        - table
        - rows
      properties:
        rows:
          type: array
          items:
            type: object
          description: |-
            Its rows, strongest first, each a JSON object of column name to
            cell value: the table's placing columns, its text cut short, and
            `relation` on a row that defines a name the given rows use.
        table:
          type: string
          description: The table reached.
    ConnectedFact:
      type: object
      description: |-
        A fact the graph carries back with a result: one the text of a given row
        states, one about a thing those facts name, read from other text, or one
        matching the words searched by. A fact reads subject, relation, object.
      required:
        - subject
        - relation
        - object
        - table
        - via
      properties:
        document:
          type:
            - string
            - 'null'
          description: The document it was read from, when its table names documents.
        object:
          type: string
          description: 'What the subject is related to: another thing, or a value.'
        qualifiers:
          type: string
          description: |-
            What the text gives with the fact: a section, a date, an amount, a
            condition, a signer.
        relation:
          type: string
          description: How the subject relates to the object.
        subject:
          type: string
          description: What the fact is about.
        table:
          type: string
          description: The table it was read from; `memory` for what a run wrote back.
        via:
          $ref: '#/components/schemas/FactVia'
          description: How it came back.
    FactVia:
      type: string
      description: How a fact came back with a result.
      enum:
        - row
        - name
        - query
  securitySchemes:
    api_key:
      type: http
      scheme: bearer

````

This documentation is built and hosted on [Mintlify](https://mintlify.com), a developer documentation platform.