Home / Projects / SpecSeek

SpecSeek

Ask a question about an electronic component and get an answer with the datasheet page it came from.

The problem

Datasheets run to hundreds of pages. Finding one timing value or pin limit means a lot of scrolling and searching.

The approach

Split datasheets into overlapping chunks, find the most relevant ones with vector search, and let an LLM answer only from them.

The result68 to 84%

Retrieval hit rate@4 on a 25-question evaluation set.

How a question is answered

Step 1

Extract

PyMuPDF pulls text from each datasheet page, keeping page numbers for citations.

Step 2

Chunk and embed

Text is split into overlapping chunks and embedded with sentence-transformers.

Step 3

Retrieve

FAISS cosine-similarity search returns the four closest chunks to the question.

Step 4

Gate

If even the best match is below a similarity threshold, the question is refused before the LLM is called.

Step 5

Answer

Llama 3 answers from the retrieved chunks only, citing the page each fact came from.

Step 6

Cache

A hash of each file keys its embeddings, so re-uploading a datasheet skips re-indexing entirely.

Measured results

Retrieval hit rate@4

Chunk sizes of 400, 800 and 1,200 characters were benchmarked on the same 25 questions, and the best size was kept.

Out-of-scope questions refused 4 of 5

Questions the datasheets can't answer are declined instead of answered with a guess. Refusing before the LLM call also saves a model request.