Why RAG with Pinecone breaks on real data
On demo data, knowledge base search looks functional: a dozen documents, neat questions — answers match expectations.
On a real corpus, the picture is different: some queries return nothing, others return confident but irrelevant answers where the model fills in meaning from fragments. This is how the RAG retrieval pipeline loses trust in the first week of operation.
The cause is usually not the model but data preparation. Fixed-length chunking tears tables and regulations in the middle of a condition, the averaged vector stops reflecting meaning, and the nearest neighbor in the vector store turns out to be random.
The second source of failures is an outdated index. Documents are edited and deleted, but vectors remain: the system returns withdrawn conditions as active. Namespace separation, incremental updates, and deleting vectors together with the source help.
Long queries lose precision separately: pure vector search handles SKUs, abbreviations, and narrow terms poorly. Here a hybrid scheme works — lexical search plus vector search, candidate reranking, and a relevance cutoff threshold.
Retrieval quality is measurable: share of correct hits in the top, share of empty answers, response time. Without a set of control questions and metrics, any settings change turns into guesswork — so below we discuss how this is addressed.
What a managed knowledge retrieval pipeline provides
A managed retrieval pipeline differs from a "just connected vector database" in predictability across three metrics: accuracy of hitting the right fragment, index update time, and failure rate.
We build hybrid search — dense vectors capture semantic similarity, while the lexical component pulls out exact terms, SKUs, and abbreviations that are absent from the embedding model's training data.
Metadata filters (document, version, access rights) are applied before ranking: the system physically cannot reference a fragment the user is not entitled to.
The index updates incrementally.
A new document is split into fragments with stable identifiers and written over the previous version of the same fragment, so rebuilding the entire corpus is unnecessary, and edits to regulations and knowledge bases appear in search within minutes.
Separately, we calculate the share of answers where the link points to the correct fragment, on a set of reference questions — this is a measurable quantity, not a subjective "it started answering better."
Thanks to the relevance threshold, the class of "confident answer not from the source" failures disappears: if there are no suitable fragments, the system reports missing data instead of a plausible fabrication, and every answer is accompanied by a link to the primary source.
Verifying an answer takes seconds — this removes the main reason internal assistants stop being used after the first month.
We work with Pinecone as a managed vector store: scaling and fault tolerance are covered on the service side, while our part is the data schema, chunking strategy, and lifecycle policies.
Separating collections by domain and lifespan plus deleting outdated versions keeps index size under control: the cost of owning the pipeline stops growing along with the corpus instead of chasing it.
Search modes in RAG with Pinecone: comparison of approaches
The retrieval mode determines what exactly goes into the model context: which fragments, in what order, and how many. This affects answer accuracy, latency, and the volume of model calls. Below are four modes that are actually chosen between when building RAG on Pinecone.
| Mode | When it fits | Limitations |
|---|---|---|
| Pure vector search | Homogeneous corpus, queries with paraphrased wording | Misses exact matches — SKUs, abbreviations, rare surnames; noisy results on narrow terms |
| Hybrid search: vector plus lexical | Mixed queries — meaning together with codes, names, industry terms | Requires a score fusion layer and weight tuning; harder to configure, more expensive in latency |
| Candidate reranking | The top of the results is noisy, accuracy of the first fragments matters | A separate model for several dozen candidates; latency grows with their number |
| Splitting large documents | Regulations, contracts, long instructions | Without overlap and structure binding, connections at fragment boundaries are lost |
In practice, modes are combined: hybrid search gathers candidates, reranking cuts noise, and document splitting sets fragment size so the answer fits into context without losing meaning.
We validate the choice on a set of control questions with reference fragments: we look at the share of hits in the top three and answer completeness.
Work stages: from data audit to pipeline handover
First, we pin down exactly what should go into the index and by what rules that document may be used.
Without this stage, search configuration turns into hypothesis testing: the pipeline answers fluently but references the wrong clause of a regulation, and trust in it drops after the first ten queries. Therefore we proceed in stages, each ending with a verifiable result.
- Document corpus audit. We examine sources: formats, duplicates, outdated editions, documents with restricted access. Separately, we note where text is extracted cleanly and where preliminary processing of tables and scans is needed.
- Pipeline schema. We determine where the index lives, how documents get into it on update, and what happens on deletion or edition change. We agree on the schema before writing code — edits at this step cost hours; after launch, weeks.
- Index configuration. We select fragment size and overlap so the answer is not cut off mid-word, and label metadata for filters. Here we also enable hybrid search: vector by meaning plus lexical by exact wording, numbers, and abbreviations.
- Filters and access rights. We verify that an employee sees only the sections permitted to them, and that the filter is applied before ranking, not after. This removes the class of leaks that cannot be caught in a demo.
- Control queries. We assemble a set of reference questions with known sources and see how often the system hits the right document. The same queries remain a regression test: after any index change, it is visible what improved and what broke.
- Solution handover. We provide pipeline documentation, the corpus update regulation, a way to roll back to the previous index configuration, and training for your team. Pinecone or another vector layer here is an implementation detail; more important is that the pipeline is maintained by your own forces.
Deliverables: configurations, schemas, and regulations
An RAG project on Pinecone ends not with a demo of an answer in chat, but with a set of artifacts your team can work with without us.
We transfer everything to your repository and knowledge base, walk through each file on a call, and verify it on your staging environment: acceptance is by checklist, not by the feeling that "it seems to answer."
- Pipeline configurations. Index and namespace declarations, document chunking parameters, embedding model settings, and relevance cutoff thresholds — in version control, not in an engineer's chat.
- Data flow schema. The document path from upload to answer with source links: where cleaning happens, where chunking happens, where index writing happens, where model invocation happens. A diagram and text description side by side.
- Filtering and access rules. Which metadata is attached to vectors, how namespaces separate clients and departments, who sees which documents. Each rule is covered by a cross-pipeline leak test.
- Update regulation. Triggers and schedule for reindexing, the order of full rebuild when the embedding model changes, and the rollback procedure to the previous index.
- Documentation. Service map, local launch instructions, description of metrics and trigger thresholds, analysis of typical failures with ready actions.
- Reference question set. Queries with expected sources and a run script: after edits, it is visible that quality has not dropped.
Handover ends with a run on your infrastructure: engineers bring up the pipeline according to the instructions, we answer questions and record discrepancies.
Case: how we reduced the share of irrelevant answers
The client is a service company with an internal knowledge base: several thousand regulations, contracts, and project correspondence. The assistant answered quickly, but every fifth answer could not be confirmed by a single fragment of the source.
On long contracts, search surfaced the introductory part instead of the needed clause on page forty.
What it was before the changes
The share of answers without a source link held at 21%. A specialist reached the needed fragment in six to eight seconds, half of which was manual review of the results.
The base was edited once every one to two weeks: chunks were cut by fixed length and tore tables, numbering, and nested clauses.
What was changed
Chunking was switched to semantic blocks while preserving headings and clause structure; metadata gained document type, department, and edition date.
Search was made hybrid — vector by meaning plus keyword search with reranking of top results, which pulled up accuracy on abbreviations and clause numbers. The index was built in Pinecone with metadata filtering so that only the active edition appeared in the answer.
The confidence threshold was set explicitly: if the best fragments do not score high enough, the assistant answers "there is no answer in the base" and names the document owner instead of a plausible guess.
| Metric | Before | After |
|---|---|---|
| Answers without a source link | 21% | 3% |
| Time to the needed fragment | 6–8 s | 1–2 s |
| Manual knowledge base revisions | once every 1–2 weeks | once a quarter |
Knowledge base edits stopped being a regular task: the block structure and metadata cover new documents without an engineer's intervention.
How hybrid search differs from vector search
Semantic search converts the query and database fragments into vectors and compares them by proximity: the user's wording and the document text may not share a single word but still make it into the results.
This covers paraphrases, synonyms, and conversational queries — cases where the person does not know the exact term. The downside is exact tokens: a SKU, clause number, or abbreviation dissolves in a dense vector, and something close in topic but not the right thing arrives.
Search by exact term matching works differently: it relies on an inverted index and the weight of rare words, so it is guaranteed to find a document where the query appears literally.
It is also robust to short queries of two or three words, where the vector simply has nothing to build meaning from.
The difference is not in quality but in error profile: vectors underperform on identifiers, lexical search underperforms on reformulations, and a single mode covers only half the queries.
A hybrid in an RAG pipeline runs both and merges the lists, bringing them to comparable ranks — scores cannot be added directly, since vector proximity and lexical weight lie on different scales.
Then weight shifting is tuned to the subject domain, and reranking works on top: the model looks at the query and fragment as a whole and removes random hits.
Choosing a retrieval strategy is tuning weights for typical queries. Where SKUs, names, and exact terms predominate, we shift toward lexical; where users ask in their own words, toward meaning.
We tune not by feel: we take a set of queries with pre-labeled correct fragments and see how the share of cases where the correct answer made it into the top five changes.
Limitations and pitfalls: what to consider in advance
Most failures of an RAG pipeline appear not in a demo but in operation: the corpus grows, documents are edited, employees have different rights. These bottlenecks are cheaper to account for at the start than to handle incidents after launch.
Below are technical concerns that most often surface before putting the system into production.
How often should the corpus be reindexed?
A full reindex is needed when the embedding model or chunking rules change. The rest of the time, delta updates work: changes are tracked by document hash, only affected fragments are updated, and deleted ones are purged. Update time depends on the volume of edits, not on corpus size.
How are document access rights taken into account in the answer?
Rights are applied as a filter at the search level: department, role, and retention classification reside in fragment metadata.
The user receives an answer only from sections available to them — otherwise the system would assemble an answer from a document the employee is not entitled to, and that is already a leak incident.
What should be done with heterogeneous formats?
Each format requires its own parsing: text layer, scan recognition, separate representation of tables and presentations. Without normalization at the input, a table breaks into garbage rows, and answer quality hits a wall not in the model but in data preparation.
Is there a limit on corpus size?
The limit is set not by volume but by search time and chunking quality. On a large corpus, metadata filters and index separation by domain help: search runs over a relevant subset rather than the entire array.
What happens when the model changes?
Vectors from different models are incompatible, so changing the model means a full reindex. It is planned as a separate task: the new index is built in parallel, and the old one continues serving queries until the switch.
Let's discuss the task: what is needed to start
To come back with a project estimate and work plan, a minimum of context is needed — not a full technical specification, but what is already in progress. The more specific the input data, the more accurate the estimate by stage and the fewer clarifications at the start.
- List of knowledge sources: databases, file storage, internal systems, and documents — with formats and approximate volumes.
- 10–20 real user questions and reference answers to them — search is tuned on them and retrieval quality is checked.
- Access schema: who accesses the system and from where, which roles and restrictions apply to documents.
- Deployment requirements: your pipeline or external, who grants access to the vector store and models.
- Constraints on response time and number of concurrent requests, if they have already been formulated.
- Existing work: prototypes, labeling, scripts, past estimates — what does not need to be done again.
After that, we come back with a project estimate, a stage-by-stage work plan — from data preparation to launch and documentation handover — and a list of risks with options for closing them. Then the conversation becomes concrete: based on your dataset and your usage scenarios.
Describe the task in two or three paragraphs or send what has already been assembled — and we will come back with a plan and stage timelines.







