# Building AI Search on Heroku

DevFeed: [Building AI Search on Heroku](<https://devfeed.tech/articles/building-ai-search-on-heroku-26382.md>)

Original publisher: [Read original article](<https://www.heroku.com/blog/building-ai-search-on-heroku/>)

Author: Anush DSouza

Published: 2026-01-29T17:50:08Z

Content type: tutorial

Language: en

Sources: [Heroku](<https://devfeed.tech/sources/heroku.md>)

Topics: [AI-driven information retrieval](<https://devfeed.tech/topics/ai-driven-information-retrieval.md>), [Vectors & LLMs](<https://devfeed.tech/topics/vectors-llms.md>), [search-engines](<https://devfeed.tech/topics/search-engines.md>), [Retrieval Augmented Generation (RAG)](<https://devfeed.tech/topics/retrieval-augmented-generation-rag.md>), [Heroku AI](<https://devfeed.tech/topics/heroku-ai.md>), [Embeddings](<https://devfeed.tech/topics/embeddings.md>), [Managed Inference and Agents](<https://devfeed.tech/topics/managed-inference-and-agents.md>), [cosine similarity search](<https://devfeed.tech/topics/cosine-similarity-search.md>), [Enhancing AI model performance](<https://devfeed.tech/topics/enhancing-ai-model-performance.md>), [Heroku](<https://devfeed.tech/topics/heroku.md>)

Tags: [ai](<https://devfeed.tech/tags/ai.md>), [ai-search](<https://devfeed.tech/tags/ai-search.md>), [engineering](<https://devfeed.tech/tags/engineering.md>), [heroku](<https://devfeed.tech/tags/heroku.md>), [heroku-ai](<https://devfeed.tech/tags/heroku-ai.md>), [managed-inference-and-agents](<https://devfeed.tech/tags/managed-inference-and-agents.md>), [news](<https://devfeed.tech/tags/news.md>), [rag](<https://devfeed.tech/tags/rag.md>), [retrieval](<https://devfeed.tech/tags/retrieval.md>), [vector-search](<https://devfeed.tech/tags/vector-search.md>)

## AI overview

The Heroku AI Search reference app addresses a weakness of vector search: semantic similarity does not guarantee that a document answers the query. Its pipeline crawls URLs, filters site content with a heuristic, splits documents into 1,000-character chunks with 200-character overlap at paragraph or sentence boundaries, embeds them, and stores them in pgvector. At query time, it retrieves the top 20 chunks by cosine similarity, then uses a cross-encoder reranker to score each candidate against the query before Claude generates an answer. The excerpt says reranking can be optional when latency matters more than precision; it does not provide the crawler heuristic or further implementation details.

## Source excerpt

If you've built a RAG (Retrieval Augmented Generation) system, you've probably hit this wall: your vector search returns 20 documents that are semantically similar to the query, but half of them don't actually answer it. A user asks "how do I handle authentication errors?" and gets back documentation about authentication, errors, and error handling in [...] The post Building AI Search on Heroku appeared first on Heroku.