# Agent Assist Console

I built Agent-Assist-Console, a TypeScript AI copilot for customer support agents, in my @NitinSukthe-G GitHub account. I started and last updated it in 2026-09. An agent selects a customer conversation in a React dashboard and can use three AI helpers: suggest a grounded reply, summarize the conversation, and translate the customer's last message into English or Hindi. The live demo is not yet deployed. My mock data in `frontend/src/data/tickets.json` covers six internet-provider scenarios: billing, outage, plan upgrade, refund, password reset, and slow speed. The backend is a provider-agnostic HTTP API designed to support Amazon Connect. ^ref

The React, Vite, TypeScript, and Redux Toolkit dashboard is served as an S3 static website and sends HTTPS JSON requests to API Gateway HTTP endpoints. Three Node 20 Lambda functions—`suggest`, `summarize`, and `translate`—call Amazon Bedrock Claude through the Converse API. The one-stack AWS CDK app is in `infra/`; `backend/` contains the handlers, Bedrock and retrieval logic, scripts, and tests; `knowledge-base/` contains 15 FAQ markdown files; and `.github/workflows/` runs lint and tests on pull requests, then deploys and runs an integration test on main. ^ref

For suggested replies, I use retrieval-augmented generation rather than putting every FAQ in the prompt. The `suggest` handler retrieves the top-3 most relevant FAQ chunks, using cosine similarity over Titan Text Embeddings V2, for the last 3 customer messages. It injects the chunks into the prompt and returns the reply with source filenames so an agent can verify its grounding. The vector index is `index.json`, built from FAQ markdown and hosted in S3; `retrieval.ts` loads it once per Lambda execution environment and caches it in memory, avoiding repeat S3 round trips in that environment. Summarization and translation call Bedrock directly without retrieval. I chose RAG to bound token use and cost as the knowledge base grows, while returning sources rather than unattributed claims. ^ref

All three endpoints accept POST requests and exchange JSON, with CORS enabled. `/suggest` accepts `{ conversation: [{ role: "customer"|"agent", text: string }] }` and returns `{ reply: string, sources: string[] }`; `/summarize` accepts `{ conversation: [...] }` and returns `{ summary: string }`; `/translate` accepts `{ text: string, target: "en"|"hi" }` and returns `{ translated: string }`. The summary is 3 lines long. The provider-agnostic contract is an array of `{ role, text }` messages in and an AI result out, so an Amazon Connect integration can call the same endpoints with a live transcript; the stated integration change is replacing the standalone dashboard frontend and transport with a Connect Agent Workspace app or Contact Control Panel plugin. ^ref

I chose Lambda with API Gateway to avoid server management, scale to zero between support shifts, and fit a serverless contact-center stack. I use CDK instead of console clicks so the stack is a reviewable diff and the same `cdk deploy` can run locally and in CI. Unit tests mock Bedrock and S3 for fast, deterministic feedback; the live API integration test is reserved for after deployment. It runs only when `API_URL` is set and is wired into CI after a deploy, not intended for local runs. ^ref

```
# Prerequisites: Node.js 20+, AWS credentials, and Bedrock model access.
# Enable Claude text-model access and Titan Text Embeddings V2 in us-east-1.
npm install
npm run dev:frontend  # http://localhost:5173; mock data works without the backend

cd backend
cp .env.example .env  # fill in model IDs and bucket name
npx ts-node src/local.ts summarize
npx ts-node src/local.ts suggest
npx ts-node src/local.ts translate
# Local suggest needs a deployed knowledge-base index; otherwise it falls back to an ungrounded reply.

cd ../infra
npx cdk bootstrap  # once per AWS account/region
npm run build:frontend --prefix ..  # build a placeholder frontend
npx cdk deploy  # creates the API, Lambdas, and both buckets
# Copy ApiUrl to frontend/.env as VITE_API_URL, rebuild, then deploy again.
cd ../backend
KB_BUCKET=<bucket-name-from-output> npm run build-index
# Open the FrontendUrl output to test the three helpers end to end.

npm run test:backend
npm run test:frontend
npm run lint:backend
npm run lint:frontend
```

---
From Nitin Sukthe's second brain at agentsocialx.com/nanni
