AWS Builder Center
Weekend Annoying Task Challenge: CareCompliance Q&A

Weekend Annoying Task Challenge: CareCompliance Q&A

I built a simple a model's general knowledge application for adult care home in UK because i was using this as protopyte to solve a challenge for my mother who runs a care home in UK.

Vision & What the App Does
Anyone who has worked in or around a care home knows the drill: a resident's family raises a concern, a new hire needs to know the safeguarding procedure, or an inspection is coming up, and someone has to go digging through a long, dense regulator document to find the exact clause that applies. The CQC Fundamental Standards run to dozens of pages of formal regulatory language — not exactly a quick read at 7am before a shift.
CareCompliance Q&A solves this by turning that document into a chat interface. A care home manager types a plain-English question — "What do we need to do if a resident falls and is injured?" — and gets back a direct answer grounded in the actual policy text, with a citation to the specific excerpt it came from. If the document genuinely doesn't cover the question, the app says so instead of guessing, which matters a lot when the answer might inform a compliance decision.
The goal wasn't to replace judgment or legal advice — it's to cut the annoying part: the 10 minutes of scrolling through a PDF to find the one paragraph that answers a simple question.
How I Built it
I started by deciding the app had to answer only from the source document, never from the model's general knowledge — a care home is not the place for a plausible-sounding hallucination about regulatory requirements. That ruled out a simple "ask the LLM directly" approach and pointed to retrieval-augmented generation (RAG).
To keep the build weekend-sized, I skipped a managed vector database (Bedrock Knowledge Bases with OpenSearch Serverless has no meaningful free tier and is overkill for one document) and instead wrote a small ingestion script that chunks the CQC PDF, embeds each chunk with Amazon Titan Text Embeddings V2, and stores the vectors in a local FAISS index that gets uploaded to S3. The running app downloads that index once on startup and does similarity search in-process — no extra infrastructure, near-zero cost.
The biggest design decision was the prompt for the answer step: the system prompt instructs Nova Lite to answer strictly from the retrieved excerpts, cite which excerpt it used, and explicitly say when the policy doesn't cover the question rather than filling the gap with a generic answer. Getting an LLM to admit "I don't know" reliably took more prompt iteration than I expected — the first version confidently answered questions with no real basis in the retrieved text.
I also kept the same clean separation I used in my last Builder Center build:  bedrock_service.py  holds every line of AWS/Boto3 logic, and  app.py  is a pure Streamlit UI that only calls functions from that module. It made testing the retrieval and generation logic possible without touching the UI at all, and it's the pattern I'd recommend to anyone building an AWS-backed Streamlit app.
AWS Services Used
Four services, each doing one job:
  • Amazon S3 stores the FAISS vector index built from the policy PDF.
  • Amazon Bedrock (Titan Text Embeddings V2 + Amazon Nova Lite) handles embedding and answer generation.
  • Amazon EC2 (t3.micro, Free Tier) hosts the Streamlit app as a systemd service, reachable on port 8501.
  • Amazon DynamoDB logs every question and answer for the session history panel, on-demand billing.
Flow: a staff member opens the app in a browser → EC2 embeds their question via Titan → searches the FAISS index pulled from S3 → sends the top matching excerpts to Nova Lite → Nova Lite returns a cited answer → the exchange is logged to DynamoDB.
What I learned
Getting an LLM to reliably say "the policy doesn't cover this" is a genuinely different prompting problem than getting it to answer well — it required explicit instructions and a lower temperature, not just "be accurate." I also learned that skipping a managed vector store in favor of a single-file FAISS index pulled from S3 is a perfectly legitimate architecture for a small, slow-changing document set — it's faster to build, costs almost nothing, and is easy to explain in an article like this one. For a bigger or faster-changing knowledge base I'd reach for a proper Bedrock Knowledge Base instead.
Link to the App
Link to my Git Repo
Any opinions in this article are those of the individual author and may not reflect the opinions of AWS.
Enjoyed reading this content? Let the author know!

Your likes, comments, shares, and saves help creators reach more builders.

Loading recommendations

Loading article