AWS User Group MY · Meetup

Building a Production-Grade AI Agent Harness

From multi-agent frameworks to a minimal agent harness — what we tried, what broke, and what we shipped.

Who we are

Valiance Health

Data foundation

Building a data foundation for value-based care.

Unified sources

Billing systems, clinical registries, EHRs, claims, and reporting tools — in one place.

Val

The AI-powered healthcare analyst layer on top of that foundation.

Valiance Health01
CHAPTER 01

The journey to agentic

We saw AI agents everywhere. One pattern stood out — and we wanted it in our own environment.

Why agents

The pattern that stood out

  • AI agents were showing up everywhere.
  • The one that stood out: the internal SQL agent.
  • Instead of asking analysts for every query, users could ask questions directly.
  • So we set out to replicate that idea in our own environment.
Journey to agentic02
Phase 0 · Starting out

Where we started

Already had

Simple LLM usage

Chat completions on OpenAI and Groq. Mostly prompt engineering — nothing agentic yet.

First moves

Learn the business

Everything was fresh and new. I started exploring automation and really learning the healthcare business.

Phase 003
Working backwards · Amazon principles 😄

What users actually needed

  • Users are analytics, back-office, and admin heavy.
  • They want everything automated — which is kinda impossible, btw.
  • They spent a lot of time just making sense of the cost.
Working backwards04
CHAPTER 02

Phase 1 — exploring frameworks

Five contenders, one set of hard requirements. Only one survived contact with production.

Phase 1 · The wishlist

What we needed from a framework

Human in the loop

HITL as a first-class concept, not a bolt-on.

Checkpointing

First-class support to pause and resume.

Session continuation

Continue a session where it left off.

Built-in storage

DB for conversation and token tracking.

Agent ↔ agent

Collaboration between specialized agents.

Handoff

Pass work cleanly from one agent to the next.

Phase 1 · Goals05
The handoff concept

Don't let one agent rot with context

Entry

Query agent

Takes the user question and decides where it goes.

Specialist

Data analyst

Does the research and the heavy lifting.

Output

Summarizer

Turns the work into a clean answer.

The initial idea: keep each agent lean by handing context along the chain instead of overloading a single agent.
Handoff concept06
Multi-agent prototype

The first multi-agent sketch

Multi-agent prototype
Multi-agent07
The framework bake-off

Five contenders

