AI/MLStarted 2025

CloudLens

An observable retrieval baseline over official AWS serverless documentation, with trace-linked evaluation and published success and failure metrics.

PythonFastAPIPostgreSQLpgvectorFastEmbed / BGERetrieval Evaluation
CloudLens project preview
Role
Independent AI Systems Engineer
Development Began
2025
Status
v0 Retrieval Baseline

Evidence at a Glance

100%
Answerable Recall@5

BGE small English v1.5 retrieved an expected source for all eight answerable cases in the v0 set.

10
Golden Evaluation Cases

Eight answerable questions and two deliberately out-of-scope questions run through one repeatable suite.

0%
Abstention Accuracy

Both baselines missed the two negative cases, a documented failure that defines the next experiment.

Overview

CloudLens is an observable retrieval baseline for official AWS serverless documentation. Version zero deliberately stops before answer generation: it returns ranked evidence with source URLs and similarity scores so retrieval failures remain visible instead of being disguised by fluent generated prose.

A six-page corpus covering Lambda, API Gateway HTTP APIs, DynamoDB integrations, and IAM is parsed into section-aware chunks with source, service, section, license, and retrieval metadata. Chunks and 384-dimensional vectors live in PostgreSQL with pgvector; a credential-free feature-hashing embedder provides the control baseline and FastEmbed's BGE small English v1.5 provides the semantic comparison.

Every search stores its query, embedding configuration, latency, and ranked results. A ten-case JSONL golden suite writes trace-linked evaluation reports, turning retrieval changes into measurable experiments rather than one-off chat demonstrations.

The Challenge

Generation makes a weak retrieval system look more complete than it is. If expected evidence is missing or an out-of-domain query still returns confident-looking chunks, adding an LLM only makes the root failure harder to diagnose.

The initial evaluation is intentionally small, which makes its measurements useful for development but not a production-quality claim. It must expose both the improvement from semantic embeddings and the negative cases the current similarity threshold cannot reject.

Key Engineering Decisions

01

Prove Retrieval Before Generation

The v0 contract returns evidence only. Generated answers and claim-level citation validation remain explicitly deferred until retrieval quality is visible and repeatable.

02

Preserve Provenance by Construction

Every chunk retains its source URL, title, service, section, retrieval date, and license context so ranked evidence never loses where it came from.

03

Make Embeddings Replaceable

Small interfaces allow the hashing baseline and local BGE semantic model to share ingestion, storage, retrieval, API, tracing, and evaluation contracts.

04

Publish the Failed Negative Test

The baseline report records 0% abstention accuracy instead of tuning the story around successful answerable queries.

What I Owned

Built ingestion, section-aware chunking, embedding, pgvector retrieval, tracing, CLI, and FastAPI surfaces.
Kept source attribution and licensing metadata attached from corpus manifest through ranked result.
Compared a 384-dimensional feature-hashing control with BGE small English v1.5 through FastEmbed.
Improved answerable Recall@5 from 87.5% to 100% on the ten-case v0 suite.
Documented the shared 0% abstention result and the next experiment: a larger negative set plus scope classification or evidence-sufficiency checks.

Results

Semantic embeddings fixed the one answerable retrieval miss in the feature-hashing baseline, reaching 8/8 answerable cases at Recall@5.
The same evaluation exposed that neither baseline could reject the two out-of-domain questions, preventing a premature claim of trustworthy abstention.
Retrieval experiments now produce stored, trace-linked reports that can become regression evidence for later generation work.

Valuable Lessons

A smaller honest retrieval milestone is more useful than a full RAG demo whose failure modes cannot be attributed.

Perfect recall on answerable questions does not imply a trustworthy system; negative-set behavior has to be measured separately.