API Reference

Agno API

FastAPI agent runtime endpoints — the intelligence layer.

The Agno FastAPI service runs the agent runtime. Laravel calls these endpoints internally over Docker network DNS. All requests require X-Agno-Key: {AGNO_API_KEY} header.

Base URL (internal): http://ubios_agno:8001 (ip-test) or http://agno-api:8001 (production)

Agent Queries

POST /query

Primary endpoint for user-initiated questions. OrchestratorAgent classifies intent and routes to specialist.

Request:

FieldTypeRequiredNotes
questionstringyesNatural language question
user_idUUIDyesFor session logging
session_contextobjectnoPrevious messages for multi-turn
response_formatstringnotext, table, chart, auto (default: auto)

Response:

FieldTypeNotes
answerstringNatural language answer
agent_usedstringWhich specialist handled it
sourcestringredis_cache, saved_query, generated, rag
dataobjectStructured data (table/chart)
sql_usedstringSQL executed (AnalyticsAgent only)
citationsarraySource references (KnowledgeAgent only)
confidencefloat0–1
suggested_questionsarray3 follow-up questions
session_idUUIDFor multi-turn conversation
duration_msinteger

POST /context

Context panel data when user clicks a dashboard element. Target: under 1.5 seconds.

Request:

FieldTypeRequiredNotes
click_typestringyesentity, metric, alert
entity_typestringconditionalRequired for entity clicks
entity_idUUIDconditionalRequired for entity clicks
metric_namestringconditionalRequired for metric clicks
periodstringconditionalTime period for metric clicks
agent_output_idUUIDconditionalRequired for alert clicks

Response:

FieldTypeNotes
titlestringContext panel headline
explanationstring2–4 sentence explanation
key_signalsarray{label, value, trend} objects
recommended_actionstringWhat to do (optional)
suggested_questionsarray3 drill-down questions
confidencefloat

Document Extraction

POST /extract

Trigger document extraction. Returns immediately — poll status with job_id.

Request:

FieldTypeRequiredNotes
document_idUUIDyesFK to tenant_data.documents
storage_pathstringyesMinIO/S3 path
mime_typestringyes
document_typestringyesinvoice, contract, delivery_note, etc.
force_ocrbooleannoSkip Docling, use Mistral OCR
force_tablebooleannoRoute to PaddleOCR for table-heavy documents

Response: { job_id, estimated_seconds }

GET /extract/status/:job_id

Response:

FieldTypeNotes
statusstringqueued, parsing, extracting, validating, completed, failed, review_required
progressinteger0–100
fields_extractedinteger
fields_flaggedintegerLow-confidence fields
errorstringOn failure only

Behavioral Scoring

POST /score

Trigger scoring for one or more entities.

Request:

FieldTypeRequiredNotes
entity_typestringyese.g. customer
entity_idsarraynoEmpty = score all
goal_idUUIDnoEmpty = all active goals
force_refreshbooleannoIgnore Redis cache

Response: { job_id, entities_queued }

Web Crawling

POST /crawl

Scrape, crawl, or map a URL via self-hosted Firecrawl. Requires --profile web Docker profile.

Request:

FieldTypeRequiredNotes
urlstringyesURL to crawl
modestringnoscrape (default), crawl, map
limitintegernoMax pages for crawl mode (default: 10)
max_depthintegernoCrawl depth (default: 2)

Response:

FieldTypeNotes
urlstringThe requested URL
modestringWhich mode was used
pagesarray[{url, markdown, title}] for scrape/crawl, [{url}] for map
total_pagesintegerNumber of pages returned
duration_msinteger

Modes:

  • scrape — Single page, returns markdown + metadata
  • crawl — Multi-page, follows links up to limit and max_depth
  • map — URL discovery only, no content fetched

Widget Rendering

POST /widget/render

Render widget data. Cache/template hits return in under 100ms. No LLM call for any standard widget.

Request:

FieldTypeRequiredNotes
widget_typestringyeskpi_card, metric_chart, top_n_table, call_list, alert_feed, raw_query, report
configobjectyesWidget-specific configuration
rolestringnoadmin, manager, viewer

Response: { widget_type, data, source, duration_ms }

source values: template (pre-computed), cache (Redis), generated (LLM, admin testing only), pre_computed (from agent_outputs).

GET /widget/suggest

Suggest widget configurations based on the semantic model. Admin-only.

Response: { suggestions: [{ widget_type, config, preview_description }] }

Templates

POST /templates/render

Render a saved query template with parameters.

POST /templates/suggest

Suggest templates based on the semantic model.

POST /templates/chat

Chat about template modifications.

POST /templates/evaluate

Evaluate a template against test data.

POST /templates/summarize

Summarize template results.

System

GET /health

Response:

FieldTypeNotes
statusstringok, degraded, unavailable
databasestringok, error
redisstringok, error
llm_providersobjectprovider_name: 'ok' or 'error' per provider
versionstringAgno version
uptime_secondsinteger

POST /schema/refresh

Re-sync schema_context from live database DDL.

Response: { tables_synced, columns_synced, duration_ms }

GET /traces/:trace_id

Retrieve a query trace for debugging.

POST /config/reload

Reload configuration from database.

GET /metrics

Prometheus-format metrics for monitoring.

Error Format

All errors return HTTP 4xx/5xx with:

{
  "error": "string description",
  "error_code": "AGENT_TIMEOUT | SCHEMA_NOT_FOUND | LLM_FAILURE | VALIDATION_FAILED",
  "retry_possible": true,
  "details": {}
}