Column value lookup

Columns whose stored values the agent looks up before it writes SQL.

Base URL https://futuresmart.ai/database-agent/api · every request sends X-API-Key. Samples read the key from DATABASE_AGENT_API_KEY. All endpoints

Get High Cardinality Columns For Db

GET/v1/agents/{agent_id}/databases/{db_id}/tables/high-cardinality-columns

Get high-cardinality columns for an agent, scoped to a specific database.

Credential Database Agent API key for this agent (X-API-Key)

Path parameters

NameTypeDescription
agent_idrequiredstringAgent ID
db_idrequiredstringDatabase ID

Other responses

  • 422 Validation Error
import os
import requests

API_ROOT = "https://futuresmart.ai/database-agent/api"
API_KEY = os.environ["DATABASE_AGENT_API_KEY"]

r = requests.get(
    f"{API_ROOT}/v1/agents/YOUR_AGENT_ID/databases/YOUR_DB_ID/tables/high-cardinality-columns",
    headers={"X-API-Key": API_KEY},
    timeout=120,
)
r.raise_for_status()
print(r.json())

Set High Cardinality Columns For Db

POST/v1/agents/{agent_id}/databases/{db_id}/tables/high-cardinality-columns

Set high-cardinality columns for an agent, scoped to a specific database.

Indexes the column values into the HC Qdrant collection (tagged with db_id), then merges the configuration into TableDescription. Mirrors the agent-global route but resolves the DB connection by db_id so the right database is read.

Credential Database Agent API key for this agent (X-API-Key)

Path parameters

NameTypeDescription
agent_idrequiredstringAgent ID
db_idrequiredstringDatabase ID

Request body · application/json

NameTypeDescription
columnsrequiredarray<HighCardinalityColumnItem>List of high cardinality columns
↳ table_namerequiredstringTable name
↳ column_namerequiredstringColumn name

Other responses

  • 422 Validation Error
import os
import requests

API_ROOT = "https://futuresmart.ai/database-agent/api"
API_KEY = os.environ["DATABASE_AGENT_API_KEY"]

r = requests.post(
    f"{API_ROOT}/v1/agents/YOUR_AGENT_ID/databases/YOUR_DB_ID/tables/high-cardinality-columns",
    headers={"X-API-Key": API_KEY},
    json={
        "columns": [{
            "table_name": "<table_name>",
            "column_name": "<column_name>",
        }],
    },
    timeout=120,
)
r.raise_for_status()
print(r.json())

Example request body

JSON
{
  "columns": [
    {
      "table_name": "<table_name>",
      "column_name": "<column_name>"
    }
  ]
}

Delete High Cardinality Columns For Db

DELETE/v1/agents/{agent_id}/databases/{db_id}/tables/high-cardinality-columns

Delete specific high-cardinality columns for an agent, scoped to a database.

Removes the columns from the config and best-effort deletes the matching db_id-scoped vectors from the HC Qdrant collection.

Credential Database Agent API key for this agent (X-API-Key)

Path parameters

NameTypeDescription
agent_idrequiredstringAgent ID
db_idrequiredstringDatabase ID

Request body · application/json

NameTypeDescription
columnsrequiredarray<HighCardinalityColumnItem>List of high cardinality columns
↳ table_namerequiredstringTable name
↳ column_namerequiredstringColumn name

Other responses

  • 422 Validation Error
import os
import requests

API_ROOT = "https://futuresmart.ai/database-agent/api"
API_KEY = os.environ["DATABASE_AGENT_API_KEY"]

r = requests.delete(
    f"{API_ROOT}/v1/agents/YOUR_AGENT_ID/databases/YOUR_DB_ID/tables/high-cardinality-columns",
    headers={"X-API-Key": API_KEY},
    json={
        "columns": [{
            "table_name": "<table_name>",
            "column_name": "<column_name>",
        }],
    },
    timeout=120,
)
r.raise_for_status()
print(r.json())

Example request body

JSON
{
  "columns": [
    {
      "table_name": "<table_name>",
      "column_name": "<column_name>"
    }
  ]
}

Get All Hc Profiles For Db

GET/v1/agents/{agent_id}/databases/{db_id}/tables/hc-profile

Get stored HC column profiles for all profiled tables of a specific database.

Credential Database Agent API key for this agent (X-API-Key)

Path parameters

NameTypeDescription
agent_idrequiredstringAgent ID
db_idrequiredstringDatabase ID

Other responses

  • 422 Validation Error
