AWS Builder Center
Prompt Vault AI - A production-shaped, weekend-sized AI app on the AWS Free Tier

Prompt Vault AI - A production-shaped, weekend-sized AI app on the AWS Free Tier

Paste a prompt, and Amazon Bedrock returns a title, summary, category, tags, a 0–100 quality score, and improvement suggestions, then find any prompt later with natural-language search. The whole thing is serverless, runs on the AWS Free Tier, and is small enough to read in an afternoon.

Series: AWS Projects (1 article)

  1. 1
    Prompt Vault AI - A production-shaped, weekend-sized AI app on the AWS Free Tier This article
Remember the perfect prompt you wrote? Well, you can start saving it before you lose it again.
Paste a prompt, and Amazon Bedrock returns a title, summary, category, tags, a 0–100 quality score, and improvement suggestions, then find any prompt later with natural-language search. The whole thing is serverless, runs on the AWS Free Tier, and is small enough to read in an afternoon.
This is a build log: the problem, the decisions, the architecture as it was actually deployed, and the honest rough edges. If you want the code, it's all in this repo   backend/  ,   frontend/  , and   infrastructure/  .



The problem

If you work with LLMs, you accumulate prompts the way a photographer accumulates RAW files: fast, everywhere, and impossible to find later. They live in Notion pages, Slack DMs,  .txt  files on the desktop, and the scroll-back of a dozen chat windows. A month later you know you wrote a great code-review prompt, but you can't find it, so you rewrite a worse one.
Three things are missing from the usual "paste it in a notes app" approach:
  1. Structure. A prompt is more than a blob of text. It has an intent, a domain, a quality level, and reusable tags but nobody hand-labels their prompts.
  1. Judgment. Is this prompt actually any good? Where is it vague? Most people can't tell at a glance, and won't stop to grade every prompt they save.
  1. Recall by meaning. "Find my prompt about reviewing Python for security bugs" is a semantic query.  Ctrl-F  over a notes app matches words, not meaning.
Prompt Vault AI exists to make saving a prompt cost one paste, and getting it back cost one plain-English sentence.



Why build it (and why build it this way)

The feature idea is small. The interesting constraint is the shape: a production-looking app that a single person can build in a weekend and run for roughly the price of a coffee per month.
That constraint is deliberate. It forces every "grown-up" decision, clean layering, least-privilege IAM, graceful degradation, infrastructure-as-code, while banning every expensive one. So the self-imposed rules were:
  • Serverless only. No EC2, ECS, RDS, OpenSearch, or a vector database. Everything scales to zero and costs nothing at idle.
  • AWS Free Tier as the budget. The only pay-per-use component is the LLM, and even that is kept to fractions of a cent per call.
  • Real engineering, not a toy. Server-side validation, structured errors, a repository abstraction, unit-testable services, and IaC, the things you'd be embarrassed to skip in a real system, done at small scale.
The payoff of the "no vector DB" rule is worth calling out: semantic search without an embeddings store is not just cheaper, it's less to operate. More on how that works below.



How it's built

The backend is a single FastAPI application following a clean-architecture split, so the business logic never touches a cloud SDK directly:
routes → services → ports (repository / AI) → adapters (DynamoDB / Bedrock)
  • Ports are the  PromptRepository  and the AI  LLMClient  protocols. Each has a real adapter (DynamoDB, Bedrock) and a fake (in-memory, offline stub).
That last point is what makes the app runnable and fully testable with zero cloud setup. The test suite forces  PV_REPOSITORY_BACKEND=memory  and  PV_AI_BACKEND=stub , so 18 tests exercise services, the AI layer, and the HTTP API with no AWS credentials and no network. You can run the entire app locally the same way and only reach for AWS when you want real Bedrock output.
The whole FastAPI app is then wrapped by Mangum and dropped into a single Lambda, a "Lambdalith." One function, one IAM role, one cold-start path, and the exact same code runs under Uvicorn locally and on Lambda in production.

Analysis that never fails the request

The AI layer is where "production-shaped" earns its keep. An LLM call can time out, return prose instead of JSON, wrap its JSON in markdown fences, or emit a trailing comma. If any of those broke prompt creation, the app would feel broken. So the analyzer degrades gracefully at every step:
The pipeline is a chain of narrowing failures:
  1. Bedrock:  InvokeModel  with a short prompt, capped  max_tokens , low temperature, and up to two retries with exponential backoff.
  1. JSON repair: strip markdown fences, isolate the outermost object, fix trailing commas, recovers messy-but-valid output without a second model call.
  1. Validate: coerce types, force  category  into a known enum, clamp the quality score to 0–100, cap tag/suggestion counts.
  1. Branch. Valid → a structured  Analysis  with  status: ok . Anything else, a Bedrock exception, unparseable text, or an empty result, falls through to a heuristic fallback (keyword-based tags, a length-derived score) with  status: fallback .
The key invariant: the request always returns a  Prompt . Whether the AI was reachable only changes the labels and a status pill in the UI, never whether your prompt got saved.

Semantic search without a vector database

Natural-language search runs in two cheap stages, no embeddings store required:
  1. Lexical prefilter: over all prompts (demo-scale data volume) keyword overlap (Jaccard) blended with a bag-of-words cosine, to pull a small candidate pool.
  1. Bedrock re-rank: hand the top candidates to the model with the query and let it order them by meaning, returning a relevance score and a one-line reason.
