SpinRAG v0.1.0a1 - first public alpha
Pre-release
Pre-release
SpinRAG v0.1.0a1 - first public alpha
The first publicly tagged release of SpinRAG. This alpha is deliberately tuned for document restoration: faithful reconstruction of damaged, partial, or fragmented knowledge bases. Hallucination risk on non-TOP queries is explicitly accepted in exchange for high fidelity on intact inputs.
Restoration-first design
- Every LLM prompt used during evolution is wrapped in a restoration guardrail telling the model to preserve every noun, number, and relationship from the source fragments and mark unknowns with
[unknown]instead of guessing. - Pure
TOP-spin queries are returned verbatim from the closest matching document, with no LLM rewriting. - Only
LEFT/RIGHT/BOTTOMqueries pass through generative rules. These are the documented hallucination-risk paths.
What landed in this release
Packaging fixes (previously the package would not install):
setup.pynow usesfind_packages()and actually installs thespin_ragpackage.spin_rag/__init__.pyre-exportsSpinRAG,SpinType,Documentand exposes__version__.requirements.txtadds the missinglangchain-ollamadependency.
Core bug fixes:
- Separate embedding model from LLM model. Chat-tuned models reject
/api/embeddingsand previously crashed initialization; default is nownomic-embed-text. - Cosine similarity is zero-norm safe at all three call sites.
- Embeddings are cached per text;
_find_closest_docno longer recomputes the entire corpus on every catalyst interaction. _get_spinparses LLM replies with a word-boundary regex (no more misclassifications on reasoning prefixes).- LLM outputs are stripped of whitespace, surrounding quotes, and stray code fences before becoming new documents.
LLMChain(deprecated) replaced with directllm.invoke.- Logging is resilient to Windows cp1252 consoles that cannot encode emoji.
Demo (demo.py):
- Initialize button re-enables when work finishes; live status indicator.
- Separate selectors for LLM and embedding model.
- Thread locks protect the shared RAG instance and log buffer.
- Chat input clears after send; Enter submits.
- Bounded log buffer keeps the UI responsive on long runs.
README:
- Correct import path (
from spin_rag import SpinRAG) and constructor signature (content=,embed_model=). - New section documenting the restoration / hallucination trade-off and known alpha limitations.
Install
git clone https://github.com/iblameandrew/spin-rag.git
cd spin-rag
pip install -r requirements.txt
pip install -e .
ollama pull qwen3:4b-instruct-2507
ollama pull nomic-embed-textKnown alpha limitations
- No persistence; the graph lives in memory.
- No batching; large corpora are slow.
- No automated test suite.
- Restoration guardrail reduces but does not eliminate fabrication. Treat
LEFT/RIGHT/BOTTOMquery outputs as drafts.