How it works
Each question you send moves through a five-stage LangGraph pipeline that handles everything from loading your workspace schema to composing the final answer.1
load_context
BoardPulse loads your workspace configuration — the approved table list, source database dialect, and any workspace-level settings. This context shapes every subsequent step.
2
draft_query
Your message is sent to the configured AI provider (cloud, local, or mock) along with the workspace schema. The model returns a SQL draft and an executive summary in the
answer field.3
validate_query
The drafted SQL passes through the SQL guardrail layer. Only
SELECT statements against your approved tables are allowed. Any forbidden operation raises an HTTP 422 before execution.4
execute_query
The validated query runs against your source database in read-only mode. Results are wrapped with a safety
LIMIT, then converted into a table, chart, and export files.5
finalize_response
The executive summary and any pipeline warnings are merged into the final
answer. The complete ChatResponse is returned to the caller.Request schema
Send aPOST to /api/v1/chat/query with a JSON body matching ChatRequest:
Provider options
cloud
Routes to an OpenAI-compatible API (e.g., GPT-4.1-mini). Requires
OPENAI_API_KEY.local
Routes to a local Ollama instance. Requires
OLLAMA_ENABLED=true and a running model.hybrid
Prefers
local if Ollama is available, falls back to cloud. Good default for production.mock
Returns deterministic responses without calling any AI model. Use for testing and CI.
Response schema
A successful query returns aChatResponse object:
Example
Request
Response
Tips
The
executed_sql field always reflects what actually ran against the database, including safety limits applied by the system. Use this field — not sql — for compliance logging.