TradeOpsSim-AgentEnv / docs /agentenv-workflow.md
AlexSchwartzman's picture
Publish TradeOpsSim environment, evaluations, and video
eb58518 verified
|
Raw History Blame Contribute Delete
5.27 kB

Building and evaluating an internal agent with AgentEnv

Suppose GTS wanted an AI agent to monitor trade reconciliation, investigate missing or duplicated fills, and flag cases for review. AgentEnv could provide a repeatable test environment for developing that agent before an internal trial. This is a proposed use; TradeOpsSim does not connect to GTS systems or continuously monitor a live desk.

AgentEnv is a framework for building software environments and running and evaluating agents in them. TradeOpsSim is one such environment. The reconciliation agent is a separate program: it connects a model to the environment's tools and decides which actions to take.

Part In this example Who supplies it
Environment Orders, execution reports, positions, an exception queue, and nine tools Engineers implement the business behavior using the environment SDK
Agent A model reads the runbook, investigates, and calls recovery tools The team connects or implements its chosen agent
Outcome checks Executions booked once, correct positions, supported cancellation, appropriate escalation Domain specialists define correctness; engineers encode it
Test execution Deploy the components, load a case, prompt the agent, invoke checks, and save results AgentEnv runs the configured task

The framework provides the test infrastructure. The usefulness of the environment depends on the team's cases, tools, and checks.

A concrete reconciliation test

A buy order is for 1,000 shares. The desk has booked 400. Recovery returns a missing 200-share execution twice and a cancellation acknowledgment. The agent should add 200 exactly once. The result is 600 filled, 400 cancelled, no remaining order quantity, and +600 booked.

Remove the acknowledgment and the required behavior changes: keep the supported 600-share position, leave 400 unresolved, and open an evidence request. The check judges the resulting records and evidence. A convincing explanation or a closed incident is insufficient.

The released records also include an already reconciled case, where no new booking is needed, and a scope-collision case, where identical execution IDs in different accounts must remain separate. Both the rules baseline and the final model run passed these authored cases. This demonstrates how to evaluate behavior; it does not establish an improvement over the baseline.

How a team at GTS could start

This is a proposed use, not a description of GTS's systems or an existing deployment.

  1. Select one workflow and several reviewed incidents. For reconciliation, collect sanitized order history, available execution reports, ledger state, and the accepted resolution.
  2. Reproduce only the relevant tools and records. For example: inspect an order, recover reports, replay a supported execution, and open an exception. Engineers implement how these actions change state.
  3. Define the expected outcome with the operations team. Include cases where the correct answer is to escalate, preserve uncertainty, or leave already correct records alone.
  4. Run a rules baseline and the chosen agent on the same cases. Inspect records and tool traces for discrepancies. Track failures separately from ungraded infrastructure errors.
  5. Change the prompt, model, or agent implementation and rerun. Reserve additional cases for evaluation after development; synthetic development fixtures alone cannot establish real-world reliability.

The next decision is whether the measured results justify an internal review workflow. One proposed trial would feed the agent copied reconciliation records and ask it to investigate breaks and propose repairs for an operator to check. GTS would build that operational integration. AgentEnv would continue to run the team's test cases as the agent changes; it does not supply the firm's operational judgment or automatically create a faithful simulator.

A different workflow

Cash reconciliation could use confirmed balances, pending receipts, account restrictions, and funding deadlines. An agent could reconcile the availability view and prepare a funding request for human review. Separate checks would verify that pending receipts are not counted as settled cash, reserves are preserved, and proposed funding arrives before the cutoff.

That would be another environment with its own tools and business rules. The same framework could deploy it, run agents, record actions, and invoke its outcome checks. This treasury example is a design illustration; TradeOpsSim implements the trade-reconciliation environment only.

Run the supplied example

From the extracted application source, with Python 3.11.4+ and Docker running:

python -m pip install -e '.[integration]'
agent-env run ./bundles/baseline --eval all

Then configure the endpoint and model as described in bundles/agent/README.md inside the source archive and run the same cases:

agent-env run ./bundles/agent --eval all --model MODEL_NAME

The framework retains each run and its verification results. Supported agent trajectories capture the tool conversation. The supplied validation report explains the recorded baseline, real-model runs, adapter checks, and limits.