Tee Lakkhananukun · Bangkok
All work

EnvSearch

An answer is more useful when you can find the page behind it

EnvSearch is my public English and Thai retrieval project: questions over environmental regulations, answers with page-level citations, and an evaluation set that checks when the system should answer or refuse.

Es · EnvSearch: all pages
  1. Overview

When a document is long and unfamiliar, finding a relevant paragraph can take more effort than reading it. A search tool can help, but a generated answer introduces another question: does the source actually support what it says? For this project, I wanted the answer and the evidence to remain close enough that someone could check them together.

I built EnvSearch around US EPA and Thai industrial-waste regulations, with questions and answers in English and Thai. You can ask a question, read an answer generated by Claude and follow the citations to the exact pages used to support it. I also wanted a way to check how the system behaves when the documents do not contain the answer.

Finding the passage before writing the answer

I use two ways of searching together. BM25 is a keyword method that helps find specific terms, while multilingual embeddings represent meaning in a form the system can compare across English and Thai. Together, they help find passages even when the question uses different wording from the document.

A second model then compares those candidate passages with the question and puts the most relevant ones first. This step, called reranking, helps decide which passages Claude receives as evidence for its answer.

That separation is useful when investigating a disappointing result. If the relevant passage never reaches the candidate set, changing the answer prompt will not fix the missing evidence. If retrieval succeeds but the answer misrepresents the passage, the next investigation belongs later in the process.

The same distinction matters in my quotation work, although the decisions are different. In QT, the question may be whether a product’s grade and pack match a customer’s request. In EnvSearch, it is whether a retrieved passage supports a statement and whether the reader can locate that support in the original document.

Making the source part of the response

Claude produces answers with citations to the relevant pages. That gives the reader a practical next step: inspect the source rather than accept a fluent summary on its own. A citation is useful evidence to examine, rather than a guarantee that an interpretation is correct.

The English and Thai scope also makes this more than a demonstration built around one convenient style of question. The retrieval has to work across the languages represented in the project, while keeping the answer attached to the documents that support it. A question being easy to phrase does not mean the indexed material contains enough evidence to answer it.

Giving evaluation a visible place in the project

I put together a gold set of 24 questions with expected results, then used code to check retrieval, citations and refusals against it. A refusal matters because a system that always produces an answer can look helpful even when the required evidence is absent. Testing that boundary gives the project a more meaningful standard than whether each response sounds convincing.

Twenty-four questions give me a starting point for catching regressions, though they leave plenty of situations to explore. As the project grows, I would add cases that expose where the search misses evidence or where an answer goes further than the source allows.

Using the same capability through Claude Desktop

The MCP server exposes four tools to Claude Desktop. MCP, or Model Context Protocol, provides a way for an AI application to access tools through a defined interface. That makes the document-search capability available within another workflow, alongside the project’s own demonstration.

Much of my other work runs inside the business, so I wanted to share a project you could explore for yourself. The code and demo below let you follow these decisions from the search through to the answer and its sources.

Explore the source code or open the demo. For the business context, the QT retrieval walkthrough explores why a similar chemical product can still be the wrong match.