← 返回 Skills 市场
huajianjiu000

knowledge-base-qa-assistant

作者 huajianjiu · GitHub ↗ · v1.0.0 · MIT-0
cross-platform ✓ 安全检测通过
130
总下载
0
收藏
0
当前安装
1
版本数
在 OpenClaw 中安装
/install knowledge-base-qa-assistant
功能描述
Build private knowledge bases for AI-powered document Q&A. Supports PDF, Word, TXT, Markdown uploads with smart chunking and vector retrieval. Automatically...
使用说明 (SKILL.md)

Knowledge Base QA Assistant

📚 Build a private knowledge base for AI-powered document Q&A

Skill Overview

This skill helps AI Agents build and manage private knowledge bases, supporting document uploads (PDF, Word, TXT, Markdown, etc.), then providing precise Q&A based on the knowledge base content. Ideal for enterprise knowledge management, product documentation Q&A, and customer service knowledge bases.

Core Capabilities

  • Multi-format Support: PDF, Word, TXT, Markdown, Excel, PPT, and more
  • Smart Chunking: Automatically split long documents into semantically complete chunks
  • Vector Retrieval: Precise matching based on semantic similarity
  • Source Citation: Automatically cite reference sources in answers
  • Batch Upload: Support batch upload of multiple documents

Trigger Keywords

  • /knowledge-qa
  • /upload-document
  • /document-qa
  • /knowledge-base-manage
  • /doc-question
  • /rag-qa

How to Use

Step 1: Build Knowledge Base

User uploads documents to build knowledge base:

User: Please upload this product document to the knowledge base
Agent: Please provide the document content or upload file

User: [Upload PDF file]
Agent: ✅ Document uploaded to knowledge base successfully!
     
     Document Name: Product Manual.pdf
     File Size: 2.5MB
     Pages: 45
     Status: Indexed, ready for Q&A
     
     Knowledge Points Extracted: 23
     Knowledge Chunks: 12

Step 2: Knowledge Base Q&A

User: What payment methods does the product support?
Agent: Searching knowledge base...
     
     ✅ Found relevant information!
     
     Answer: The product supports the following payment methods:
     
     1. **Online Payment**
        - PayPal
        - Stripe
        - Credit Card (Visa, MasterCard supported)
     
     2. **Offline Payment**
        - Bank Transfer
        - Wire Transfer
     
     📎 Reference: Product Manual Section 3.2, Published: 2024-01-15

Knowledge Base Commands

Command Function
/knowledge-list View all documents in knowledge base
/delete-doc [filename] Delete specified document
/knowledge-stats View knowledge base statistics
/clear-knowledge Clear all documents (requires confirmation)

Knowledge Base Structure

Document Storage

knowledge_base/
├── documents/
│   ├── doc_001/
│   │   ├── original.pdf          # Original document
│   │   └── metadata.json          # Metadata
│   ├── doc_002/
│   │   ├── content.txt           # Extracted text
│   │   └── metadata.json
│   └── ...
└── index/
    └── vector_index.json          # Vector index

Metadata Format

{
  "doc_id": "doc_001",
  "filename": "Product Manual.pdf",
  "upload_time": "2024-01-20T10:30:00Z",
  "file_size": "2.5MB",
  "page_count": 45,
  "chunk_count": 12,
  "status": "indexed",
  "tags": ["product", "user-guide", "features"]
}

Retrieval Flow

User Question
    ↓
Question Embedding
    ↓
Vector Similarity Matching
    ↓
Top-K Relevant Chunks
    ↓
Build Prompt Context
    ↓
LLM Generate Answer
    ↓
Add Citation
    ↓
Return Answer

Usage Examples

Example 1: Enterprise Knowledge Base Q&A

