| --- |
| license: apache-2.0 |
| language: |
| - zh |
| size_categories: |
| - 10K<n<100K |
| tags: |
| - daoism |
| - taoism |
| - chinese-religion |
| - rag |
| - retrieval |
| - dingren-daoxue |
| - lius-cc |
| pretty_name: Daoism Knowledge RAG (鼎稔道學館館藏) |
| --- |
| |
| # Daoism Knowledge RAG |
|
|
| **鼎稔道學館(Dingren Daoxue Lab)館藏知識庫**——專為 RAG(Retrieval-Augmented Generation)優化的道教知識結構化資料集,95,919 條目。 |
|
|
| ## Overview |
|
|
| This dataset is the curated knowledge base behind [Dingren Daoxue Lab (鼎稔道學館)](https://lius.cc), released under Apache 2.0 to enable open-source RAG with the [`Daoism-Qwen3.5-9B`](https://huggingface.co/lius-cc/Daoism-Qwen3.5-9B) model. |
|
|
| It covers eight categories of Daoist knowledge: |
|
|
| | Type | Count | Content | |
| |------|-------|---------| |
| | concept | ~32,700 | 神學概念、宇宙論、修煉名相 | |
| | scripture | ~23,000 | 經文、戒律、科儀文獻 | |
| | deity | ~12,000 | 神祇、仙真、神格體系 | |
| | ritual | ~11,000 | 科儀、法事、節慶 | |
| | location | ~9,600 | 道觀、聖地、宮廟 | |
| | person | ~5,800 | 道士、學者、傳承者 | |
| | sect | ~1,278 | 流派、宗派 | |
| | custom | ~198 | 旗艦學術專題 | |
|
|
| ## Schema |
|
|
| Each row in `train.jsonl`: |
| ```json |
| { |
| "id": "ckm...", |
| "name": "城隍", |
| "type": "deity", |
| "slug": "deity/cheng_huang_ye", |
| "url": "https://lius.cc/n/deity/cheng_huang_ye", |
| "summary": "城隍,亦稱城隍爺、城隍神,為中國道教與民間信仰中極具代表性的地方守護神與司法神...", |
| "content": "## 起源與演變\n\n城隍信仰最初源於古代對城池守護神的祭祀..." |
| } |
| ``` |
|
|
| - `name`: 條目主名(繁體中文) |
| - `type`: concept / scripture / deity / ritual / location / person / sect / custom |
| - `slug`: lius.cc 上的 URL slug |
| - `url`: 原始條目 URL(可作為 RAG 引用) |
| - `summary`: 200-500 字摘要 |
| - `content`: 完整內容(平均 2-3 KB,部分至 30 KB) |
|
|
| ## Quick Start (RAG with Daoism-Qwen3.5-9B) |
|
|
| ```python |
| from datasets import load_dataset |
| from sentence_transformers import SentenceTransformer |
| import faiss |
| import numpy as np |
| from openai import OpenAI |
| |
| # 1. 載入資料 |
| ds = load_dataset("lius-cc/daoism-knowledge-rag", split="train") |
| print(f"Loaded {len(ds)} entries") |
| |
| # 2. Embed (bge-m3 多語言效果最好) |
| encoder = SentenceTransformer("BAAI/bge-m3") |
| embeddings = encoder.encode( |
| [f"{x['name']}:{x['summary']}" for x in ds], |
| batch_size=64, |
| show_progress_bar=True, |
| ) |
| |
| # 3. FAISS index |
| index = faiss.IndexFlatIP(embeddings.shape[1]) |
| faiss.normalize_L2(embeddings) |
| index.add(embeddings) |
| |
| # 4. Query |
| def retrieve(query, k=5): |
| q_emb = encoder.encode([query]) |
| faiss.normalize_L2(q_emb) |
| _, ids = index.search(q_emb, k) |
| return [ds[int(i)] for i in ids[0]] |
| |
| # 5. Call Daoism LLM with retrieved context |
| client = OpenAI(base_url="http://localhost:8000/v1", api_key="dummy") |
| |
| def ask(question): |
| hits = retrieve(question, k=5) |
| context = "\n\n---\n\n".join( |
| f"### {h['name']}\n{h['summary']}\n\n{h['content'][:1500]}" |
| for h in hits |
| ) |
| response = client.chat.completions.create( |
| model="Daoism-Qwen3.5-9B", |
| messages=[ |
| {"role": "system", "content": f"你是道教智慧 AI。請以下列館藏資料為基礎回答:\n\n{context}"}, |
| {"role": "user", "content": question}, |
| ], |
| max_tokens=2048, |
| ) |
| return response.choices[0].message.content |
| |
| print(ask("城隍信仰與道教有什麼關係?")) |
| ``` |
|
|
| ## Alternative: Use lius.cc RAG API (no local indexing needed) |
|
|
| If you don't want to build your own FAISS index, use our public RAG endpoint (rate limit 30 req/min): |
|
|
| ```python |
| import requests |
| |
| def retrieve(query, n=5): |
| r = requests.post( |
| "https://lius.cc/api/llm-rag", |
| json={"q": query, "n": n}, |
| timeout=10, |
| ) |
| return r.json()["hits"] |
| ``` |
|
|
| ## Licensing & Attribution |
|
|
| - **License**: Apache 2.0 |
| - **Source**: [Dingren Daoxue Lab](https://lius.cc) by Liu Chi-Ying (Daoist priest, 2026) |
| - **Citation**: please cite as below |
|
|
| ```bibtex |
| @dataset{daoism-knowledge-rag-2026, |
| author = {Liu, Chi-Ying and Dingren Daoxue Lab}, |
| title = {Daoism Knowledge RAG: Curated Taoist Knowledge Base for Retrieval-Augmented Generation}, |
| year = {2026}, |
| publisher = {HuggingFace}, |
| url = {https://huggingface.co/datasets/lius-cc/daoism-knowledge-rag}, |
| } |
| ``` |
|
|
| ## Related |
|
|
| - 🤖 **Model**: [`lius-cc/Daoism-Qwen3.5-9B`](https://huggingface.co/lius-cc/Daoism-Qwen3.5-9B) (fp16) / [GGUF](https://huggingface.co/lius-cc/Daoism-Qwen3.5-9B-GGUF) |
| - 🌐 **Live Demo**: [demo.lius.cc](https://demo.lius.cc) (uses this dataset via RAG) |
| - 📚 **Deployment Guide**: [lius.cc/llm](https://lius.cc/llm) |
|
|
| ## Limitations |
|
|
| - All content is in Traditional Chinese (Taiwan) |
| - Some entries refer to internal lius.cc `[[wiki-link]]` syntax; treat as plain text in your RAG |
| - Coverage focuses on **正一道、閭山派、台灣民間信仰**; mainland Quanzhen tradition less represented |
| - Some concept entries may overlap; deduplicate by `name` if needed for your use case |
|
|
| ## Disclaimer |
|
|
| This dataset is for research and educational purposes. Religious practices should not be undertaken solely based on AI-retrieved content; consult qualified Daoist priests for ceremonial guidance. |
|
|