Portfolio RAG Chatbot

Explore my work through AI-powered conversations

RAG-Powered Portfolio Assistant
An AI chatbot that knows my professional journey inside and out

A retrieval pipeline built end to end rather than assembled from a managed service: document chunking, Titan embeddings, OpenSearch k-NN search with cosine re-ranking, and grounded generation by Claude Haiku 4.5 on Amazon Bedrock, with citations back to every source document.

It started as a managed Bedrock Knowledge Base. Sixty-one hours of billing exposed a projected ~$350/month run rate, so I rearchitected it onto a hand-built pipeline — avoiding roughly $4,200/year in projected cost and landing at ~$26–30/month.

Technology Stack

Next.js 15
TypeScript
AWS Lambda
Amazon Bedrock
Claude Haiku 4.5
Titan Embeddings
OpenSearch
DynamoDB
Cognito
AWS CDK

Serverless Architecture

Lambda Function URLs instead of API Gateway

Hallucination Safeguards

Answers stay grounded in retrieved text and cite it

Production Security

Cognito JWT verified server-side, 20 queries/user/day

k-NN + Re-ranking

OpenSearch k-NN retrieval, re-ranked by cosine similarity

RAG system architectureQuery path: the browser sends a question with a Cognito ID token to the Next.js /api/chat route, which verifies the JWT signature and forwards only a user-context header to the Enhanced RAG Lambda over a Lambda Function URL. That Lambda checks a DynamoDB rate limit, calls a vector-search Lambda that runs a k-NN query against OpenSearch and re-ranks the hits by cosine similarity, then sends the grounded prompt to Claude Haiku 4.5 on Amazon Bedrock. Ingest path, shown dashed because it is run manually rather than managed by CDK: markdown in an S3 corpus bucket is chunked, embedded with Amazon Titan, and indexed into the same OpenSearch domain.QUERY PATHINGEST PATH — RUN MANUALLY, NOT CDK-MANAGEDID tokenFunction URLno API Gatewaygrounded promptBrowserNext.js 15 on Vercel/api/chatverifies JWT, strips authEnhanced RAG LambdaorchestratorAmazon BedrockClaude Haiku 4.5DynamoDB20 queries/user/dayVector Search Lambdak-NN + cosine re-rankOpenSearchES 7.10, 1x t3.smallS3 corpusdocs/ markdownIngest pipelinechunk, Titan embed, index
Engineering Achievement

Serves the RAG API through Lambda Function URLs instead of API Gateway, removing per-request gateway cost and keeping the request path simple.

About This Portfolio Chatbot

This AI-powered chatbot can answer questions about my projects, skills, and AI workflow methodology. It uses Retrieval-Augmented Generation (RAG) to provide accurate, contextual responses based on my portfolio content.

Frontend

  • Next.js 15 App Router + TypeScript
  • Tailwind CSS + shadcn/ui
  • Cognito auth, JWT verified server-side

Models

  • Claude Haiku 4.5 on Amazon Bedrock
  • Amazon Titan text embeddings
  • Model pinned server-side, not client-selectable

Retrieval

  • OpenSearch k-NN, cosine re-ranking
  • Answers cite their source documents
  • Degrades visibly instead of guessing

Created by Simon Cheam