User: What is the company's remote work policy?
Agent: Searching knowledge base...
     
     ✅ Found relevant information!
     
     From Employee Handbook 2024, Chapter 4, Section 2:
     
     **Remote Work Policy:**
     
     | Employee Type | Remote Days | Requirements |
     |---------------|-------------|--------------|
     | Full-time | 3 days/week | Manager approval |
     | Part-time | 2 days/week | Core hours required |
     | Contract | Case-by-case | HR consultation |
     
     📎 Reference: Employee Handbook 2024, Chapter 4, Section 2

Example 2: Technical Documentation Q&A

User: How to configure OAuth2.0 login?
Agent: Searching technical docs...
     
     ✅ Found configuration guide!
     
     **OAuth2.0 Configuration Steps:**
     
     1. **Register Application**
        Register app with OAuth provider, get client_id and client_secret
     
     2. **Configure Callback URL**
        Set auth callback URL: https://your-app.com/callback
     
     3. **Implement Auth Flow**
        ```javascript
        const oauth = new OAuth2({
          clientId: 'your_client_id',
          clientSecret: 'your_client_secret',
          redirectUri: 'https://your-app.com/callback'
        });
        ```
     
     📎 Reference: Developer Documentation Section 5.2

Example 3: Batch Document Upload

User: I want to upload these 3 documents to the knowledge base:
1. Product Introduction.pdf
2. Technical Whitepaper.docx
3. FAQ.md

Agent: Batch uploading...
     ✅ Upload complete!
     
     | Document | Status | Knowledge Points |
     |----------|--------|-------------------|
     | Product Introduction.pdf | ✅ Success | 15 |
     | Technical Whitepaper.docx | ✅ Success | 28 |
     | FAQ.md | ✅ Success | 42 |
     
     📚 Knowledge Base Stats:
     - Total Documents: 3
     - Total Knowledge Points: 85
     - Knowledge Chunks: 12

Configuration Options

Retrieval Parameters

Parameter Default Description
top_k 5 Number of relevant chunks to return
similarity_threshold 0.7 Similarity threshold
max_tokens 2000 Maximum answer tokens
include_source true Whether to include source citation

Chunking Strategies

Strategy Use Case
Fixed Length General scenarios
Semantic Chunking Maintain semantic integrity
Paragraph Chunking Split by natural paragraphs

Notes

  1. Document Quality: Ensure documents are clear and well-formatted before upload
  2. Privacy Protection: Be careful when uploading sensitive documents
  3. Knowledge Updates: Re-upload documents when updated to refresh index
  4. Size Limit: Single upload recommended not exceeding 50MB
  5. Index Delay: Indexing takes ~1-5 minutes after upload

Use Cases

  • 🏢 Enterprise Knowledge Management: Employee handbooks, product docs, technical docs
  • 📖 Online Education: Course materials, textbook Q&A
  • 🛒 E-commerce Customer Service: Product FAQ, shopping guides
  • 💼 Legal Compliance: Contract terms, regulations interpretation
  • 🏥 Healthcare: Health guides, medication instructions

Technical Implementation

Core Components

knowledge_qa/
├── uploader.py          # Document upload module
├── parser.py           # Document parsing module
├── chunker.py          # Text chunking module
├── indexer.py          # Vector indexing module
├── retriever.py        # Retrieval module
└── generator.py        # Answer generation module

API Usage Example

# 1. Upload document
result = upload_document(file_path, knowledge_base_id)

# 2. Retrieve relevant knowledge
chunks = retrieve(query, top_k=5, threshold=0.7)

# 3. Generate answer
answer = generate_answer(question, context_chunks)

Changelog

v1.0.0 (2024-01-20)

  • Initial release
  • Support for PDF, Word, TXT, Markdown formats
  • Vector retrieval and RAG Q&A implemented
  • Source citation support

Author Info

  • Author: AI Agent Helper
  • Version: 1.0.0
  • Framework: OpenClaw
