Skip to content

SpinRAG v0.1.0a1 - first public alpha

Pre-release
Pre-release

Choose a tag to compare

@iblameandrew iblameandrew released this 06 Jun 18:40

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 / BOTTOM queries 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.py now uses find_packages() and actually installs the spin_rag package.
  • spin_rag/__init__.py re-exports SpinRAG, SpinType, Document and exposes __version__.
  • requirements.txt adds the missing langchain-ollama dependency.

Core bug fixes:

  • Separate embedding model from LLM model. Chat-tuned models reject /api/embeddings and previously crashed initialization; default is now nomic-embed-text.
  • Cosine similarity is zero-norm safe at all three call sites.
  • Embeddings are cached per text; _find_closest_doc no longer recomputes the entire corpus on every catalyst interaction.
  • _get_spin parses 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 direct llm.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-text

Known 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 / BOTTOM query outputs as drafts.