Inspiration

A lot of AI answers look convincing even when the sources are weak, repeated, or do not actually support the answer. I wanted to build something that makes the research process easier to understand instead of just giving someone a big paragraph and some links.

The idea for ClearLens came from thinking about how people research things online for school, health, or important decisions. It is hard to tell which sources are independent and which ones are basically repeating the same information. I wanted ClearLens to help with that.

What it does

ClearLens takes a research question and turns the answer into an evidence graph. It separates the answer into smaller claims and shows which sources support, contradict, or qualify each claim.

It also has a separate skeptic research pass. This means it does not only look for information that agrees with the first answer. It also searches for limitations, counterexamples, and missing evidence. Claims can end up as SUPPORTED, CONTRADICTED, MIXED, or UNCERTAIN.

Users can click on claims and sources to inspect them, see excerpts, view source relationships, and open a final report with citations. The project also saves research sessions so the results do not disappear after refreshing the page.

How I built it

I built the backend with Node.js and JavaScript ES modules, without a big frontend framework. The frontend is a responsive HTML, CSS, and JavaScript app.

For live research, ClearLens runs Pi with the pi-web-access extension and uses its web search tools. The Pi workers have different roles, including a researcher and a skeptic. Their output has to follow a strict JSON format before it can be saved.

I made source grounding a big part of the system. A source and its excerpt must come from successful retrieved web content, and citations that cannot be verified are rejected. Sessions, sources, claims, graph edges, and events are stored as JSON files. I also created fixture support and automated tests so the rest of the app can be tested without depending on the internet every time.

Challenges I ran into

One of the hardest parts was making sure the AI could not just make up a citation or attach a quote to the wrong source. We had to validate URLs, excerpts, claims, relationships, and assessments very carefully.

Another challenge was figuring out how Pi and the web-search extension return results. Search results and downloaded page content use different IDs, and content can be fetched in the background. Sometimes a page also returned an error or took a long time to load. We had to make the app fail safely instead of saving information that was not actually retrieved.

We also had to keep the interface useful while research was happening. The progress updates, graph, inspectors, report view, mobile layout, and refresh behavior all needed to continue working while the backend was running research in the background.

Accomplishments that I'm proud of

I'm proud that ClearLens does more than produce a normal AI answer. It shows the reasoning structure behind the answer without saving private chain-of-thought. The evidence graph makes it possible to see how claims and sources connect.

I'm also proud of the separate skeptic pass. It is easy for an AI system to only collect information that agrees with its first idea, so having a role specifically looking for problems makes the results more honest.

The project has a polished responsive interface, source and claim inspectors, reports, persistence, fixture support, and 28 passing automated tests. It also fails closed when Pi, authentication, web search, or source retrieval is not working instead of pretending that a result is real.

What I learned

I learned that using AI for research is not just about getting a good answer. The harder part is checking where every important statement came from and being honest about uncertainty.

I also learned that source quality and source independence are different things. Five websites can look like five sources while all copying the same original article. Tracking relationships between sources makes the evidence much more useful.

On the technical side, I learned a lot about subprocesses, JSONL event streams, async research, persistence, validation, and building a frontend that updates while work is still happening.

What's next for ClearLens

Next, I want to make live source retrieval more reliable and faster, especially when websites block automated requests or take a long time to respond. We also want to add more ways to compare sources, better explanations for evidence-strength scores, and exportable reports.

We would like to support more research types, such as comparing products, checking scientific claims, and helping students understand controversial topics. Eventually, ClearLens could also let users bring their own documents and compare them with web evidence.

The main goal is to keep making ClearLens a tool that helps people question AI answers instead of blindly trusting them.

Built With

Share this project:

Updates

Submission history