安全使用建议
This skill looks internally consistent, but it's instruction-only: it describes what to do without providing code or installers. Before you rely on it, confirm where uploaded documents and the vector index will actually be stored and who can access them (encryption at rest, access controls, retention policy). Verify what tooling will perform PDF/Word/PPT parsing and embeddings (local libraries versus third-party APIs). If embeddings or LLM calls go to an external provider, sensitive content could be sent off-host—make sure that matches your privacy requirements. Finally, never paste production secrets into chat; the OAuth client_id/client_secret example is illustrative and should not be supplied unless you intentionally integrate the skill with an OAuth provider.
功能分析
Type: OpenClaw Skill Name: knowledge-base-qa-assistant Version: 1.0.0 The skill bundle describes a standard Knowledge Base QA Assistant using Retrieval-Augmented Generation (RAG). The documentation in SKILL.md and metadata in _meta.json outline legitimate functionality for document indexing and semantic search without any evidence of malicious instructions, data exfiltration, or suspicious code execution patterns.
能力标签
cryptocan-make-purchasesrequires-oauth-tokenrequires-sensitive-credentials
能力评估
Purpose & Capability
The name/description match the SKILL.md instructions: upload documents, chunk text, build a vector index, and answer questions with citations. The described file storage layout and commands are coherent with a document-QA assistant. There are no unrelated environment variables, binaries, or config paths requested.
Instruction Scope
SKILL.md stays within the knowledge-base / RAG scope: it describes upload, chunking, indexing, retrieval, and answer generation. It references storing files under a local knowledge_base/ tree and shows an OAuth example in a code snippet (illustrative). It does not instruct reading unrelated system files or exfiltrating data. Note: the skill assumes the environment can parse PDFs, Word, Excel, PPT, etc., and perform embeddings/vector search; those implementation details are not specified here.
Install Mechanism
This is an instruction-only skill with no install spec and no code files, so nothing will be written to disk by the skill itself during installation. That minimizes install-time risk.
Credentials
No environment variables, credentials, or config paths are requested. Example snippets mention client_id/client_secret in a generic OAuth example, but the skill does not require those values itself—so there is no disproportionate credential request.
Persistence & Privilege
always is false and the skill is user-invocable; it does not request permanent/high privilege or attempt to modify other skills or system-wide configuration. Autonomous invocation is allowed (default) but not combined with other red flags.
如何使用
  1. 确保已安装 OpenClaw(本地或 Docker 部署)
  2. 在对话框中输入安装命令:/install knowledge-base-qa-assistant
  3. 安装完成后,直接呼叫该 Skill 的名称或使用 /knowledge-base-qa-assistant 触发
  4. 根据 Skill 的参数说明提供必要输入,即可获得结构化输出
版本历史
v1.0.0
Initial release of knowledge-base-qa-assistant. - Build private knowledge bases with PDF, Word, TXT, and Markdown uploads - Smart chunking and semantic vector retrieval for precise document Q&A - Automatic citation of sources in answers - Batch document upload and core knowledge base management commands - Ideal for enterprise, customer service, and technical documentation scenarios
元数据
Slug knowledge-base-qa-assistant
版本 1.0.0
许可证 MIT-0
累计安装 0
当前安装数 0
历史版本数 1
常见问题

knowledge-base-qa-assistant 是什么?

Build private knowledge bases for AI-powered document Q&A. Supports PDF, Word, TXT, Markdown uploads with smart chunking and vector retrieval. Automatically... 它是一个面向 Claude Code / OpenClaw 的 AI Agent Skill 插件,目前累计下载 130 次。

如何安装 knowledge-base-qa-assistant?

在 OpenClaw 或 Claude Code 对话框中运行命令「/install knowledge-base-qa-assistant」即可一键安装,无需额外配置。

knowledge-base-qa-assistant 是免费的吗?

是的,knowledge-base-qa-assistant 完全免费,采用 MIT-0 许可证,可自由下载、安装和使用。

knowledge-base-qa-assistant 支持哪些平台?

knowledge-base-qa-assistant 跨平台运行,可在任意部署了 OpenClaw / Claude Code 的环境中使用(cross-platform)。

谁开发了 knowledge-base-qa-assistant?

由 huajianjiu(@huajianjiu000)开发并维护,当前版本 v1.0.0。

💬 留言讨论