Local Knowledge Base Q&A
Paste the following prompt into your AI chat to install this skill:
Please follow https://skillhub.cn/install/skillhub.md and install @user_4c392ef3/knowledge-qa.
About this skill
Problem
Local notes are often scattered across raw_docs/, PDF, Word, and Markdown files. Search relies on folder names and memory, so relevant material can be missed. When topics are mixed together, answers can also be polluted by unrelated documents. This skill maps multiple topic folders in the same working directory to isolated DashVector Collections, such as MySQLNotes and JavaNotes, so QA, uploads, and partition management stay scoped to the selected knowledge base.
How It Works
The skill runs around four scripts:
- init_knowledge_base.py creates the knowledge base folder, config.json, and raw_docs/ structure, making it easier to create the base before adding documents.
- upload_to_vector.py scans documents, diffs indexed_files.json, extracts and chunks text, generates embeddings with Bailian, uploads vectors to DashVector, and creates partitions automatically.
- query_knowledge_base.py queries by knowledge base and partitions, merges similarity results, reads source documents for additional context, and adds web research when needed.
- partition_list.py checks partition status, helping confirm whether uploads landed as expected.
The key mechanism is partition routing: raw_docs/mysql/ maps to the mysql partition, while raw_docs/MySQL实战/ normalizes to mysql_, with non-alphanumeric characters converted to underscores. Multi-partition queries use repeated sequential queries and then merge results because DashVector's partition parameter accepts a single string. Final output includes a Markdown report under reports/ and an interactive mind map under mindmaps/.
Boundaries
It requires DashVector and Bailian API keys plus Python 3.8+. It fits internal document QA, knowledge organization, review notes, and report generation, but it is not a replacement for production-grade access control, collaborative editing, audit logs, or high-concurrency search. Upload failures usually require checking the API key, endpoint, collection name, and partition field; if the knowledge base is empty, put documents into raw_docs/ first.
Use Cases
- Maintain local MySQL and Oracle notes, upload `raw_docs/mysql/` and `raw_docs/oracle/` as partitions, then query them.
- Index new PDF, Word, and Markdown manuals from `raw_docs`, then answer by reading source sections for context.
- Prepare technical review materials by generating a Markdown report and a three-level interactive mind map.
- Verify generated partitions after upload and confirm `raw_docs` subfolders map to expected partition names.
Best For
- Engineers maintaining local technical notes: create topic-specific bases and query by names like `MySQLNotes`.
- Documentation managers organizing PDF and Word files: map `raw_docs/` subfolders to partitions and check status.
- Knowledge engineers writing technical reports: generate Markdown reports and interactive mind maps from results.
- WorkBuddy workspace users using AI apps: initialize, upload, query, and inspect knowledge base partitions.
Related Skills
Use a book title and author to search reviews, contents, and reader feedback, then generate a structured breakdown of historical or decision-logic books with key claims, concepts, quotes, and reading notes in Obsidian.
A multi-system divination advisor covering Bazi, Ziwei, tarot, feng shui, timing, and naming with structured interpretations.
Provides Bazi, Liu Yao, Qimen, Meihua, and date-selection guidance from classical references, with plain-language explanations and actionable suggestions.
A fast CLI for summarizing URLs, local files, and YouTube links with multi-model support, length control, and JSON output.