Introduction
RAGSpine is an offline-first Python RAG engine with deterministic dual-channel retrieval, provenance, workflow scaffolding, and optional HTTP compatibility surfaces.
RAGSpine is a framework-free backend RAG engine assembled with ordinary Python functions
and typed Protocols. Its structured channel answers questions whose evidence is a fact table;
its narrative channel retrieves cited text. The orchestrator routes between them and replaces an
unsupported answer with an explicit refusal. A deterministic MockProvider keeps the base path
usable without an API key.
RAGSpine now also includes workflow tooling. The ragspine command can turn a natural-language
description into a safe Dify 0.6 workflow, reuse a close bundled template, serialize JSON or YAML,
and emit a versioned graph preview. JSON, YAML, and TOML workflow documents can be normalized to a
JSON-compatible mapping. These compatibility tools do not turn the engine into Dify or n8n, and
the runtime never downloads or executes an upstream marketplace workflow.
What is enforced
- No unsupported values. A failed structured lookup becomes
not_found, regardless of model prose. - Source lineage. Facts and narrative snippets retain document and locator information.
- Restricted-content isolation. Restricted children are removed before prompt assembly; parent/window expansion cannot reintroduce them.
- Explicit execution. Workflow scaffolding, parsing, conversion, compilation, and preview are non-executing operations. Dify and n8n execution routes are disabled by default.
- Pluggable edges. Providers, embeddings, stores, rerankers, chunkers, queues, connectors, and other integrations enter through typed seams.
Start here
Installation
Install the base package or a precise set of optional capabilities.
Quickstart
Run offline, scaffold a workflow, and start the optional service.
Workflow guide
Catalog, matching, formats, Dify/n8n conversion, preview v1, and security boundaries.
Retrieval
Economy, hybrid, metadata-filtered, multi-index, and parent-child retrieval.
HTTP API
Engine, catalog, Dify-compatible, and n8n-compatible endpoints.
Architecture
Domains, dependency direction, and the execution boundary.
Repository version and published package
The current documentation follows the repository's main source, whose package metadata is
0.11.0. That number is a source-tree version, not a statement that PyPI already serves 0.11.0.
For reproducible released behavior, check the version selected by your package manager with
ragspine version; use an editable source install when following unreleased main documentation.
Major domains
Extraction
Documents to a lineage-preserving intermediate representation.
Ingestion
Structured facts and narrative chunks, idempotently.
Storage
SQLite fact, chunk, mapping, queue, and manifest stores.
Agent
Intent, clarification, tool use, history, and the deterministic guard.
Service
FastAPI composition root and optional async queue.
Pipeline
Static engine topology and workflow preview projections.