Skip to content

Packs / embeddings-rag-public

rag-answer-with-citations

Answer questions from our own notes with a local model and verify every [citation] points at a chunk that was actually retrieved; no citation or a made-up one fails.

Install

logicpacks pack use embeddings-rag-public/rag-answer-with-citations
get_pack embeddings-rag-public/rag-answer-with-citations

The second line is the MCP tool call for the LogicPacks connector (Claude Code, Codex, Claude.ai and others). The first run of a pack someone else wrote asks for your yes.

Keys it needs (names only)

None.

Playbooks included

  • Spec: spec/SPEC.md (goal, steps, edge cases, don’ts)
  • Routes: ollama-mac
  • Checks: 3 in outcome/checks.yaml
  • Code: answer.pybm25.pychunk.py
  • Tools: python3, ollama

Usage, last 8 weeks

New: no recorded use yet.

Purpose (from spec/SPEC.md)

Goal

A short answer grounded in retrieved chunks, with citations that all exist in the retrieved set.

Steps

  1. Chunk the source (chunk-markdown-notes).
  2. python3 code/answer.py chunks.jsonl "question" (BM25 top-3 + local model).
  3. Read the citations; open the cited chunk when the answer matters.

Edge cases

  • Small models sometimes drop citations: the script fails instead of passing a bare answer.
  • Answer 'I don't know' is fine when retrieval misses.

Don'ts

  • Don't send private notes to hosted models for RAG.