import os
import requests

API_ROOT = "https://futuresmart.ai/database-agent/api"
API_KEY = os.environ["DATABASE_AGENT_API_KEY"]

r = requests.get(
    f"{API_ROOT}/v1/agents/YOUR_AGENT_ID/databases/YOUR_DB_ID/tables/hc-profile",
    headers={"X-API-Key": API_KEY},
    timeout=120,
)
r.raise_for_status()
print(r.json())

Trigger Hc Profile For Db

POST/v1/agents/{agent_id}/databases/{db_id}/tables/hc-profile

Trigger automatic profiling of a specific database's tables.

Credential Database Agent API key for this agent (X-API-Key)

Path parameters

NameTypeDescription
agent_idrequiredstringAgent ID
db_idrequiredstringDatabase ID

Request body · application/json (optional)

NameTypeDescription
configobject | null
↳ low_cardinality_thresholdinteger | nullDefault: 20
↳ high_null_thresholdnumber | nullDefault: 95
↳ min_avg_text_len_for_hcnumber | nullDefault: 2
↳ sample_limitinteger | nullDefault: 5
tablesarray<string> | null
auto_register_hcbooleanDefault: true

Other responses

  • 422 Validation Error
import os
import requests

API_ROOT = "https://futuresmart.ai/database-agent/api"
API_KEY = os.environ["DATABASE_AGENT_API_KEY"]

r = requests.post(
    f"{API_ROOT}/v1/agents/YOUR_AGENT_ID/databases/YOUR_DB_ID/tables/hc-profile",
    headers={"X-API-Key": API_KEY},
    json={
        "auto_register_hc": True,
    },
    timeout=120,
)
r.raise_for_status()
print(r.json())

Example request body

JSON
{
  "auto_register_hc": true
}

Delete All Hc Profiles For Db

DELETE/v1/agents/{agent_id}/databases/{db_id}/tables/hc-profile

Delete all stored HC column profiles for a specific database (and its Qdrant vectors).

Credential Database Agent API key for this agent (X-API-Key)

Path parameters

NameTypeDescription
agent_idrequiredstringAgent ID
db_idrequiredstringDatabase ID

Other responses

  • 422 Validation Error
import os
import requests

API_ROOT = "https://futuresmart.ai/database-agent/api"
API_KEY = os.environ["DATABASE_AGENT_API_KEY"]

r = requests.delete(
    f"{API_ROOT}/v1/agents/YOUR_AGENT_ID/databases/YOUR_DB_ID/tables/hc-profile",
    headers={"X-API-Key": API_KEY},
    timeout=120,
)
r.raise_for_status()
print(r.json())

Get Table Hc Profile For Db

GET/v1/agents/{agent_id}/databases/{db_id}/tables/{table_name}/hc-profile

Get the stored HC column profile for a specific table in a specific database.

Credential Database Agent API key for this agent (X-API-Key)

Path parameters

NameTypeDescription
agent_idrequiredstringAgent ID
db_idrequiredstringDatabase ID
table_namerequiredstringTable name

Other responses

  • 422 Validation Error
import os
import requests

API_ROOT = "https://futuresmart.ai/database-agent/api"
API_KEY = os.environ["DATABASE_AGENT_API_KEY"]

r = requests.get(
    f"{API_ROOT}/v1/agents/YOUR_AGENT_ID/databases/YOUR_DB_ID/tables/YOUR_TABLE_NAME/hc-profile",
    headers={"X-API-Key": API_KEY},
    timeout=120,
)
r.raise_for_status()
print(r.json())

Delete Table Hc Profile For Db

DELETE/v1/agents/{agent_id}/databases/{db_id}/tables/{table_name}/hc-profile

Delete the stored HC column profile for a specific table in a specific database.

Credential Database Agent API key for this agent (X-API-Key)

Path parameters

NameTypeDescription
agent_idrequiredstringAgent ID
db_idrequiredstringDatabase ID
table_namerequiredstringTable name

Other responses

  • 422 Validation Error
import os
import requests

API_ROOT = "https://futuresmart.ai/database-agent/api"
API_KEY = os.environ["DATABASE_AGENT_API_KEY"]

r = requests.delete(
    f"{API_ROOT}/v1/agents/YOUR_AGENT_ID/databases/YOUR_DB_ID/tables/YOUR_TABLE_NAME/hc-profile",
    headers={"X-API-Key": API_KEY},
    timeout=120,
)
r.raise_for_status()
print(r.json())