Build your first agent
This guide takes you from a connected datasource to a governed agent that answers a business question with evidence. You register the agent in Colrows, approve and seat a version, and run it on your own compute with the stock worker. You write no agent code. Allow about thirty minutes.
An agent named revenue-analyst that runs one verified query, reads the rows, and returns an answer in which every finding cites the query execution behind it. Colrows checks that evidence before the run succeeds.
Before you start
- An organization administrator account. An administrator holds every role of the agent control plane.
- A datasource that is ready for AI. The Quickstart gets you there.
- One verified query on that datasource. A governed agent never runs raw SQL. It runs the verified queries in its scope, so this tutorial needs one.
- A machine with Python 3.11 or later, and a key for a model provider such as OpenAI or Anthropic.
The steps below show the admin API under /api/quorum/v1. These routes need a signed-in user's session; see HTTP API for how to authenticate. Each successful response wraps its result in payload. The Quorum area of the Colrows app has pages for Agents, Runs, Evaluation suites, Reviews, Approvals, and Actions, and the on/off switch is in Administration → Settings. Three steps of this guide have no page and use the API: the requireEvaluation setting, the worker client, and the start of a run.
Step by step
-
Turn on the agent control plane
The control plane is off until an administrator enables it. Read the settings, set
enabledtotrueandrequireEvaluationtofalse, and send the whole settings object back.GET /api/quorum/v1/settings PUT /api/quorum/v1/settingsrequireEvaluationis on by default, and then a version needs a passing evaluation before it can be approved. This guide turns it off to keep the first agent short. Turn it on again before you run agents in production. -
Register the agent
POST /api/quorum/v1/agents { "agentKey": "revenue-analyst", "displayName": "Revenue analyst" }The response carries
payload.agentId. You own the agent unless you name another owner. -
Write the spec
The spec is the contract between the agent and your data. It names what the agent is for, what it can see, which tools it can call, whose access it uses, and when it runs.
POST /api/quorum/v1/agents/<agentId>/versions { "spec": { "specVersion": 1, "agentKey": "revenue-analyst", "displayName": "Revenue analyst", "pattern": "ANALYST", "purpose": "Answer questions about revenue by region.", "instructions": "Use verified queries. Cite the execution behind every finding.", "semanticScope": { "datasourceIds": ["<datasource-id>"], "verifiedQueryIds": ["<verified-query-id>"], "assetVersionPolicy": "FOLLOW_LATEST" }, "tools": { "colrows": ["searchSemanticEntities", "getSemanticEntities", "executeSQL", "getSQLExecutionStatus", "getSQLExecutionResult", "getRunContext", "reportSemanticGap"], "external": [] }, "identity": { "mode": "ON_BEHALF_OF_USER", "fallback": "DENY" }, "triggers": [ { "kind": "ON_DEMAND" } ], "output": { "contract": "ANALYST_ANSWER", "contractVersion": 1 } } }ON_BEHALF_OF_USERmeans that a run reads data with the access and masking policies of the user who started it. Every field is described in the agent spec reference. -
Submit, approve, and seat the version
POST /api/quorum/v1/agents/<agentId>/versions/<version>/submit POST /api/quorum/v1/agents/<agentId>/versions/<version>/review { "decision": "APPROVE" } POST /api/quorum/v1/agents/<agentId>/versions/<version>/seatUse
payload.versionfrom the response of the previous step. Submission validates the spec and checks that every datasource and verified query in scope is active. Only the seated version runs. -
Create a worker client
A worker is the software on your side that claims runs and executes them. It signs in with a worker client.
POST /api/quorum/v1/worker-clients { "name": "first-worker", "agentIds": ["<agentId>"], "expiresAt": <epoch-milliseconds> }The response
payloadcontainsclientIdandclientSecret. Copy the secret at once, because Colrows shows it only one time.expiresAtmust be within one year. -
Run the stock worker on your compute
pip install "colrows[agent,openai]" export COLROWS_URL=https://cloud.colrows.com export COLROWS_CLIENT_ID=... COLROWS_CLIENT_SECRET=... export COLROWS_MODEL=openai:gpt-5 OPENAI_API_KEY=... colrows quorum check # checks the URL, the credentials, and the scope, and takes no run colrows quorum serveThe worker runs the default loop for every agent that the worker client serves. Your model provider key stays on this machine. The Colrows SDK page lists every setting.
-
Start a run and read the answer
POST /api/quorum/v1/agents/<agentId>/runs { "input": { "question": "Which region had the highest revenue last week?" } } GET /api/quorum/v1/runs/<runId>/resultThe first response carries
payload.runId. An idle worker can take up to 30 seconds to claim the run. The result carries the answer, its findings, the evidence for each finding, and the outcome of the answer check.
What you have just done
| Step in the run | What enforced it |
|---|---|
| The worker received a token that works for this run only. | The run token, with only the scopes of the tools in the spec. |
| The agent could call only the tools in the spec, on the datasource in scope. | The guard on the server, on every tool call. |
| The query ran with the access of the user who started the run. | The identity mode of the spec, and your data access and masking policies. |
| Every finding cited an execution from this run. | The self-check in the worker, then the answer check on the server. |
| The run, its tool calls, and its events were recorded. | The audit trail. Read them with GET /runs/<runId>/tool-calls and /events. |
Where to go next
- Put it on a schedule. Add a
SCHEDULEtrigger to the spec. See Agent spec. - Try another pattern.
MONITORchecks metrics against thresholds,INVESTIGATORexplains why a metric changed, andDOCUMENT_ANALYSTanswers from documents. See Patterns. - Let the agent act. Register an action, list it in the spec, and add a handler to your worker, so the agent can tell a team or open a ticket. See actions and approvals.
- Call your own code. Declare a customer tool in the spec and register the function in your worker. See customer tools.
- Write your own agent code. Keep the governed tools and the evidence check, and bring your own loop or framework. See Full code.
- Measure accuracy. Add an evaluation suite, turn
requireEvaluationon, and name reviewers. See Accuracy and review. - Understand the platform. Agents at work explains how the control plane, your compute, and the semantic layer fit together.