Skip to content
codebrix

RAG development

RAG development services for answers your team can check

Our RAG development services build retrieval-augmented generation systems that find the right passages in your documents and data, then have a language model answer only from them, with a citation for every claim. We handle ingestion, chunking, embeddings, hybrid search, reranking, permissions and evaluation. A first RAG system is indicatively ₹60,000–2,00,000 ($2,200–7,500) over 2–4 weeks.

First RAG system
₹60,000–2,00,000 indicative
Timeline
2–4 weeks once sources are ready
Default store
PostgreSQL with pgvector
Measured
Retrieval and answers, separately

Updated · By the Codebrix team

When RAG is the right answer, and when it is not

RAG is the right pattern when answers must come from content the model never saw in training, that changes over time, or that only some users may read. It is not always the right pattern, and we say so during discovery.

  • Small, stable knowledge base: Anthropic notes that a knowledge base under about 200,000 tokens, roughly 500 pages, can be placed in the prompt whole, with prompt caching keeping it fast and cheaper (Anthropic, Contextual Retrieval). No retrieval pipeline needed.
  • Questions about numbers in your database, such as 'revenue by region last quarter': give the model a safe query tool instead of embedding rows as text.
  • Teaching a new tone or output format: that is a prompting or fine-tuning question. See LLM development.
  • Large, changing, permissioned document sets: this is where RAG earns its place.

If what you want is a customer-facing assistant with conversation design and hand-off to staff, AI chatbot development covers that product layer. This page is about the retrieval engine underneath it, which can also power internal search, report drafting or an agent's lookups.

Ingestion and chunking

Most poor RAG answers trace back to this stage. A table flattened into a paragraph, a scanned PDF with no text layer, or a heading separated from the clause beneath it will mislead retrieval however good the model is.

  1. Connect to sources where they live: Google Drive, SharePoint, Notion, a CMS, a helpdesk, a database, or uploaded files.
  2. Parse by type: text extraction for digital PDFs, OCR for scans, table-aware parsing for spreadsheets and rate cards.
  3. Split by document structure (sections, clauses, Q&A pairs) rather than fixed character counts, keeping the heading path on every chunk.
  4. Attach metadata: source, owner, date, version, language and access group.
  5. Add short context to each chunk where it helps, a technique Anthropic calls contextual retrieval, so a chunk that says 'the fee is waived' also records which product it belongs to.
  6. Remove duplicates and mark superseded versions so old policies stop appearing in answers.

Embeddings and the vector store

Each chunk is turned into an embedding, a list of numbers that places similar meanings close together, and stored for search. Our default is pgvector, an open-source extension that adds vector similarity search to PostgreSQL and supports both exact and approximate nearest-neighbour search, with HNSW and IVFFlat index types (pgvector).

Questionpgvector in your existing PostgreSQLA separate vector database
Permissions and joinsSame database as your users and access rules, filtered in one queryAccess rules copied across and kept in sync
OperationsOne system to back up and monitorAnother service, account and bill
When it fitsMost business document sets we seeVery large collections or a team already running one

We choose the embedding model by testing it on your documents and your users' questions, especially if content mixes English with Hindi or other languages. Changing embedding models later means re-indexing everything, so this decision is made with evidence, not habit.

Hybrid search and reranking

Embeddings are good at meaning and weak at exact strings such as product codes, clause numbers and names. Keyword search is the reverse. The pgvector documentation suggests combining it with PostgreSQL full-text search for hybrid search, merging results with Reciprocal Rank Fusion or a cross-encoder.

Anthropic published one test of this stack: across their datasets, combining contextual embeddings with contextual BM25 keyword search and then reranking reduced the top-20 retrieval failure rate by 67%, from 5.7% to 1.9%. Those are their numbers on their data. We run the same comparison on your evaluation set and keep a stage only if it improves your results enough to justify its latency and cost.

Citations and permission-aware retrieval

OWASP lists Vector and Embedding Weaknesses among its 2025 risks for LLM applications (OWASP). In plain terms: a RAG system can show a user text they were never allowed to read, simply because it was retrieved.

  • Access groups are synced from the source system and stored on every chunk.
  • The permission filter runs inside the search query, before anything reaches the model.
  • Multi-tenant products keep each customer's chunks separated by tenant, tested with cross-tenant queries that must return nothing.
  • Every answer cites the document, section and version it came from, linking back to the original.
  • If retrieval finds nothing relevant, the system says so instead of answering from general knowledge.
  • Retrieved text is treated as data, so instructions hidden inside a document cannot change the system's behaviour.

