Skip to main content

Pipeline, tools, and prompts

The preset Pipeline tab is the runtime assembly surface for a preset. It defines which tools run before retrieval, which retrieval profile is the default, which tools post-process retrieved chunks, which prompts shape the answer LLM, and which tools the answer LLM may call directly.

Where to find this in the Admin Console

Admin Console → Configuration → Presets → open a preset → Pipeline tab.

Runtime flow

When a preset is applied, CoreCube composes a resolved pipeline snapshot. Query-time code uses that snapshot instead of re-reading every tool and prompt row while a user waits for an answer.

The default path is:

  1. Run active query tools in position order.
  2. Run the preset's default retrieval tool if the query stage did not already produce chunks.
  3. Run active chunk tools in position order.
  4. Compose the answer system prompt from answer-stage prompt fragments plus every active tool's tool prompt.
  5. Send the grounded context and composed prompt to the preset's answer LLM.
  6. If the preset exposes retrieval or action capabilities, the answer LLM can call them in a bounded tool-call loop.

Tool stages

Tool typePipeline locationWhat it can doLLM-callable
queryBefore retrievalRewrite or expand the user query, then request additional retrieval runs.No
retrievalDefault retrieval or answer capabilityStore a full retrieval profile: candidate pools, fusion weights, freshness floor, reranker, final top-K.Yes, when not the default retrieval
chunkAfter retrievalReorder, filter, expand, or annotate candidate chunks before they reach the answer LLM.No
actionAnswer capabilityExecute a code tool with an OpenAI-style function schema, scoped to the caller.Yes

Only one retrieval tool is the default retrieval. Additional retrieval tools are exposed as LLM-callable capabilities, so the answer model can ask for a narrower or wider search when the initial evidence is insufficient.

Retrieval tools store reranker configuration in their settings.reranker_model field. They do not use the generic tool modelId; that field is reserved for tools that need an LLM or executor model.

Prompt stages

Prompt fragments are reusable building blocks. A fragment can be attached to a preset stage or used as a tool prompt.

StageTypical fragment typesRuntime use
Queryretrieval_semantic_query, retrieval_keyword_querySupplied to query tools that rewrite the user's question before retrieval.
Chunkchunk_selectionSupplied to chunk tools that ask an LLM to classify or expand candidate passages.
Answeranswer, answer_citations, answer_attachmentsComposed into the final answer-LLM system prompt.
Tooltool_promptAttached to each tool. Active tool prompts are appended to the answer system prompt.
Ingestionocr_extractionUsed by chat-API OCR providers while ingesting scanned or image-based documents.

The answer system prompt is composed in this order:

  1. answer fragments in answer-stage position order.
  2. Tool prompts for the active default retrieval, retrieval capabilities, query tools, chunk tools, and action capabilities.
  3. answer_citations fragments.
  4. answer_attachments fragments.
  5. A non-editable invariant footer that enforces language, untrusted-context handling, refusal rules, and permission-leak prevention.

Editing a shared fragment affects every preset or tool that references it. The Admin Console shows affected presets and tools before you save.

Seeded default presets

Fresh installs bind the organization to default-balanced. The seeded defaults are:

PresetDefault retrievalQuery toolsChunk toolsShape
default-fastretrieval-fastNonefreshness_decaySmall candidate pools, final top-K 4, lowest latency.
default-balancedretrieval-balancedexpand_multi_queryfreshness_decayBalanced candidate pools, query expansion, final top-K 7.
default-accurateretrieval-accurateexpand_multi_queryfreshness_decay, llm_select_and_expandWide candidate pools, LLM chunk selection, final top-K 12.

These defaults are editable from the preset page. Use Reset to defaults when you want to return one of the seeded presets to its shipped shape, or duplicate a preset before experimenting.

Seeded tools

Tool slugTypePurpose
retrieval-fastRetrievalLean retrieval profile for low-latency answers.
retrieval-balancedRetrievalMid-tier retrieval profile used by the fresh-install default.
retrieval-accurateRetrievalHigh-recall retrieval profile with deeper candidate pools.
expand_multi_queryQueryUses an LLM to create semantic and keyword variants, then fuses the resulting streams.
freshness_decayChunkRe-scores chunks toward recently synced content, bounded by the retrieval freshness floor.
llm_select_and_expandChunkUses an LLM to select relevant anchors and expand them with neighboring chunks.
noop_chunkChunkPass-through chunk tool, useful when you need an explicit no-op chunk stage.

Answer model and loop bounds

The answer stage has its own model selection. A preset with tools or prompts but no answer model is incomplete until you pick one.

Two preset-level limits protect runtime tool execution. They apply to deterministic query/chunk tool stages and to LLM-emitted retrieval/action capability calls:

FieldDefaultMeaning
max_tool_calls_per_request8Maximum tool invocations consumed by one stage budget.
max_tool_call_wall_ms60000Maximum wall-clock time spent in one stage budget.

If either bound is exceeded, the request fails fast with a typed tool-loop error instead of running unbounded work. The deterministic query/chunk pipeline and the answer LLM's capability loop each receive their own bounded budget.

Operational notes

  • Streaming chat currently supports retrieval and chunk processing before answer generation. If a preset exposes LLM-callable retrieval or action capabilities, use non-streaming chat for that preset until streaming tool-call deltas are supported.
  • Tool execution is scoped to the caller's resolved compartments and sensitivity ceiling. A tool cannot widen the API key or user's permissions.
  • Code tools execute through the executor sidecar with timeout, memory, and egress allowlist controls.

We use cookies for analytics to improve our website. More information in our Privacy Policy.