If Bedrock is unavailable or returns junk, the lexical order stands. You get meaning-aware results that gracefully degrade to keyword results, and you never provision, pay for, or operate a vector database.
The same "no embeddings" spirit powers duplicate detection: a keyword-Jaccard similarity flags a new prompt as a likely duplicate of an existing one, right in the UI.



The architecture, as deployed

Here's exactly how it runs in AWS today, one Lambda fronting DynamoDB and Bedrock, with the static site served from S3 through CloudFront.
Every request takes one of two paths:
  • Static assets: the browser loads the React SPA from CloudFront, which reads a private S3 bucket via Origin Access Control (the bucket blocks all public access; only CloudFront can read it). SPA deep links work because CloudFront rewrites 403/404 to  index.html .
  • Dynamic  /api/*:  the browser hits an API Gateway HTTP API, which proxies every route to the single Lambda. The Lambda does all request handling and orchestrates DynamoDB (a single-table design, on-demand billing, point-in-time recovery) and Amazon Bedrock for analysis and ranking.
IAM is least-privilege by construction: DynamoDB CRUD scoped to the one table, and  bedrock:InvokeModel  scoped to exactly the model the app uses, no wildcards.

A real deployment gotcha: the model moved

The app was originally written for  anthropic.claude-3-haiku-20240307-v1:0 . By deploy day, AWS had marked that model Legacy and blocked new on-demand use, and, more broadly, current Anthropic models on Bedrock no longer allow direct on-demand invocation at all. They require a cross-region inference profile.
Two things had to change, neither visible from the application code:
  1. Invocation now goes through the profile  us.anthropic.claude-haiku-4-5-20251001-v1:0  (Claude Haiku 4.5).
  1. IAM must grant  bedrock:InvokeModel  on the inference-profile ARN and the underlying foundation-model ARN in each US region the profile can route to ( us-east-1 ,  us-east-2 ,  us-west-2 ).
The lesson: model availability is account and region state, not something your code or your template can assume. A five-second test invocation before deploying saved a much more confusing debugging session after.



Tech stack

Layer
Choices
Frontend
React 18 · Vite 5 · TypeScript · TailwindCSS 3, a six-view SPA with loading/error/empty states and toasts
Backend
FastAPI · Pydantic v2 · Mangum · boto3 · Python 3.12, clean-architecture layering
AI
Amazon Bedrock Claude Haiku 4.5 via a cross-region inference profile
Data
DynamoDB (single-table, on-demand)
Edge / hosting
S3 (private) + CloudFront (OAC) for the SPA; API Gateway HTTP API for the API
IaC / deploy
AWS SAM ( sam build  /  sam deploy ), least-privilege IAM
Design
Cobalt Grid: a strictly two-color (cream + cobalt), flat, squared, graph-paper design system (the visual language of this very blog)
A note on that last row: the UI enforces a genuinely constrained design system, two hues, no rounded corners, no shadows, no third color for "success/error." Status is communicated by weight, fill, and labels instead. It's a fun constraint that keeps the interface coherent, and it's documented in   docs/DESIGN_SYSTEM.md  . (Every image in this post is rendered from that same system.)



What it costs

Only Bedrock is pay-per-use; everything else sits inside always-free or 12-month Free Tier allowances at this scale.
  • Bedrock (Claude Haiku 4.5) ≈ $1 / $5 per million input / output tokens → roughly $0.002 per analysis or search.
  • Realistic personal use: ~$1–2 / month, essentially just Bedrock tokens plus a few cents of point-in-time-recovery storage.
  • Lambda, API Gateway, DynamoDB, S3, CloudFront: effectively $0 at demo traffic.
The one honest caveat, stated plainly: the API is public and unauthenticated by design (single demo user), and every call invokes Bedrock. That's fine when you're the only caller; before treating a public deployment as "real," add a budget alarm and basic throttling (an API key or usage plan). The cost math is trivial until the internet finds your endpoint.



Things worth stealing for your own build

  • Two adapters per port. A real one and a fake one for every external dependency turns "needs the cloud to run" into "runs anywhere, tests in milliseconds."
  • Degrade, don't fail. For any AI feature, decide up front what the worst acceptable output is (here: heuristic labels) and make the unhappy path return that, not an error.
  • Test the model path before you deploy the model. Availability drifts. A tiny live invocation is the cheapest possible smoke test.
  • Least-privilege from line one. Scoping IAM to a single table and a single model is barely more work than a wildcard and saves you from ever explaining a breach.
  • Constraints make design. "Two colors, no shadows, no circles" produced a more coherent UI than an open-ended palette would have.



Try it

  • Run it locally in five minutes, no AWS account needed, the backend ships with an in-memory repository and an offline analysis stub. See the  README quick start .
  • Deploy your own,   infrastructure/DEPLOYMENT.md   walks the full  sam build && sam deploy  path, including the Bedrock inference-profile setup. The as-deployed architecture is documented in the  README .
If you build on it, the most valuable contribution isn't a feature it's the guardrail: wire up an AWS Budgets alarm and API throttling, and turn the "weekend demo" into something you'd leave running.
Fork it, deploy it, and tell me what you'd change.

Series: AWS Projects (1 article)

  1. 1
    Prompt Vault AI - A production-shaped, weekend-sized AI app on the AWS Free Tier This article
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