Evaluating retrieval and answers separately

A single 'answer quality' score hides where the problem is. We build a question set with your team, each question linked to the passage that answers it, and measure two stages on their own.

StageWhat we measureHow
RetrievalDid the right passage appear in the top results?Recall at k against the labelled passages
RetrievalHow much irrelevant text was sent to the model?Share of retrieved chunks marked relevant
AnswerIs every claim supported by a cited passage?Faithfulness check, sampled and reviewed by your team
AnswerIs the answer correct and complete?Compared with the reference answer
AnswerDoes it decline when the answer is not in the sources?Questions deliberately outside the documents
BothSpeed and cost per questionLogged on every request

Production questions that fail are added to the set every week, and every change is run against it before release.

RAG development services: freshness, cost and timeline

Sources are re-indexed on change where the system sends webhooks, and on a schedule where it does not. Deleted documents are removed from the index in the same run, and each answer shows the date of the version it cited.

A first RAG system over one or two source types fits our indicative AI range of ₹60,000–2,00,000 ($2,200–7,500) over 2–4 weeks. Many sources, scanned archives, multi-tenant permissions or a full product interface move it to a custom quote. Embedding, model and hosting costs are billed to your accounts. If RAG is one part of a larger product, see AI development; to scope yours, book a discovery call.

Frequently asked questions

What is the difference between RAG and fine-tuning?

RAG gives the model the right passages at question time, so answers can cite current documents and respect permissions. Fine-tuning changes the model's behaviour through training examples, which suits format, tone or classification. For answering from company knowledge that changes, RAG is usually the better fit, and the two can be combined.

How much do RAG development services cost?

A first RAG system over one or two source types is indicatively ₹60,000–2,00,000 ($2,200–7,500) and 2–4 weeks with Codebrix. Many sources, scanned documents, per-user permissions across tenants or a full product interface move it to a custom quote after discovery. Embedding, model and hosting usage is billed separately to your accounts.

Which vector database do you use?

Our default is pgvector inside PostgreSQL, because permissions, metadata and vectors then live in one database and can be filtered in one query. For very large collections, or if your team already runs a dedicated vector database, we use that instead. We decide after looking at your document volume and access rules.

Can a RAG system respect who is allowed to see which document?

Yes, and it should be designed in from the start. Access groups are copied from the source system onto each chunk, the permission filter runs inside the search query before anything reaches the model, and we test with users who must not see certain documents to confirm nothing leaks.

Will a RAG system still make things up?

It can, less often than a model answering from memory. We reduce it by answering only from retrieved passages, requiring a citation for each claim, declining when nothing relevant is found, and measuring faithfulness on a test set. For legal, financial or medical content, a person should review answers before anyone acts on them.

Can RAG work with scanned PDFs and documents in Hindi?

Yes, with extra work. Scanned PDFs need OCR, and its quality decides retrieval quality, so we sample the extracted text before indexing. For Hindi or mixed-language content we test embedding models on your own questions, because performance varies by language. Both factors can move the project toward the upper end of the range.

Sources

  • AI chatbots

    An AI chatbot development company for assistants grounded in your content

    AI chatbot development company in Noida. Assistants that answer from your own documents, hand off to people and are tested before they go live.

    Read more
  • AI development

    An AI development company for products that have to work after the demo

    AI development company that scopes, builds, tests and runs AI products end to end: data, model choice, RAG or agents, evals, deployment and cost limits.

    Read more
  • LLM development

    LLM development services for applications built on language models

    LLM development services: choosing hosted or open-weight models, fine-tuning only when it pays, structured outputs, and latency, cost and privacy limits.

    Read more
  • AI integration

    AI integration services for the software you already run

    AI integration services that add LLM assistants, document search, summaries and classification to your product, tested on your data with cost limits set.

    Read more
  • Cost guide

    AI chatbot development cost: build price and monthly running cost

    AI chatbot development cost in two parts: our indicative build range and a worked formula for monthly LLM token and WhatsApp running costs.

    Read more
  • Hire developers

    Hire AI developers who build, test and ship LLM features

    Hire AI developers who build LLM features with retrieval, agents and evals in Python or TypeScript. Paid first milestone, your keys, rate after a call.

    Read more
Estimate Call WhatsApp