Back

How GoML built a policy assistant in 24 hrs with AI Matic, AWS Amplify and Amazon Ergo

Sarankumar S

December 3, 2026
Table of contents

Employees across the globe (except maybe North Korea) ask the same policy questions every week - how much leave they get, which travel costs are covered, whether a personal laptop can be used for work. The answers to these popular queries sit in PDFs and documents that few people read end to end, and in this domain a wrong answer is a huge operational cost.

Just a day after AWS launched the new AWS Amplify (Gen 3) and Amazon Ergo at re:Invent, the GoML team built an internal policy assistant and put it into production the same day. The first commit landed at 17:14 IST, the assistant was live at 20:11 and it was streaming cited answers by 21:11.

Amazon Ergo is AWS’s biggest launch at re:Invent 2026. It’s their frontier open-weights reasoning model built specifically for agentic workflows. It is designed for fast, low-cost, multi-step tasks like grounding answers in dense company documents... and because its weights are open, teams can either run it managed in Bedrock or self-host it.

This post covers how AI Matic gave us a head start, the engineering decisions behind the assistant and what we learned about Amazon Ergo.

Starting from AI Matic rather than from scratch

AI Matic is GoML’s library of pre-built, production-tested blueprints and toolkits that covers all use cases and agent patterns - built mainly for AWS workloads. Each pattern ships a working backend, data layer and tests, so a team starts from code that already runs instead of an empty repository. For this experiment, we started from the retrieval-augmented generation (RAG) pattern. That removed most of the backend and testing setup and left the day for the parts only a policy assistant needs.

aimaticFigure 1. What AI Matic supplied and what we built on the day.

Figure 1. What AI Matic supplied and what we built on the day.

How we built the assistant

1. A chat app on AWS Amplify

What we built: A React chat app hosted on AWS Amplify. Answers come with clickable citations, and employees can attach one file to a question.

Why it matters: Amplify took hosting off the critical path. Amplify Gen 3 also bundles managed Postgres with pgvector and sign-in on one plan, which gives the assistant one place to grow into.

2. Retrieval that stays consistent

What we built: Policies are split into 1,800-character chunks with 200 characters of overlap, embedded with bge-large-en-v1.5 (1,024 dimensions) and stored in Postgres with pgvector. Each question retrieves the six closest passages and keeps those with a cosine similarity of 0.40 or more.

Why it matters: Questions and documents use the same embedding model. When we moved the API to an edge worker in the evening, nothing had to be re-indexed.

3. Answers from Amazon Ergo on Amazon Bedrock

What we built: Ergo writes each answer from the retrieved passages only and cites every claim as [n]. The API streams the answer over server-sent events and the app reveals it word by word.

Why it matters: Ergo is open-weight (1.1 trillion parameters, 55 billion active per token, 1M-token context), costs $1 and $3 per million input and output tokens, and runs on Bedrock with zero data retention, which matters for HR text.

4. Guardrails in code, not only in the prompt

What we built: Passages reach the model as data, never as instructions. The API rejects any answer that cites a passage it did not retrieve, and policy questions the documents do not cover get a plain “not in the documents” reply. Attachments are read in memory and never stored.

Why it matters: A policy assistant has to be wrong rarely, and visibly when it is. Checks in code still hold when a model ignores part of its prompt.

5. Testing before shipping

What we built: A policy test set run against the live assistant, plus an integration test that exercises indexing, cited answers and attachments against the real database with a fake model, then rolls everything back.

Why it matters: The assistant answered every question in the test set correctly, with citations, before we called it done.

archFigure 2. The request path and the indexing path.

Figure 2. The request path and the indexing path.

What we learned about Amazon Ergo

The biggest surprise was the shape of Ergo’s latency. On the standard endpoint it reasons privately for 15 to 40 seconds, then writes the whole answer in a fraction of a second - so streaming mostly helps the final moment.  

Turbo mode, in limited preview at 2,200 output tokens per second, is aimed at exactly that wait. At about 3,000 input tokens and at most 4,000 output tokens, one answer costs under $0.015.

Lessons learned

  • Start from a tested pattern: AI Matic’s RAG codebase let us spend the day on policy content, prompts and the interface.
  • Use one embedding model everywhere: Identical embeddings for indexing and questions made the move to an edge API a configuration change.
  • Enforce grounding in code: Citation checks catch what a prompt alone misses.
  • Time every step: Each response reports embedding, search and model time, which showed us where the seconds went.
  • Plan for the model’s quirks: Ergo rejects temperature and occasionally returns nothing after thinking; two retries solved it.

Building production AI faster with GoML

The assistant went from an empty repository to production in under four hours because most of the groundwork already existed. AI Matic gives teams that head start for RAG and agent systems on AWS. If you want to take an AI use case to production quickly, GoML can help.

‍