
AI in Ops Center: Natural Language with Operational Control
How we combined LangGraph, OpenRouter, typed tools, deterministic guardrails, and continuous evaluation to make AI useful—and safe—in real operations.
The problem was not simply adding a chatbot
Ops Center was created to consolidate the operations of an accounting firm: collecting data maintained in Trello, preserving reliable history, publishing metrics, and managing company and people records. In that environment, artificial intelligence would only make sense if it reduced friction without weakening the system's rules.
The team needed a faster way to query and update records using natural language, but the risks were concrete: creating duplicates, executing actions with incomplete data, accepting a stale confirmation, or allowing the model to exceed the user's permissions.
So we did not hand the database to a model and hope for the best. We designed an architecture in which AI interprets and proposes, while deterministic software validates and authorizes.
Where AI is used—and where it is not
The conversational agent operates within the registration domain. It understands user intent, gathers required fields, searches existing companies and people, and guides actions such as creating, updating, restoring, or linking records.
Trello collection, data reconciliation, and metric calculation remain deterministic. Ops Center uses the latest successfully published collection, not merely the most recent attempt. If a source is incomplete or a run fails, the last reliable operational view remains available.
This separation matters: not every problem needs AI. We use models where language, context, and ambiguity create real leverage, and conventional code where consistency, authorization, and repeatability are essential.
The tools behind the solution
LangGraph for conversational state and flow
LangGraph structures the agent as a state graph. Instead of relying on a loose sequence of prompts, every stage has a clear responsibility: identify intent, request missing information, check duplicates, ask for confirmation, and execute the authorized action.
It also allows conversations to pause and resume safely. Checkpoints are stored in PostgreSQL, so state does not depend on the memory of a single process.
OpenRouter as the model access layer
OpenRouter provides the language model that interprets messages and produces structured output. The provider and model can evolve without changing the product's core rules.
The model cannot construct arbitrary commands. Its output is schema-validated and converted into explicit intents and arguments before reaching system tools.
Typed tools, Pydantic, and FastAPI
The actions exposed to the agent are typed tools. Pydantic validates formats, required fields, and structured output; FastAPI exposes the contracts and connects the agent to the same application use cases used by the administrative interface.
This prevents two implementations of the same rule. Creating a company through the UI or through a conversation goes through the same validations, permissions, and transactions.
PostgreSQL for operational memory and traceability
PostgreSQL stores records, conversation history, checkpoints, idempotency keys, and the evidence required to recover an execution. It acts as the source of truth instead of hiding informal memory inside a prompt.
Question, message, and action identifiers prevent a delayed “yes” from confirming a different operation or a network retry from executing the same write twice.
SSE for real-time progress
Agent responses are streamed through Server-Sent Events (SSE). The interface receives typed events as the workflow progresses, providing a responsive experience while preserving a reconstructable, sanitized history.
LangSmith and DeepEval for observability and evaluation
LangSmith can be enabled for explicit, sanitized tracing. Sensitive data is redacted, and tracing failures do not take down the rest of the application.
DeepEval uses synthetic cases to verify behavior, contract adherence, and correct tool usage. Alongside deterministic checks, an independent evaluation model can be used. Reports capture results and operational evidence without storing secrets or sensitive tool arguments.
MCP for the operational data source
The Model Context Protocol (MCP) connects the worker to the service that reads Trello boards, lists, and cards. In Ops Center this integration is deliberately read-only: it feeds snapshots and metrics but never changes source cards.
How a request is executed
When someone asks, for example, “register this company and assign its owner,” the workflow does not jump directly to a database write:
- the session and conversation ownership are verified;
- LangGraph identifies the intent and available data;
- the agent requests missing fields and searches for potential duplicates;
- a safety layer checks the capability required by the tool;
- the payload is normalized and bound to the current question;
- the user receives a summary and explicitly confirms the action;
- the deterministic use case executes the PostgreSQL transaction;
- the result is streamed to the interface and preserved in history.
Even if the model attempts to call a tool outside the expected flow, middleware and the application layer repeat the checks. A prompt is not a security boundary.
The problems this architecture solved
Less friction in administrative work. Users can express intent in natural language without knowing every screen or field in advance.
Protection against duplicates and retries. Preflight search, payload hashes, and idempotency reduce duplicate records and repeated writes.
Unambiguous confirmations. Short replies are attached to the correct question and action, preventing an old message from authorizing a new operation.
Preserved permissions. The agent only discovers and executes tools compatible with the authenticated user's capabilities.
Failure recovery. Checkpoints, leases, and heartbeats allow conversations to resume and interrupted turns to be handled without losing execution control.
Measurable evolution. DeepEval and tracing help reveal behavioral regressions, provider failures, and argument drift before they become operational problems.
Isolated failures. If OpenRouter or the agent checkpointer is unavailable, the agent is disabled while dashboards, collections, and conventional registration workflows remain operational.
The main lesson
Building AI for real operations is not only about choosing a model. It requires clear boundaries between probabilistic interpretation and deterministic rules.
In Ops Center, AI made interaction more natural without receiving unrestricted authority. The result is an agent that works inside the product—with context, memory, permissions, confirmation, auditability, and evaluation—instead of a chatbot placed beside it.