AWS Builder Center

I Built an AI Memory Vault on AWS in 4 Days - Solo, from India

A solo developer's journey building Lelantos -a portable, user-owned AI memory vault powered by 7 AWS serverless services - during the Bharat Builds Tour hackathon by WeMakeDevs.

I Built an AI Memory Vault on AWS in 4 Days — Solo, Sleep-Deprived, and from a Windows Laptop in India

How a WeMakeDevs hackathon forced me to confront everything broken about AI memory — and how AWS serverless architecture became the answer I didn't know I needed.


TL;DR: I built Lelantos — a portable, user-owned AI context and memory layer running on seven AWS services — entirely solo during the Bharat Builds Tour hackathon by WeMakeDevs. This is the raw, unfiltered story of four days of broken deployments, Windows-vs-Linux nightmares, a critical Bedrock pivot at 2 AM, and the ten engineering lessons that will stick with me forever.



The Problem That Kept Me Up at Night

It started with a frustration every developer knows.
I was context-switching between Claude and ChatGPT on a freelance project. I'd spent forty minutes carefully explaining my stack to Claude — "Python backend, React frontend, ₹5,000/month budget, solo developer, deploying on AWS" — and then I opened ChatGPT to get a second opinion on a database schema.
ChatGPT had no idea who I was. Zero memory. Blank slate.
So I typed everything again. Every constraint. Every decision. Every preference I'd already articulated. Forty minutes of my life, duplicated into the void. And when I opened a new Claude conversation the next morning? Same amnesia. Again.
That's when the question crystallized:
Why does the AI change, but my context has to go with it?
Your preferences, your architectural decisions, your budget constraints, your project requirements — these are yours. They shouldn't evaporate when you close a browser tab or switch to a different model. They should persist, structured, versioned, and completely under your control.
When the Bharat Builds Tour by WeMakeDevs was announced — an AWS-focused hackathon pushing builders across India to ship real cloud-native products — I knew exactly what I was going to build.
I was going to fix AI memory. On AWS. Alone.



Day 1 (Thursday): AWS Foundation — and the First Wall

The Clock Starts. Confidence is High.

