All work

Case study · Generative AI on AWS

A retrieval-augmented chat agent built on Amazon Bedrock.

Coastal Properties is a leasing and resident-support chat agent for a property manager. It answers from the manager’s own documents, stays current as documents are added, and restricts what each person can retrieve according to their role.

Industry
Property management
Use case
Retrieval-augmented chat agent for leasing and resident support
Core services
Amazon Bedrock, Amazon S3 Vectors, AWS Lambda

AWS services used

Amazon BedrockAmazon S3 VectorsAWS LambdaAWS Step FunctionsAmazon EventBridgeAmazon API GatewayAmazon CognitoAmazon DynamoDBAmazon CloudFrontAmazon CloudWatch

Also used: Python, LangGraph, Terraform, GitHub Actions.

Challenge

Making property documents answerable.

A property manager’s knowledge lives in documents: leases, pet and parking policies and move-out forms, alongside staff-only material such as occupancy reports, work orders and vendor contracts. Residents and prospective tenants ask the same questions repeatedly, and the answers sit in files that are slow to search.

Three requirements shaped the design:

  • Answers must be grounded in the manager’s own documents, and the agent must say so when the documents do not cover a question.
  • New documents must become searchable without engineering work.
  • Staff-only content must never be retrievable by a resident or a prospective tenant.

Solution

A serverless RAG pipeline on AWS.

The agent combines two paths: an ingestion pipeline that turns documents into labelled vectors, and a retrieval workflow that answers each question from the passages the caller is permitted to read.

Ingestion

Uploading a document to Amazon S3 emits an event through Amazon EventBridge that starts an AWS Step Functions workflow. AWS Lambda functions parse the file, split it into chunks by heading, create an embedding for each chunk with Amazon Titan Text Embeddings V2 on Amazon Bedrock, and store the chunk in Amazon S3 Vectors with an audience label.

Retrieval and generation

A containerised AWS Lambda function runs a FastAPI service and a LangGraph workflow. The workflow classifies each message, retrieves the passages the caller is permitted to read, and uses Claude Haiku 4.5 on Amazon Bedrock to generate a grounded answer that is streamed to the browser. Maintenance requests are extracted as structured data and written to Amazon DynamoDB as work orders.

Access control

Amazon Cognito groups (tenant and admin) determine which audiences a caller may read, and Amazon API Gateway verifies the token before the function runs. The audience filter is applied inside the vector query, so restricted passages are never retrieved for the wrong role. A document outside a known location defaults to admin-only.

Delivery and operations

The environments are defined in Terraform. GitHub Actions deploys through OpenID Connect with short-lived credentials, so no AWS access keys are stored, and every infrastructure change is reviewed as a plan first. Amazon CloudWatch provides structured logs, a dashboard and alarms.

Architecture

Request path and ingestion path.

Request path: a question travels from the browser to the model and returns as a stream.

Request path: a question travels from the browser to the model and returns as a stream.

Architecture diagram: a question travels from the browser through Amazon CloudFront and Amazon API Gateway into a containerised AWS Lambda function that classifies it, searches only what the caller may read, generates an answer with Claude on Amazon Bedrock, and streams the answer back
Ingestion path: an uploaded document is chunked, embedded and stored with an audience label.

Ingestion path: an uploaded document is chunked, embedded and stored with an audience label.

Architecture diagram: an uploaded file triggers an event, then an AWS Step Functions workflow that reads and chunks the document, creates an embedding for each chunk, and stores it in a vector index with an audience label

Retrieval-augmented generation

RAG in action.

The screenshots below are taken from the deployed development environment, using sample documents for a fictional property. They show one question before and after documents are added, and a question that draws on several documents.

Initial state

Before documents are uploaded

The knowledge base holds no availability information. The agent does not speculate: it states that it could not find the answer and refers the visitor to the leasing office.

Chat agent response to a question about available apartments: it could not find current availability and refers the visitor to the leasing office

Ingestion

An administrator adds a document

An administrator uploads a Word document to a shared Google Drive folder, the document store for this environment. No further action is required.

Shared folder named public containing available_rentals_batch1.docx
First document
The same folder containing two files: available_rentals_batch1.docx and available_rentals_batch2.docx
Second document
Ingestion pipeline

Source document

available_rentals.docx

Ingestion workflow

  1. Read
  2. Embed
  3. Store
Unit 103 · 1 bed · $2,795public
Unit 206 · 2 bed · $3,350public
Unit 209 · Studio · $2,250public

Search index

Any 2-bedrooms?

Unit 206 · $3,350 · available Nov 15

An uploaded Word document is split into chunks, each labelled with its audience and stored in the search index. The agent can then answer a question about two-bedroom availability.

Retrieval

After documents are uploaded

New documents are picked up automatically. A synchronisation job copies each file from Google Drive to Amazon S3, and the object-created event is routed by Amazon EventBridge to an AWS Step Functions workflow that chunks, embeds and indexes the document. Shortly afterwards, the same question is answered from the new document. Further uploads extend what the agent knows: a narrower question retrieves passages from both documents, Unit 206 from the first and Unit 108 from the second.

Chat agent response to the same question, now listing available units with monthly rent, availability dates and features
The same question, after the first document is uploaded.
Chat agent response to a two-bedroom question, listing two units, one from each uploaded document
A narrower question, after the second document is uploaded.

Access control

Audience-aware retrieval.

Each chunk carries an audience label (public, tenant or admin) assigned from the location of its source document. The label is applied as a filter inside the vector query, so restricted passages are never retrieved for the wrong role. In the example below, both users ask for the March 2024 occupancy rate, which is held in a staff-only report.

Chat signed in as a tenant: the agent cannot find occupancy information and refers the user to the leasing office
Tenant: no answer is returned, and the user is referred to the leasing office.
Chat signed in as an administrator: the agent answers that March 2024 occupancy was 90.0 percent, 18 of 20 units
Administrator: 90.0% (18 of 20 units), retrieved from the same staff-only report.

Start a conversation

Contact me to discuss your projects, goals, or challenges.

Tell me what you are trying to accomplish and I’ll help identify the most practical next step.

A direct contact path

Submitting this form sends your message straight to our inbox and we'll reply from there. Prefer email directly? Use the address below instead.

info@crystal-edge-digital.com

Choose the closest fit. You can include the details below.