Analysis updated 2026-05-18
Build a retrieval-augmented question answering agent over a legal document corpus.
Set up an automated loop that improves retrieval quality until it hits a recall target.
Learn how to combine LangGraph, OpenSearch, and an evaluation platform like Arize.
Use as a workshop template for building a self-improving RAG system in another domain.
| seanlee10/ai-engineer-singapore-2026-real-agent-workshop | 0xbebis/hyperpay | alfredxw/nova | |
|---|---|---|---|
| Stars | 14 | 14 | 14 |
| Language | TypeScript | TypeScript | TypeScript |
| Setup difficulty | hard | hard | moderate |
| Complexity | 4/5 | 5/5 | 3/5 |
| Audience | developer | developer | writer |
Figures from each repo's GitHub metadata at analysis time.
Requires Docker, an Arize account, and OpenAI or Anthropic API keys before the self-improvement loop can run.
This is a workshop repository demonstrating a self-improving AI question answering system built for legal research. The specific use case is answering questions from a Victorian bench book, a reference guide used in legal proceedings. The system combines two ideas: retrieval augmented generation, where the AI fetches relevant document passages before generating an answer, and an autonomous improvement loop that automatically tunes the system until it reaches accuracy targets. The architecture has three parts. First, a LangGraph based agent accepts a question, searches an OpenSearch database for the most relevant legal passages using a semantic search technique called kNN, then passes those passages to a language model to generate a plain language answer. Second, an indexing pipeline processes the legal corpus, splits it into chunks, converts each chunk into a numerical embedding, and stores the results in OpenSearch. Third, an autonomous improvement agent called Ralph runs a loop: it picks a failing quality target from a requirements document, modifies the retrieval or indexing code, runs tests and linting, then measures recall metrics using the Arize evaluation platform. If the recall target of reaching 80 percent for the top 5 results is not met, Ralph generates new improvement tasks and tries again until targets are met or a maximum iteration count is reached. The system is built in Python, uses the uv package manager, runs OpenSearch locally via Docker, and requires API keys for OpenAI, for embeddings and answering, and Arize, for evaluation. The repository was created for the AI Engineer Singapore 2026 workshop.
A workshop project showing a legal question answering AI that tests itself and automatically improves its own retrieval accuracy.
Mainly TypeScript. The stack also includes Python, LangGraph, OpenSearch.
No license information is provided in the README.
Setup difficulty is rated hard, with roughly 1h+ to a first successful run.
Mainly developer.
This repo across BitVibe Labs
Verify against the repo before relying on details.