I kicked off the hackathon with a clear mental architecture: Amazon Cognito for authentication, DynamoDB for persistence, Lambda for serverless compute, API Gateway for routing, and Amazon Bedrock to invoke Meta's Llama 3.1 70B for the intelligence layer. Clean, cloud-native, enterprise-grade. Seven AWS services working in concert.
I spent the first hours wrestling IAM policies into least-privilege configurations. If you've never done this on a fresh AWS account, imagine trying to unlock a door with a keyring of 200 nearly-identical keys — except every wrong key logs a cryptic error message that sounds like it was written by a lawyer.
Then I provisioned DynamoDB.
I chose single-table design — one table ( LelantosTable ) storing users, memories, conversations, and timeline events, all differentiated by composite partition keys ( PK = USER#<user_id> ,  SK = MEMORY#<memory_id> ). The NoSQL purist in me loved the elegance. The sleep-deprived developer in me questioned the sanity of learning single-table patterns during a hackathon.
But when that first successful  PutItem  returned a  200  from  us-east-1 ? Dopamine. Pure dopamine.

The Wall: Bedrock Says No

Then came the first real setback.
I wrote the Bedrock integration, called  InvokeModel  with the Meta Llama cross-region inference profile, and got this:
botocore.exceptions.ClientError: An error occurred (ValidationException)when calling the InvokeModel operation: Operation not allowed
My AWS account didn't have access to the Bedrock foundation models I needed. Account tier restriction. No override. No workaround.
At 11 PM on Day 1 of a hackathon, your brain does one of two things: panic, or architect.
I chose to architect.
I made a decision that would save the entire project: I would not couple my application to any single LLM provider. I wrapped the Bedrock invocation behind a clean service interface —  invoke_llama(system_prompt, user_prompt, max_gen_len, temperature)  — and built a local mock fallback ( DEMO_MODE ) so I could keep developing the rest of the system while I figured out the inference layer.
That abstraction boundary would prove to be the most important engineering decision of the entire hackathon.

Day 1 Wins

  • ✅ Live DynamoDB table in  us-east-1 
  • ✅ Single-table schema designed and validated
  • ✅ IAM least-privilege policies configured
  • ✅ LLM service boundary abstracted (critical)
  • ✅  DEMO_MODE  fallback for unblocked local development

Day 1 Lesson

Build provider abstractions at your boundaries. An infrastructure or vendor issue should never require rewiring your core application logic.



Day 2 (Friday): The Memory Engine — Where the Magic Lives

Building Intelligence, Not Just Storage

Day 2 was the intellectual core of the build. I wasn't building a simple key-value store for chat logs. I was building a structured, versioned, conflict-aware memory engine — the kind of system that treats AI context like a first-class data type.
Here's what makes Lelantos different from "just saving chat history":
1. Nine structured memory types. Every fact extracted from a conversation is categorized:  IDENTITY ,  PREFERENCE ,  CONSTRAINT ,  PROJECT ,  GOAL ,  DECISION ,  FACT ,  RELATIONSHIP ,  TEMPORARY . This isn't cosmetic — it's functional. When you ask Lelantos "What framework am I using?", it doesn't dump your entire life story into the prompt. It retrieves only the relevant  PREFERENCE  and  DECISION  records.
2. Fixed Key Vocabulary. LLMs are creative. Too creative. One day a model extracts  programming_language , the next day  coding_lang , the next  main_language . Same concept, three different keys. Lelantos enforces a curated dictionary per memory type:
CONSTRAINT → budget, timeline, tech_constraint, team_sizeDECISION → backend, frontend, database, hosting, auth_providerPREFERENCE → language, framework, style, communication_style
This eliminates key drift entirely. Deterministic, predictable, queryable.
3. Full Provenance. Every memory stores exactly where it came from: the verbatim user message, the conversation ID, the timestamp, the extraction model, and a calibrated confidence score. Users can click any memory and ask "Why did you remember this?" — and get a real, auditable answer.
4. Non-destructive Conflict Resolution. When a user says "We're using Python for the backend" on Monday and then "Actually, we've switched to Node.js" on Thursday, Lelantos doesn't hallucinate both facts. It doesn't silently overwrite history. It detects the conflict on  (user_id, DECISION, backend) , transitions Python to  REPLACED  status, persists Node.js as  ACTIVE , and increments the version counter. The full decision timeline is preserved.

The Dual-Branch Architecture

I designed the chat pipeline as a concurrent dual-branch system:
USER MESSAGE │ ▼ Verify JWT │ ├──── WORKER BRANCH (fast) ─── Generate AI response ─── Return to user │ └──── MEMORY BRANCH (background) ─── Extract memories ─── Detect conflicts ─── Version & persist to DynamoDB
Both branches execute simultaneously using Python's  asyncio  with a thread pool executor. The user gets their chat response instantly. The memory extraction, conflict detection, and DynamoDB persistence happen in parallel, completely non-blocking.
This was non-trivial to implement correctly — race conditions on shared state, proper error isolation so a memory extraction failure doesn't crash the chat response, and ensuring the combined payload returns cleanly to the frontend. But when it worked? It felt like magic.

The JSON Repair War

Here's a truth nobody warns you about when building LLM-powered pipelines: LLM output is untrusted input.
I'd prompt the model to return a clean JSON array of extracted memories. Sometimes it would obey. Sometimes it would wrap the JSON in triple-backtick markdown fences. Sometimes it would add a trailing comma after the last array element. Sometimes it would include a conversational preamble like "Sure! Here are the extracted memories:" before the JSON.
I built a defensive parsing pipeline: strip markdown fences → remove conversational preamble → attempt JSON parse → fallback regex repair for trailing commas and syntax anomalies → final parse attempt. It was ugly. It was necessary. It saved the project from silent failures dozens of times.

The Frontend Marathon

Eleven routes. Dark mode. Responsive. Zero TypeScript errors. One person.
I built the entire frontend in a single sustained development session using React 19, TanStack Router (file-based routing), Vite, and Tailwind CSS. Dashboard with stat cards. Interactive chat with live extraction indicators. Memory vault browser with type filters. Individual memory inspector with provenance panels. Chronological timeline view. Conversation archive. API documentation page. Settings with vault purge controls.
Each route was code-split. Each component was focused. The TanStack Router file-based convention kept my sanity intact — no centralized route configuration to maintain, just drop a  .tsx  file and it exists.

Day 2 Wins

  • ✅ Memory engine with 9 types, fixed vocabulary, provenance
  • ✅ Conflict detection and versioning system
  • ✅ Dual-branch concurrent chat pipeline
  • ✅ JSON repair fallback parser
  • ✅ Policy engine (5 governance rules)
  • ✅ All 11 frontend routes — production build, 0 errors

Day 2 Lesson

Structured data beats vector embeddings for precise context. Categorizing context into typed, versioned objects makes AI memory deterministic and explainable.



Day 3 (Saturday): Deployment — Where Dreams Go to Die (Temporarily)

The Windows-Linux Binary Nightmare

Saturday morning. Backend works locally. Frontend works locally. Time to deploy to AWS Lambda.
I zipped my local Python virtual environment, uploaded it to Lambda, hit the test button, and got:
ImportError: cannot import name 'pydantic_core'
My heart sank. Then I understood.
Pydantic v2 uses a Rust-compiled core extension ( pydantic-core ). The  .so  files compiled on my Windows machine were x86_64 Windows binaries. Lambda runs Amazon Linux. Binary incompatibility. My entire deployment package was useless.
The fix was elegant but non-obvious: rebuild the package using pip's cross-compilation flags:
bashpip install \ --platform manylinux2014_x86_64 \ --target=lambda-package \ --only-binary=:all: \ -r backend/requirements.txt
This pulls pre-compiled Linux wheels from PyPI regardless of the host OS. I'd never needed this flag before. I'll never forget it again.

The Missing 'requests' Module

Fresh deployment. New zip. Test Lambda again.
ModuleNotFoundError: No module named 'requests'
The  requests  library was installed in my local virtualenv but wasn't in my  requirements.txt . Locally, it worked because  requests  was a transitive dependency. In Lambda's minimal runtime, there was no ambient installation to fall back on.
Lesson burned into memory: The dependency delta between your development environment and a minimal container runtime will bite you. Audit it explicitly.

CORS: The Silent Blocker

Lambda deployed. API Gateway configured. Frontend on Amplify. I opened the browser, hit the login button, and... nothing.
DevTools console:
Cross-Origin Request Blocked: The Same Origin Policy disallows readingthe remote resource at https://xxxxx.execute-api.us-east-1.amazonaws.com
My Amplify frontend (HTTPS, Amplify domain) was making requests to API Gateway (different domain). Without explicit CORS headers allowing the Amplify origin, every single API call was silently rejected by the browser.
I configured API Gateway's CORS settings to allow  https://main.dpe2sxkj21dci.amplifyapp.com , with  Authorization  and  Content-Type  headers permitted. Redeployed. Held my breath. The login call went through.

The Bedrock Pivot — Executed in Minutes

Remember that service abstraction from Day 1? This is where it paid off.
With Bedrock still inaccessible, I pivoted the internal implementation of  invoke_llama()  to call OpenRouter (serving Meta Llama 3.3 70B Instruct) via a simple HTTP request. Same function signature. Same parameters. Same return type.
Zero application routes changed. Zero database models changed. Zero frontend components changed. The entire AWS infrastructure — Cognito, Lambda, API Gateway, DynamoDB, Amplify, IAM, CloudWatch — remained untouched. Only the internal implementation of one function in one file changed.
That abstraction boundary, designed under pressure at 11 PM on Day 1, saved the entire project.

Day 3 Wins

  • ✅ Lambda deployed with Linux-compatible binaries
  • ✅ API Gateway live with CORS configured
  • ✅ Amplify frontend deployed and serving
  • ✅ LLM provider pivoted from Bedrock to OpenRouter — zero refactoring
  • ✅ Cognito JWT verification live in production
  • ✅ User isolation tests passing

Day 3 Lesson

Local success does not equal cloud success. Runtime environments must be mirrored during packaging. And always, always build clean abstraction boundaries.



Day 4 (Sunday): The Last Mile — Where Production Polish Lives

The Cognito Confirmation Gap

Sunday morning. Everything is deployed. I test the full user journey: Sign up → ... → stuck.
Cognito created the account. Cognito sent the verification email. But my frontend had no UI to enter the verification code. Users signed up, received a 6-digit code in their inbox, and had absolutely nowhere to type it. Clicking "Login" returned:
"User is not confirmed"
An entirely avoidable production bug — but the kind you only discover when you test the complete user journey end-to-end on the actual deployed system.
I rebuilt  signup.tsx  as a two-stage state machine: the registration form submits to Cognito, then the component transitions to a verification code input view with explicit guidance — "Check your Spam/Junk folder. The email may take 30-60 seconds." I wired  confirmSignup()  through the auth context, confirmed the flow worked, and pushed.

The End-to-End Validation

Sunday afternoon. Deep breath. Full journey test on the live system:
  1. Sign Up → Cognito creates account → Email with code arrives ✅
  1. Verify → Submit 6-digit code → Account confirmed ✅
  1. Login → Cognito issues JWT → Stored in browser ✅
  1. Chat → Send message → Worker AI responds instantly ✅
  1. Memory Extraction → Background branch extracts 4 structured memories ✅
  1. DynamoDB Persistence → Memories visible in vault browser ✅
  1. Provenance → Click any memory → See exact source quote ✅
  1. Conflict Resolution → Contradict a previous statement → Versioning works ✅
  1. Timeline → Full chronological mutation history visible ✅
  1. Settings → Vault purge deletes all user data ✅
Every step. Every AWS service. Working in concert. Live on the internet.

Day 4 Wins

  • ✅ Two-stage signup verification flow
  • ✅ Complete end-to-end validation on live infrastructure
  • ✅ Clean GitHub repository push
  • ✅ Documentation finalized

Day 4 Lesson

Production polish is in the edge cases. That missing confirmation form? That "check your spam" message? Those aren't features — they're the difference between a demo and a product.



The Architecture That Emerged

After four days, here's what Lelantos looks like in production:
CLIENT LAYER ┌───────────────────────────────────────────────────┐ │ AWS Amplify Web Console │ │ React 19 • TanStack Router • Vite │ └─────────────────────────┬─────────────────────────┘ │ HTTPS / JWT │ GATEWAY LAYER ┌───────────────────────────────────────────────────┐ │ Amazon API Gateway (HTTP) │ └─────────────────────────┬─────────────────────────┘ │ COMPUTE LAYER ┌───────────────────────────────────────────────────┐ │ AWS Lambda (Python 3.12) │ │ FastAPI + Mangum ASGI Adapter │ │ ┌─────────────────────────────────────────────┐ │ │ │ Auth │ Chat │ Memory │ Context │ Conflict │ │ │ │ Svc │ Pipe │ Engine │ Retriev │ Detector │ │ │ └─────────────────────────────────────────────┘ │ └──────────────┬────────────────────┬───────────────┘ │ │ STORAGE LAYER INFERENCE LAYER ┌──────────────────────┐ ┌─────────────────────────┐ │ Amazon DynamoDB │ │ OpenRouter (Llama 70B) │ │ PK: USER#<sub> │ │ (Bedrock-ready pivot) │ └──────────────────────┘ └─────────────────────────┘ │ ┌──────────────────────┐ │ Amazon Cognito │ │ JWT Auth + JWKS │ └──────────────────────┘
Seven AWS services. Eight backend modules. Eleven frontend routes. One developer. Four days.



The Cost? Less Than a Cup of Chai.

This is the part that still blows my mind.
Service
Hackathon Cost
AWS Lambda
₹0.00
Amazon DynamoDB
₹0.00
Amazon Cognito
₹0.00
AWS Amplify
₹0.00
API Gateway
₹0.00
CloudWatch
₹0.00
OpenRouter LLM
< ₹80
Total
< ₹100 (~$1.00)
Everything runs on AWS free tiers. No idle EC2 instances. No container clusters burning credits overnight. Serverless means you pay for what you use — and during a hackathon, "what you use" is surprisingly little.
This is the economic argument for serverless that nobody makes loudly enough: it democratizes cloud-native development. A solo developer in India, building on a ₹5,000/month budget, can architect and deploy the same infrastructure patterns that enterprises use — because AWS free tiers make the starting cost effectively zero.



10 Things Building Lelantos Taught Me

  1. Cloud architecture is an application feature. IAM roles, cold starts, and tenant partitioning can't wait until "after the code works." Design for serverless early — it forces clean modularity.
  1. Provider abstraction is non-negotiable. The Bedrock → OpenRouter pivot took minutes because the LLM was behind a clean interface. If it had been directly coupled, the project would have died on Day 1.
  1. Serverless economics are unbeatable for builders. ₹0 infrastructure during development. No ops burden. No servers to patch. Just code and deploy.
  1. Structured data beats vector embeddings for precise context. RAG with vector search retrieves fuzzy text chunks. Typed, versioned memory objects ( DECISION ,  CONSTRAINT ) give you deterministic, explainable recall.
  1. LLM output is untrusted input. Never trust a model to return clean JSON. Build defensive parsers, markdown strippers, and repair fallbacks. They will save you.
  1. Provenance creates trust. When users can click "Why did you remember this?" and see the exact source quote, AI memory stops being creepy and starts being useful.
  1. Local success ≠ cloud success. My Windows-compiled  pydantic-core  crashing on Lambda was a visceral reminder: mirror your target runtime during packaging.
  1. Tenant isolation must be structural. Don't filter users in application code — enforce isolation at the database partition key.  PK = USER#<user_id>  is a security guarantee, not a convenience.
  1. Production polish lives in edge cases. The missing email verification form, the "check your spam" message — these aren't features, they're the gap between a demo and a product.
  1. Solo execution demands modularity. When you're building frontend, backend, infrastructure, and documentation alone, strict separation of concerns isn't a luxury — it's survival.



What's Next for Lelantos

The hackathon is over, but the problem isn't solved. Here's where Lelantos goes next:
  • MCP Server — Native Model Context Protocol endpoint so Claude Desktop, Cursor, and Windsurf can read/write context directly from user vaults
  • Browser Extension — Automatically capture decisions from ChatGPT and Claude web interfaces
  • Multi-Agent Memory Sharing — Team-level vaults where project constraints are shared while personal preferences stay private
  • Local LLM Mode — Ollama integration for fully offline memory extraction
  • Automated Memory Compaction — Synthesize dozens of incremental edits into concise summaries



To the WeMakeDevs Community

To Kunal Kushwaha and the WeMakeDevs team — thank you for creating the Bharat Builds Tour. This hackathon didn't just push me to ship code. It pushed me to ship cloud-native code, to think in terms of services and isolation and scalability, and to prove to myself that a solo developer from India can architect production-grade AWS infrastructure from scratch in four days.
To every developer reading this who's hesitated to build on AWS because it felt too complex or too expensive: the free tier is real, serverless is real, and the best time to start is during your next hackathon.
Your AI changes. Your context shouldn't.
Build the vault. Own your context. Ship it on AWS.


🔗 Live Demo:  https://main.dpe2sxkj21dci.amplifyapp.com/ 📦 GitHub:  https://github.com/Rayed-Hasan/Lelantos 🏗️ Built by: Rayed Hasan • Solo Developer • Bharat Builds Tour 2026 by WeMakeDevs


This blog post was written for the AWS Builder Centre as part of the Bharat Builds Tour hackathon by WeMakeDevs, September 2026.
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