> ## 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.

# Auto context layer

> Infino Cloud builds a card for every table (column statistics, value ranges, most frequent values, sample rows) and finds the keys tables join on from their values, so an agent can write correct SQL without exploring the data first.

An agent that is handed a database knows only table and column names. Before it can
write a correct query, it has to find out what the columns hold, which values a filter
should use, and which columns join two tables. Without help, it does that one query at
a time, in every conversation, and it often guesses joins from column names.

Infino Cloud's auto context layer works these facts out once, from the data, and serves
them to agents. You configure nothing per table.

> [!NOTE]
>
> The auto context layer is turned on per account. Contact
> [support@infino.ai](mailto:support@infino.ai) to turn it on.

## Table cards

A table card describes a table as it actually is, computed from its rows:

* the row count;
* every column, with its type and its index role (plain column, full-text indexed, or
  vector);
* for each column, how many rows have a value, how many distinct values it has, its
  range, and the most frequent values of low-cardinality columns;
* a few sample rows.

Where the data came with documentation, the card also records what coded values mean.
For example, a loan `status` of `D` means "running contract, client in debt". Hydrate
reads such documentation from the source (see [Hydrate](https://infino.ai/docs/cloud/hydrate.md)).

A second, richer tier adds a description of the table and, for each column, a
description, its value format, and the words a user might use for it. A model writes
these once, from the statistics and samples. The answering agent reads this tier when it
needs more than the statistics.

## Join keys

For two to eight tables, the platform returns every join among them. Each comes as an
`ON` clause ready to paste into SQL, for example
`logs.instance_id = issues.instance_id`, or
`split_part(code.path, '/', 1) = issues.project` when the values only match after an
expression.

Join keys are found from the values, not from column names. Each table's card carries
compact sketches of its key-like columns, which estimate how much two columns overlap.
Each candidate join is then measured with a statement on the data. The answer gives, for
each join:

* `inclusion`: the share of the referencing column's distinct values found on the other
  side;
* `coverage`: the share of the other side's values that are used;
* `verified`: whether the shares were counted on the data or estimated from the sketches.

The first request for a pair of tables does the counting. Later requests read the answer
back for as long as both tables stay as they were counted.

## When cards are built

The platform builds a table's card during its regular maintenance pass after the table
is optimized. Nothing is built for an account that does not have the layer turned on.

* A table that [hydrate](https://infino.ai/docs/cloud/hydrate.md) is still loading is skipped. It gets its card
  on a pass after the load finishes.
* A card is rebuilt when the table is loaded again, when its schema changes, or when its
  row count moves by 5% or more. Once a card is a day old, any change to the table
  rebuilds it.
* Building a card takes a few full reads of the table, so a very large table takes
  longer to get its first card than a small one.

Until a table has a card, requests for its card or its join keys are answered `404`,
saying that the table has not been optimized since it was created.

## Using it from an agent

On an account with the layer turned on, the [Infino MCP server](https://infino.ai/docs/integrations/mcp.md) adds
two tools to its usual ones: `infino_describe_columns` reads a table's card, and
`infino_join_keys` returns the keys among tables. The MCP server's search, SQL and write
tools work the same with or without the layer. See
[context layer tools](https://infino.ai/docs/integrations/mcp.md#context-layer-tools-optional).


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