PydanticAI Library-driven design (I'm that person 😅). Docs messy but readable; lots still unstable. Too much selling of Pydantic itself. No session management or continuation.
CrewAI Very slow, and no first-class streaming — major turn-off. Good for multi-agent collaboration, though.
Autogen Microsoft framework → OpenAI-only at the time. Unclear Bedrock / Claude support. Instant turn-off.
LangChain Too simple and straightforward. No samples for advanced use cases — mostly covering the basics.
LangGraph Production deployment guide, first-class HITL, built-in checkpointer, schema + easy Django integration, and it talks to Bedrock. The winner.
Framework exploration08
CHAPTER 03

Phase 2 — integration begins

LangGraph is one big decision graph driven by the agent model. Context flows through the state machine.

Phase 2 · Integration

Building on the graph

  • Integration begins — lots of experimenting with conditions and graph building.
  • LangGraph is basically one big decision graph, driven by the agent model.
  • Sonnet 3.5 → 4.5 on global Bedrock.
  • Context passing through the state machine — powerful.
Phase 209
LangGraph workflow

The agent workflow

Amazon Nova

Router

Reads intent, chooses the path, controls LangGraph state.

Claude Sonnet

Data Scientist

Frames the analysis and decides what evidence is needed.

Claude Sonnet

Data Analyst

Turns the business question into data operations.

SQL tool node

SQL Gen + Execute

Generates SQL, runs it, returns structured results.

Claude Sonnet

Result Analyzer

Checks output, explains findings, decides on another pass.

LangGraph workflow10
Different nodes, different models

Right model for each node

Router

Amazon Nova

Fast routing for intent classification and branch selection — keeps the graph entry point cheap.

Reasoning nodes

Claude Sonnet

Where deeper reasoning matters: analysis planning, data interpretation, final explanation.

Tool node

SQL Gen + Execute

Different prompt, permissions, and guardrails — built around safe database work.

LangGraph state

Shared context

Nodes cooperate through state instead of forcing one model to carry every instruction and tool.

Model per node11
The router as a hub

The router becomes the expansion point

Amazon Nova

Router

Every workflow starts here. New capabilities become branches, not a rewrite.

Analytics

SQL + analysis

The first production path: answer data questions with query execution and explanation.

Support

Support agent

Operational and product help routes to a support-focused model and tools.

Visual

Chart generator

Result sets branch into charts, tables, and executive summaries.

Future

More workflows

Sandbox, reporting, data-quality checks attach behind the same router.

Router expansion12
First integrated prototype

It works end to end

First integrated prototype
First prototype13
CHAPTER 04

The pivot to a harness

The ecosystem moved. Claude Code got powerful, "harness" became the buzzword, and the agent moved into the terminal.

The ecosystem shifted

Finishing the implementation — and noticing the wind change

  • Claude Code became more and more powerful.
  • People moved toward the agent + subagent concept.
  • Less agent-to-agent collaboration.
  • Agent sandbox and filesystem dropped.
  • Biggest drop by Claude → SKILLS.md.
Finish implementation14
Why the harness pattern won

Pivoting our agent implementation

  • Harness becomes the buzzword.
  • Agent sandbox, skills, filesystem.
  • We understood why people were moving this way.
  • Tech-savvy people → terminal → agent lives in the terminal → access to all files → does its job.
Pivoting15
The hard question

But… how do we do this in production?

Existing app?

How do we implement this inside an app that already exists?

Give agent access to /?

In production? Handing an agent the whole root directory is a non-starter.

A lead

LangChain dropped a framework called deepagent.

The question16
First step into harness

Exploring the sandbox path

  • Explore more agent sandbox.
  • RLM just dropped — agent iterates through one variable of 1M length (e.g. a whole novel).
  • RLM too advanced for our use cases and not stable yet.
  • So we double down on the sandbox.
First step17
The idea

Give the model a workspace, not a script

  • Models keep getting more and more intelligent.
  • Give the model a sandbox, throw in a CSV with 100,000 lines — "hey, analyze this."
  • Skeptical at first… but the result was insane.
The idea18
CHAPTER 05

Replace the workflow with a harness

Fewer specialized nodes. One sandbox where the agent actually does the work.

From workflow to harness

The new shape

Query Agent

Get the data

Handles the question, runs the query, prepares the result set.

Code Interpreter Sandbox

Agent does the job

Dump the result into a sandbox — code, files, pandas, charts, iteration.

Result Analyzer

Explain the answer

Checks output, summarizes findings, turns raw analysis into a usable answer.

Old idea: a router into many specialized workflow nodes.  New idea: query agent → code-interpreter sandbox → result analyzer. The sandbox becomes the workspace where the agent actually does the job.
Replace workflow with harness19
The result

What the sandbox bought us

An extra analyze step

Better, more thorough analysis than a single SQL pass.

Real tooling

Access to pandas, numpy, and other libraries.

Iterate over big data

The agent uses all that to iterate through large datasets.

Most importantly

More token savings.

Result20
Architecture

Harness with sandbox

Harness with sandbox architecture
Harness with sandbox21
Sandbox code

Inside the sandbox

Sandbox code 1
Sandbox code 2
Sandbox code22
Sandbox code

Inside the sandbox

Sandbox code 3
Sandbox code23
Sample result

What the user gets back

Sample result
Sample result24
CHAPTER 06

The real work: context

The biggest improvement wasn't magic prompting. It was giving the agent the right context at the right time.

Context engineering

The ontology resolver

  • The biggest improvement wasn't magic prompting — it was the right context at the right time.
  • We added an ontology resolver so user language maps back to the right domain concepts.
  • It starts by querying embedded ontology data in pgvector with vector similarity search.
  • Next: a stronger graph layer, so concept relationships guide retrieval beyond text similarity.
The real work: context25
Tech stack

What it runs on

AIAmazon Bedrock + Anthropic Claude Sonnet 4.5
SandboxAmazon Bedrock AgentCore Code Interpreter
DatabasePostgreSQL + pgvector, multiple embedding tables
BackendDjango
FrontendReact · Vite · shadcn/ui
InfraAWS, deployed on ECS
Tech stack26
Learnings

What we got wrong (and right)

  • Early on we over-focused on memory, compaction, session continuation, and HITL.
  • Useful platform features — but not the real user problem.
  • The actual problem was analytics: helping users check and understand their data fast.
  • Usage was mostly fire-and-forget: ask, get the result, return to the system.
  • Most users didn't need a long conversation — they came back later and started fresh.
Learnings27
CHAPTER 07

What's next for us

A minimal harness framework, a smarter resolver, and our own open-source sandbox runtime.

Now deploying

A minimal harness framework

Core

Minimal harness

Our own small framework for agent execution, still integrated with Amazon Bedrock — context, tools, sandbox, standards, result handling.

Skills + AGENTS.md

Standard instructions, reusable capabilities, consistent behavior across projects.

Sandbox included

A controlled workspace where files, code, and analysis tools work together.

Model flexible

Fits any model — Bedrock, Claude, Nova, even ILMU.

Extensible

New agents, tools, skills, and workflows attach without rebuilding the app.

What's next28
Next · Super ontology resolver

More than vector search

User language

Messy question

Users ask in business and healthcare terms, not database terms.

Resolver

Concept mapping

Map intent to domain concepts, synonyms, measures, and entity relationships.

Traversal

Database context

Traverse tables, embeddings, relationships, and metadata to find the right path.

Agent context

Better answers

Give the query agent richer context before it generates analysis or SQL.

Maybe next talk: invite my CTO to explain the deeper ontology and graph side properly.
Super ontology resolver29
val-sandbox · private now, open source soon

Our own sandbox runtime

Agent

Agent

Plans the work and asks the runtime to execute code.

Isolated

Docker runtime

Runs arbitrary code inside an isolated execution environment.

Output

Artifacts

Returns files, logs, charts, tables, and analysis output.

Why build it?

Control the runtime

Tune the environment for healthcare analysis instead of a generic sandbox.

Security reality

RCE is risky

Letting agents run code needs strict isolation, limits, logging, and policy.

Guardrails

Safety is the product

Network controls, file boundaries, execution limits, audit trails, permission checks — not optional.

val-sandbox30
One more thing 👋

Want to learn how to build AI agents yourself?

I built sidegent.com — learn agents by actually building them in your browser, graded instantly. No setup, no API keys, no credit card.

sidegent.com — from zero to building AI agents
sidegent.com

Build it, don't just watch it

Interactive labs

Each lesson forks a real, working agent you configure and chat with — then grades your work the second you submit.

Machine Lab

Build on a real cloud machine. No setup, no installs — everything runs in your browser.

Prompts → tools → RAG

Write system prompts, add tools and web search, ground agents in your own docs, and ship one for real.

Sidegent Coder

An AI that codes alongside you — say what you want in plain English and watch it build with you.

RM5 OFF Interested? Reach out to me for a promo code — RM5 off, forever on the RM49/mo membership.
sidegent vs YouTube vs bootcamp comparison
sidegent.com31
Thank you

Give the model a workspace, and get out of its way.

Questions? Let's talk harnesses, sandboxes, and healthcare analytics.