Lion Cipher Lab

Build a local RAG pipeline over your own documents

Why it matters

A raw language model answers from a blurry average of everything it read during training. Ask it about YOUR refund policy, YOUR lab notes, or last week's meeting and it will often produce something fluent, confident, and wrong -- a made-up answer with no source behind it. That failure has a name: hallucination. Retrieval-augmented generation is the standard engineering fix, and it is refreshingly simple in shape: before the model answers, you search your own documents for the passages most relevant to the question, then you hand those passages to the model and tell it to answer only from…

What you'll learn

Steps in this lab

  1. The problem, and the shape of the fix (what RAG is)
  2. The seven words you need, defined once
  3. Install the stack: Ollama, then three Python libraries
  4. Put your documents somewhere and load them
  5. Chunk the documents into retrievable passages
  6. Embed every chunk and store it in a local vector database
  7. Retrieve the passages most relevant to a question
  8. Ground a local model in the retrieved chunks and generate the answer
  9. Prove it reduces hallucination: ask what your documents do NOT contain
  10. Add real citations so every answer is checkable
  11. What you built, the knobs to turn next, and where it goes

Open the full interactive lab →