cd /news/artificial-intelligence/vector-search-isn-t-the-hard-part-de… Β· home β€Ί topics β€Ί artificial-intelligence β€Ί article
[ARTICLE Β· art-62693] src=news.ycombinator.com β†— pub= topic=artificial-intelligence verified=true sentiment=Β· neutral

Vector search isn't the hard part. Deciding what should be searched is

A developer redesigning an AI knowledge system's retrieval pipeline found that vector search alone becomes ineffective as the knowledge base grows, leading to irrelevant chunks and high token costs. They implemented a two-stage architecture with a SQL registry for metadata-based document ranking before vector search, improving retrieval quality more than changing the generation model.

read2 min views1 publishedJul 16, 2026

Over the last few weeks I've been redesigning the retrieval pipeline for an AI knowledge system.

Initially, the architecture was fairly typical:

User Question β”‚ β–Ό Vector Search β”‚ β–Ό Top K Chunks β”‚ β–Ό LLM

It worked well while the knowledge base was small.

As more documents were added, I started seeing a few recurring problems:

More irrelevant chunks being retrieved.

Larger prompts and increasing token costs.

Multiple documents discussing the same topic competing with each other.

Vector search returning semantically similar chunks from documents that weren't actually the best source of truth.

I realized the problem wasn't vector search itself.

It was deciding what should be searched before semantic retrieval even began.

Instead of treating every document equally, I separated the system into two independent stages.

Ingestion

During document upload, every document is processed once.

The pipeline extracts structured metadata including:

document type

business role

departments

topics

planner summary

retrieval keywords

authority score

importance score

answerable questions

That information is stored in a SQL registry, while document chunks and embeddings are stored separately in a vector database.

Document β”‚ β–Ό Metadata Extraction β”‚ β”œβ”€β”€β”€β”€β”€β”€β”€β”€β–Ί SQL Registry β”‚ └────────► Chunking + Embeddings β”‚ β–Ό Vector Store

Query Time

Instead of querying the vector database immediately, the retrieval flow became:

User Question β”‚ β–Ό Intent Analysis β”‚ β–Ό Registry Ranking β”‚ β–Ό Retrieval Planner β”‚ β–Ό Selected Documents β”‚ β–Ό Vector Search β”‚ β–Ό Context Assembly β”‚ β–Ό LLM

The registry acts as a lightweight ranking layer.

Rather than searching every document, it produces a ranked candidate set based on signals such as:

authority

importance

approval state

departments

document role

planner summary

retrieval keywords

topic overlap

The planner then decides which documents should actually participate in vector retrieval.

The vector database never searches the entire workspace anymore.

Only the planner-selected documents.

A few other changes made a noticeable difference:

similarity thresholding before accepting chunks

duplicate chunk removal

token budgeting before generation

dynamic chunk limits based on query type

ranking retrieved chunks before assembling context

One interesting observation was that improving retrieval often had a larger impact on answer quality than changing the generation model.

I'm curious whether others have moved beyond "vector search first" architectures.

If you've experimented with retrieval planning, metadata-driven routing, or hybrid retrieval systems, I'd be interested in hearing what worked and what didn't.

Comments URL: [https://news.ycombinator.com/item?id=48939470](https://news.ycombinator.com/item?id=48939470)

Points: 1

── more in #artificial-intelligence 4 stories Β· sorted by recency
sponsored brought to you by zahid.host 4,200+ EU-deployed projects
reading about agents? ship yours in a single git push.

Run your AI side-project on zahid.host

EU-based hosting, git-push deploys, automatic HTTPS, no cold starts. Free tier with a custom domain β€” perfect for shipping the agent you just read about.

$git push zahid main
β†’ Live at https://your-agent.zahid.host βœ“
Get free account β†’ Pricing
from €0/mo Β· no card required
LIVE [news/vector-search-isn-t-…] indexed:0 read:2min 2026-07-16 Β· β€”