AIToday

AWS shows market surveillance with LangGraph and Strands agents

Amazon AI Blog6h agoSend on LINE
AWS shows market surveillance with LangGraph and Strands agents

Key takeaway

Amazon published a technical guide showing how to build production-grade multi-agent systems for market surveillance by combining LangGraph (for deterministic workflow orchestration) and Strands Agent (for flexible LLM reasoning within specific nodes). The approach addresses the core challenge facing enterprise AI: balancing strict, predefined workflows with the need for intelligent reasoning at certain decision points. By isolating agent intelligence to specific nodes and maintaining centralized state through LangGraph's checkpoint system, teams can reduce hallucination, improve security against prompt injection, and support human review and recovery—critical for financial compliance.

Summaries like this, in your inbox every morning.

Sign up free →

3 Key Points

  • What happened

    Amazon published a technical guide demonstrating how to build a multi-agent market surveillance system using LangGraph for workflow orchestration and Strands Agent for reasoning within individual nodes. The architecture combines deterministic workflow routing with localized LLM intelligence, integrated on AWS infrastructure including the newly available Amazon Bedrock AgentCore.

  • Why it matters

    Enterprise surveillance and compliance systems need both strict, predictable execution paths and flexible reasoning to handle real-world ambiguity. This pairing lets organizations ground AI workflows in predefined logic while retaining LLM intelligence only where it is needed—reducing hallucination risk and improving auditability for financial services and regulated industries.

  • What to watch

    The complete solution is available on GitHub. LangGraph's checkpoint system enables human-in-the-loop review and recovery from failures, while Strands agents use Anthropic's Claude Sonnet 4.6 model on Bedrock with adaptive thinking (budget of 8000 tokens) and prompt caching to manage cost and context window overflow.

In Depth

Amazon's technical post demonstrates a production-ready architecture for multi-agent market surveillance systems built on two complementary frameworks: LangGraph and Strands Agent. The system orchestrates multiple specialized agents (security_monitor, broker_monitor, risk_monitor, intel_analyst) through a central workflow graph, each contributing its own insights to a final synthesizer node that produces comprehensive reports.

Strands Agent serves as the reasoning engine within individual nodes. The security_monitor agent in the example is configured with three tools: get_report_list (which loads available reports for a specific agent), get_report_schema (which retrieves column definitions and parameters for a report), and run_report (which executes a validated, parameterized SQL query). This separation of discovery from execution is intentional—it prevents the LLM from writing raw SQL and eliminates the risk of filter injection. The agent runs on Anthropic's Claude Sonnet 4.6 model via Amazon Bedrock, configured with a maximum of 16000 tokens, adaptive thinking with an 8000-token budget, and default prompt caching to manage cost and context window usage. Strands handles comprehensive session and state management, including multiple conversation managers, so the context window does not overflow during multi-step analysis.

LangGraph provides the macro-level orchestration layer. It models the workflow as a directed graph in which nodes represent functions containing agent logic and edges determine execution flow. The AgentState TypedDict maintains a shared state—including the query text, session ID, required agents list, and insights contributed by each specialist. After every node execution, LangGraph's checkpoint system snapshots the complete workflow state via AgentCoreMemorySaver, enabling recovery from failures and human-in-the-loop review. An orchestrator node routes incoming queries to the appropriate specialists based on the required_agents list; a route_analysts function then walks through each specialist by index, allowing conditional branching and dynamic routing. The graph includes built-in retry strategies with exponential backoff and comprehensive observability through OpenTelemetry for integration with most monitoring platforms.

The combination of both frameworks solves the core architectural challenge: enterprise workflows must be deterministic and auditable (following predefined compliance and routing logic), yet certain steps within those workflows require the flexible reasoning of an LLM. By placing Strands agents at specific nodes within the LangGraph graph, the system isolates LLM intelligence to exactly where it is needed. Each agent manages its own hyper-focused context and tool history, while LangGraph maintains the structured, overarching session state that all agents can reference and update independently. This compartmentalization reduces hallucination risk, improves security against prompt injection, and makes the system auditable—critical for financial services. The complete solution, including code samples and the full workflow diagram, is available on GitHub.

Context & Analysis

The post addresses a critical tension in enterprise AI: the need for deterministic, auditable workflows versus the flexibility of LLM reasoning. Traditional single-agent systems either lack the structure necessary for compliance and reliability, or they constrain reasoning too severely. LangGraph solves this by treating workflows as directed graphs with persistent state management and checkpoint-based recovery—features essential for production systems handling human-in-the-loop review and long-running investigations. Strands Agent, meanwhile, provides the reasoning engine within specific nodes, applying LLM intelligence only where ambiguity or dynamic analysis is required. This separation of concerns is particularly valuable for financial services, where workflows must follow regulatory logic (market surveillance, reporting, compliance gates) but still benefit from intelligent analysis of trading patterns and suspicious activity.

The architecture also addresses security and cost concerns. By having Strands agents explicitly retrieve data schemas before querying, the system avoids hallucinated SQL and injection attacks. The use of Anthropic's adaptive thinking (with a token budget) and prompt caching on Bedrock further controls cost and context management. The persistent state layer maintained by LangGraph ensures that if a node fails or a human analyst needs to review intermediate results, the system can resume from exactly where it left off—a critical capability for investigations that may span hours or days.

FAQ

What two frameworks are combined in this approach?
LangGraph (for macro-level workflow orchestration and state management) and Strands Agent (for model-agnostic reasoning and tool integration within individual workflow nodes).
How does the system prevent SQL injection and hallucination?
The surveillance agent separates discovery (get_report_list, get_report_schema) from retrieval (run_report). The run_report tool validates every filter against the report schema and builds a parameterized SQL query, so the LLM never writes raw SQL and filter values cannot be injected.
What model powers the Strands agent in this example?
Anthropic's Claude Sonnet 4.6, deployed via Amazon Bedrock in us-east-1 with a max token limit of 16000, adaptive thinking budget of 8000 tokens, and default prompt caching enabled.

Get the latest Large Language Models news every morning

AI-summarized, only the topics you pick — one digest a day via Email, Slack, or Discord.

Free · takes 30 seconds · unsubscribe anytime

Discussion

No comments yet. Be the first to share your thoughts!

Log in to join the discussion

Related Articles

Stay ahead with AI news

Get curated AI news from 200+ sources delivered daily to your inbox. Free to use.

Get Started Free

Free · takes 30 seconds · unsubscribe anytime