RAGSpine
Architecture

Channels

Structured facts, narrative retrieval, composite answers, and provenance-aware graph utilities.

RAGSpine uses different evidence mechanisms for numeric facts and explanatory text. The agent selects structured, narrative, or composite; graph utilities remain an explicit supporting surface rather than a hidden fourth routing branch.

Structured channel

query_metric normalizes metric, entity, period, and channel through controlled glossaries and queries FactStore. Its result is exactly one of found, not_found, or unrecognized_param.

  • On found, final numeric prose is rebuilt from the stored fact, and carries source_doc_id/locator.
  • On not_found, the result is a fixed number-free refusal.
  • On an unrecognized parameter, the response identifies the unsupported input instead of guessing.

The model cannot supply a replacement number for a failed lookup.

Narrative channel

question
  → optional deterministic/automatic metadata filters
  → optional library router
  → per-library lexical and optional vector search
  → reciprocal-rank fusion
  → optional rerank / postprocess
  → child-hit expansion for parent/window prompt context
  → cited generation

Retrieval modes economy, bm25, and lexical construct no embedding backend or vector store. Hybrid/auto modes can use ONNX embeddings when installed. The metadata filter operators are eq, ne, in, nin, gt, gte, lt, lte, and between; filtering only narrows and preserves the incoming order.

MultiIndexRetriever searches routed libraries independently, RRF-fuses their results, and retains library_id provenance. If routing fails, it searches all registered libraries rather than silently returning nothing.

Parent-child and sentence-window evidence

Small chunks produce precise hits, while a parent or window can improve generation context. The chunk store persists parent_id, heading, window_text, and parent_locator. A returned snippet keeps the child text, chunk_id, and source_locator; expansion is placed in separate prompt_text, with parent_locator as a backreference. Citations therefore point to the matched child, not to an invented aggregate.

Restricted children are discarded before snippet construction. Their parent/window content is discarded with them, so expansion cannot bypass isolation.

Composite route

A composite question executes the structured facts and narrative attribution paths separately, then merges their answers and source lists. Narrative prose cannot promote itself into structured numeric evidence. Conversation history is generation context only and likewise cannot become evidence.

Graph utilities

The graph domain provides deterministic structured relation graphs for roll-ups, comparisons, and derivation tracing, plus opt-in narrative relation extraction. Model-derived edges are marked model-derived and unverified, preserve caller-supplied lineage, and are screened by the same security boundary. GraphRAG helpers do not replace the dual-channel router.

Workflow graphs are separate

Workflow preview v1 is a redacted UI projection of a Dify-compatible graph. It describes nodes, edges, labels, and geometry only; it is not narrative evidence, an engine topology, or an executable format. See Workflows.

On this page