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.
Farhan Helmy
/ Valiance Health
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.
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.
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.
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.
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.
The handoff concept
Don't let one agent rot with context
EntryQuery agent
Takes the user question and decides where it goes.
→
SpecialistData analyst
Does the research and the heavy lifting.
→
OutputSummarizer
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.
Multi-agent prototype
The first multi-agent sketch
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.
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.
LangGraph workflow
The agent workflow
Amazon NovaRouter
Reads intent, chooses the path, controls LangGraph state.
→
Claude SonnetData Scientist
Frames the analysis and decides what evidence is needed.
→
Claude SonnetData Analyst
Turns the business question into data operations.
→
SQL tool nodeSQL Gen + Execute
Generates SQL, runs it, returns structured results.
→
Claude SonnetResult Analyzer
Checks output, explains findings, decides on another pass.
Different nodes, different models
Right model for each node
RouterAmazon Nova
Fast routing for intent classification and branch selection — keeps the graph entry point cheap.
Reasoning nodesClaude Sonnet
Where deeper reasoning matters: analysis planning, data interpretation, final explanation.
Tool nodeSQL Gen + Execute
Different prompt, permissions, and guardrails — built around safe database work.
LangGraph stateShared context
Nodes cooperate through state instead of forcing one model to carry every instruction and tool.
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.
AnalyticsSQL + analysis
The first production path: answer data questions with query execution and explanation.
SupportSupport agent
Operational and product help routes to a support-focused model and tools.
VisualChart generator
Result sets branch into charts, tables, and executive summaries.
FutureMore workflows
Sandbox, reporting, data-quality checks attach behind the same router.
First integrated prototype
It works end to end
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.
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.
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.
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.
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.
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 AgentGet the data
Handles the question, runs the query, prepares the result set.
→
Code Interpreter SandboxAgent does the job
Dump the result into a sandbox — code, files, pandas, charts, iteration.
→
Result AnalyzerExplain 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.
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.
Architecture
Harness with sandbox
Sandbox code
Inside the sandbox
Sandbox code
Inside the sandbox
Sample result
What the user gets back
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.
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
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.
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.
Next · Super ontology resolver
More than vector search
User languageMessy question
Users ask in business and healthcare terms, not database terms.
→
ResolverConcept mapping
Map intent to domain concepts, synonyms, measures, and entity relationships.
→
TraversalDatabase context
Traverse tables, embeddings, relationships, and metadata to find the right path.
→
Agent contextBetter 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.
val-sandbox · private now, open source soon
Our own sandbox runtime
AgentAgent
Plans the work and asks the runtime to execute code.
→
IsolatedDocker runtime
Runs arbitrary code inside an isolated execution environment.
→
OutputArtifacts
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 realityRCE is risky
Letting agents run code needs strict isolation, limits, logging, and policy.
GuardrailsSafety is the product
Network controls, file boundaries, execution limits, audit trails, permission checks — not optional.
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
Build it, don't just watch it
Thank you
Give the model a workspace, and get out of its way.
Questions? Let's talk harnesses, sandboxes, and healthcare analytics.
Farhan Helmy · Valiance Health · sidegent