﻿# Continue custom code RAG has a separate indexing and query service

Continue custom code RAG separates building an index, exposing an MCP query service and using returned snippets; a working query does not prove current workspace file availability.

Author: Retrivium editorial team
Updated: 2026-11-04
Canonical URL: https://retrivium.ai/journal/guide-continue-custom-code-rag-service-boundary/
Language: en

## Decide why a separate code service is needed

Continue's [custom code RAG guide](https://docs.continue.dev/guides/custom-code-rag) targets advanced cases such as indexing code once for multiple users or adding custom retrieval logic. That differs from asking the agent to inspect files already available in its workspace. Define the intended repository set and reuse requirement first. A central service adds an indexing and access contract; it is not automatically needed for every small coding task.

## Separate index preparation from tool execution

The guide constructs an index before exposing query operations through an MCP server. Changing a model configuration or connecting the server does not itself establish that the code was indexed. Diagnose preparation, storage and query access separately. If a new source file cannot be found, first determine whether it exists in the indexed revision rather than repeatedly rewording the query or changing the chat model.

## Preserve the returned file identity

The reference service formats search results with a filename and code text, and separately demonstrates a file-context operation. That distinction lets an agent discover a candidate and request more material from the same source. A bare snippet without repository and revision context becomes ambiguous when several projects have identically named files. Extend the result contract to preserve the identity needed by the intended task; do not assume a text match identifies a unique live file.

## Compare retrieval with the current workspace

The [codebase-awareness guide](https://docs.continue.dev/guides/codebase-documentation-awareness) distinguishes open-workspace exploration from access to other repositories. Retrieved remote code can explain an interface without being editable in the current checkout. Before an actual modification, establish which source revision and workspace own the target. The [context-selection guide](https://docs.continue.dev/ide-extensions/agent/context-selection) says tool responses become context, so a stale retrieved example can influence later actions even when the query itself completed successfully.

## Verify the integration through source-specific questions

Use a known symbol in the intended indexed revision and inspect the returned file identity and relevant code. Then compare a deliberately newer workspace change to establish refresh behavior. [Document-update guidance](/journal/rag-document-updates-stale-chunk-citations/) explains stale retrieved evidence; [progressive reading](/journal/learn-codex-progressive-reading/) helps move from a snippet to the needed source. Record the indexed revision and refresh process rather than describing successful MCP discovery as complete, current code awareness.
