Copyright (c) 2026 MindMesh Academy. All rights reserved. This content is proprietary and may not be reproduced or distributed without permission.

4.2.4. Open-Source Orchestration: LangChain and LlamaIndex

💡 First Principle: Native Bedrock Agents and Knowledge Bases cover the common orchestration paths with the least code and the most AWS integration — but when an application needs an integration they do not offer, custom retrieval logic, or portability across model providers, an open-source orchestration framework fills the gap. The exam expects you to know when to reach past the native services, not just that the frameworks exist.

Native vs. open-source orchestration — the trade-off:
DimensionNative (Bedrock Agents / Knowledge Bases)Open-source (LangChain / LlamaIndex)
Operational overheadAWS-managed; minimal codeYou build and operate the orchestration code
IntegrationsManaged connector listAny source or tool you can write a wrapper for
PortabilityAWS-specificProvider-agnostic; swap models or clouds
Custom retrieval logicLimited to managed optionsFull control over the pipeline
Best whenStandard RAG/agents, fastest deliveryA need the native services do not yet cover
LangChain on AWS — the integration points that matter:
  • ChatBedrock is LangChain's class for calling Bedrock chat models. LangChain orchestrates the chain, custom tools, and any third-party component (for example a reranker Bedrock Agents does not integrate natively) while Bedrock still serves the model. LangChain calls Bedrock directly — you do not abandon Bedrock to use LangChain.
  • DynamoDBChatMessageHistory provides durable, shared conversation memory. It persists each session's messages to an Amazon DynamoDB table keyed by session ID, so any stateless compute instance (Lambda, Fargate task) can read and append the same history. In-process buffers or local-RAM memory are lost when an instance recycles and are not shared across a fleet.

LlamaIndex — the data framework: LlamaIndex specializes in connecting custom data sources, building indexes, and defining retrieval logic. Reach for it when a source is not on the Bedrock Knowledge Bases connector list, or when you need ingestion and retrieval behavior the managed pipeline does not provide.

⚠️ Common Misconception: "Using LangChain means replacing Bedrock." LangChain and LlamaIndex are orchestration layers that sit on top of Bedrock — ChatBedrock invokes Bedrock models directly. You add a framework for flexibility and portability, not to remove AWS from the stack. The cost is that you now operate the orchestration code yourself; the native services manage that for you.

Reflection Question: Your team needs a chatbot whose conversation memory survives across sessions and across a fleet of stateless Lambda functions, and which chains a third-party reranker that Bedrock Agents does not support. Which framework and which AWS service back the memory, and what do you give up by not using the native services?

Alvin Varughese
Written byAlvin Varughese
Founder18 professional certifications