RAGSpine
Reference

Configuration

ServiceConfig environment variables, retrieval selectors, workflow execution gates, public API credentials, and CompanyProfile.

ServiceConfig.from_env() maps dataclass field name to RAGSPINE_NAME. Three legacy aliases remain supported: RAGSPINE_PROVIDERprovider_type, RAGSPINE_COMPANY_PROFILEcompany_profile_path, and RAGSPINE_FAQ_SOURCEfaq_source. A canonical field-name variable takes precedence over its alias.

Core and storage

VariableDefaultPurpose
RAGSPINE_DB_PATHdata/fact_metric.dbstructured fact SQLite store
RAGSPINE_CHUNK_DB_PATHunsetnarrative chunk store; unset degrades honestly
RAGSPINE_MAPPING_DB_PATHunsetmapping store
RAGSPINE_QUEUE_DB_PATHunsetSME review queue, not the RQ job queue
RAGSPINE_MANIFEST_DB_PATHunsetstructured-ingestion manifest
RAGSPINE_REDIS_URLredis://localhost:6379/0RQ/Redis connection
RAGSPINE_ALLOWED_UPLOAD_ROOTunsetresolved ingestion-path allowlist
RAGSPINE_FAQ_SOURCEunsetvetted FAQ JSON; unset means empty cache
RAGSPINE_REFERENCE_DATEunsetISO date for relative-period resolution

Provider and retrieval

VariableDefaultValues / purpose
RAGSPINE_PROVIDERmockmock or anthropic
RAGSPINE_MODELprovider defaultserver-side model ID
RAGSPINE_BASE_URLunsetserver-side provider gateway URL
RAGSPINE_TOKENS_PER_MINUTE0corespine sliding-window provider throttle; 0 is off
RAGSPINE_RETRIEVAL_MODEautoauto/hybrid/vector, or zero-embedding economy/bm25/lexical
RAGSPINE_EMBEDDINGautonone, auto, onnx, deterministic, or openai
RAGSPINE_RERANKERnonecross_encoder, colbert, splade, auto, or none
RAGSPINE_POSTPROCESSORnonecomma chain such as mmr,lost_in_middle
RAGSPINE_QUERY_DECOMPOSEnoneoptional LLM query decomposition
RAGSPINE_CORRECTIVEnoneoptional crag wrapper
RAGSPINE_QUERY_TRANSFORMnonehyde, rag_fusion, or step_back
RAGSPINE_ADAPTIVEnoneoptional heuristic/LLM complexity routing
RAGSPINE_CHUNKERnonedefault, parent-child/small-to-big, layout, laws, QA, book, sentence-window, or semantic
RAGSPINE_VECTOR_STOREnonenone, in-process, or configured persistent adapter
RAGSPINE_PERSISTENCE_POLICYdefaultisolation-first default or persist_everything

Economy mode is stronger than setting a cheap embedding: it does not construct an embedding backend or vector store at all.

Workflows and public compatibility APIs

VariableDefaultPurpose
RAGSPINE_WORKFLOW_MATCHERautoworkflow matcher selection; auto can fall back to lexical
RAGSPINE_DIFY_RUN_ENABLEDfalsemaster gate for Dify/n8n-compatible execution
RAGSPINE_DIFY_RUN_TIMEOUT_S10.0execution timeout in seconds
RAGSPINE_DIFY_RUN_ISOLATIONinprocessinprocess or Linux-enhanced subprocess
RAGSPINE_STUDIO_DIRemptyexisting static directory mounted at /studio
RAGSPINE_DIFY_PUBLIC_APPSemptykey=/path/workflow.yml;...; empty disables public Dify API
RAGSPINE_N8N_API_KEYunsetexpected X-N8N-API-KEY; unset disables /api/v1/*
RAGSPINE_N8N_STORE_PATHdata/n8n_storen8n-compatible file-store root

Enabling execution is a trust-boundary decision, not authentication. The internal run routes still need reverse-proxy/network protection. Public Dify and n8n APIs have their own keys; webhooks are intentionally unauthenticated.

CompanyProfile

The company profile controls home identity, entity aliases, labels/geography, competitor scope, and sensitivity classification. The loader used by the engine reads RAGSPINE_COMPANY_CONFIG or an explicit path:

RAGSPINE_COMPANY_CONFIG=config/company.toml \
  .venv/bin/python scripts/run_server.py

ServiceConfig.company_profile_path is populated by the canonical RAGSPINE_COMPANY_PROFILE_PATH or legacy RAGSPINE_COMPANY_PROFILE, but current company-profile loading has a separate RAGSPINE_COMPANY_CONFIG path. Prefer the latter until those assembly surfaces are unified.

[home]
company_name = "YourCo"
entity_code = "YOURCO_GROUP"

[home.synonyms]
"yourco" = "YOURCO_GROUP"

[external_entities]
"globex" = "Globex"

[sensitivity]
default_level = "INTERNAL"
restricted_keywords = ["board_minutes", "绩效"]

No production company identity should be hardcoded in the engine. Competitor/refusal decisions and restricted-content classification derive from this profile.

Provider testing note

The deterministic mock path is the fully exercised offline baseline. The project author is based in China and cannot access the Anthropic API, so Anthropic-specific behavior has not received the same direct integration testing. Users of that adapter should validate their model ID, credentials, gateway behavior, and rate limits in their own environment.

On this page