# 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.

- **Space:** embeddings-rag-public (https://github.com/Tech-Realm/space-embeddings-rag-public/tree/main/rag-answer-with-citations)
- **Level:** L1 (as the registry reports it)
- **Keys it needs (names only):** none
- **Tools:** python3, ollama
- **Routes:** ollama-mac; checks: 3
- **Uses:** new (no recorded use yet)
- **Install:** `logicpacks pack use embeddings-rag-public/rag-answer-with-citations` or MCP `get_pack embeddings-rag-public/rag-answer-with-citations`
- **Files:** CHANGELOG.md, code/answer.py, code/bm25.py, code/chunk.py, outcome/EVIDENCE.md, outcome/checks.yaml, outcome/fixtures/corpus/delivery.md, outcome/fixtures/corpus/returns.md, outcome/fixtures/corpus/riders.md, outcome/fixtures/corpus/support.md, outcome/fixtures/good_answer.txt, outcome/fixtures/made_up.txt, outcome/fixtures/qrels.jsonl, outcome/results.json, pack.yaml, refs/refs.yaml, spec/SPEC.md, spec/source.md

## Purpose (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.



---

Canonical URL: https://logicpacks.io/packs/embeddings-rag-public/rag-answer-with-citations

Developed by TechRealm (techrealm.online), the software team. Operated by Al Jash Trading (Establishment), Abu Dhabi, since 1994, the legal entity that hosts and is responsible for the service. Economic licence CN-1030597, Abu Dhabi Registration Authority. Address: Office 5, Bani Yas West 4, Bani Yas, Abu Dhabi, UAE. Website: https://aljashtrading.com. Contact: hello@logicpacks.io, security@logicpacks.io, WhatsApp +1 713 632 2262 (https://wa.me/17136322262).

Machine-readable index: [/llms.txt](/llms.txt). Plain facts: [/about.md](/about.md). Safety: [/safety.md](/safety.md).
