DZHANER Back to projects GitHub

AI / AWS / RAG

Bedrock Chatbot

A cloud-based generative AI chatbot built around AWS Bedrock and retrieval-augmented generation. The project combines managed AI services with serverless APIs, retrieval, data and cloud infrastructure to explore how an AI application fits into a real AWS environment.

AWS BEDROCKRAGOPENSEARCHLAMBDAAPI GATEWAYLANGCHAINPOSTGRESQL

CASE STUDY / ARCHITECTURE

Bedrock Chatbot / RAG Pipeline

A managed AI foundation model surrounded by retrieval, serverless application logic and cloud data services.

AWS BEDROCKRAGSERVERLESS
01
Bedrock Chatbot / RAG PipelineAWS BEDROCK · RAG · SERVERLESSA managed AI foundation model surrounded by retrieval, serverless application logic and cloud data services.
01
KNOWLEDGE3 components
DocumentsExternal knowledge
Web / APIsAdditional sources
PostgreSQLApplication data
02
RETRIEVAL3 components
IngestionPrepare source data
Relevant ContextGround the prompt
03
AI / API4 components
API GatewayRequest entry point
LangChainIntegration / orchestration
04
EXPERIENCE2 components
Grounded ResponseContext-aware output
01THE PROBLEM

A useful AI application needs more than a model.

Calling a foundation model is only one part of building an AI application. The system also needs an interface, retrieval, application logic, identity, networking and a place for data.

The goal of this project was to build a practical question-answering system using managed AWS AI services while keeping the surrounding architecture modular and cloud-native.

Retrieval-augmented generation was used so the application could ground responses in an external knowledge source instead of relying only on the model's pre-trained knowledge.

02ARCHITECTURE

Application layer around a managed foundation model.

The application separates the client-facing API, compute, retrieval layer and foundation model. This keeps the AI component interchangeable with the surrounding infrastructure.

PostgreSQLApplication data layer
03RAG

Give the model relevant context before it answers.

The project uses AWS retrieval components together with OpenSearch and a Bedrock-based knowledge workflow. LangChain is used as part of the application integration layer.

Relevant DocumentsCandidate context
04AWS SERVICES

Each AWS service has a defined responsibility.

Amazon Bedrock

Provides access to managed foundation models without operating model infrastructure directly.

API Gateway

Provides the API entry point for the application.

Lambda

Provides serverless application execution for the API workflow.

OpenSearch

Supports the retrieval/search side of the RAG architecture.

PostgreSQL

Provides the relational data layer used by the broader application.

05CLOUD INFRASTRUCTURE

The AI layer still needs normal cloud engineering.

This is an important part of the project: AI does not remove infrastructure engineering. It adds another workload that has to fit inside the infrastructure.

  • IAM configuration for AWS resources and application access.
  • VPC networking as part of the cloud environment.
  • API Gateway and Lambda integration.
  • S3 and other AWS managed services around the AI workflow.
  • PostgreSQL for application data.
  • Infrastructure defined through Terraform.
06APPLICATION FLOW

From question to response.

Keeping these stages conceptually separate makes it easier to reason about failures. A bad response does not automatically mean the foundation model is the problem; retrieval, application logic, permissions or data can be responsible as well.

API GatewayReceives and routes the request.02
LambdaRuns the application workflow.03
Retrieve contextFind relevant knowledge for the question.04
Context + questionBuild the augmented prompt.05
Amazon BedrockProcesses the grounded prompt.06
07ENGINEERING PROBLEMS

The interesting failures happen between components.

Retrieval quality

the model can only produce a grounded answer from the context that retrieval provides.

Integration

API Gateway, Lambda, retrieval and Bedrock must agree on request and response flows.

IAM

every managed service interaction needs appropriate permissions.

Networking

application and data components still depend on normal cloud networking principles.

Observability

debugging an AI workflow requires visibility across the complete request path rather than only looking at model output.

08LESSON

AI engineering is still systems engineering.

The project demonstrates how an AI feature can be assembled from familiar cloud engineering primitives. The foundation model is important, but the reliability of the application depends on the system surrounding it.

This is the part of AI engineering that aligns closely with DevOps and cloud engineering: APIs, identity, networking, infrastructure as code, data, observability and controlled deployment still matter.