← Back to Skills Marketplace
huajianjiu000

knowledge-base-qa-assistant

by huajianjiu · GitHub ↗ · v1.0.0 · MIT-0
cross-platform ✓ Security Clean
130
Downloads
0
Stars
0
Active Installs
1
Versions
Install in OpenClaw
/install knowledge-base-qa-assistant
Description
Build private knowledge bases for AI-powered document Q&A. Supports PDF, Word, TXT, Markdown uploads with smart chunking and vector retrieval. Automatically...
README (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
Usage Guidance
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.
Capability Analysis
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.
Capability Tags
cryptocan-make-purchasesrequires-oauth-tokenrequires-sensitive-credentials
Capability Assessment
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.
How to Use
  1. Make sure OpenClaw is installed (local or Docker)
  2. Run the install command in chat: /install knowledge-base-qa-assistant
  3. After installation, invoke the skill by name or use /knowledge-base-qa-assistant
  4. Provide required inputs per the skill's parameter spec and get structured output
Version History
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
Metadata
Slug knowledge-base-qa-assistant
Version 1.0.0
License MIT-0
All-time Installs 0
Active Installs 0
Total Versions 1
Frequently Asked Questions

What is 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... It is an AI Agent Skill for Claude Code / OpenClaw, with 130 downloads so far.

How do I install knowledge-base-qa-assistant?

Run "/install knowledge-base-qa-assistant" in the OpenClaw or Claude Code chat to install it in one step — no extra setup required.

Is knowledge-base-qa-assistant free?

Yes, knowledge-base-qa-assistant is completely free, licensed under MIT-0. You can download, install and use it at no cost.

Which platforms does knowledge-base-qa-assistant support?

knowledge-base-qa-assistant is cross-platform and runs anywhere OpenClaw / Claude Code is available (cross-platform).

Who created knowledge-base-qa-assistant?

It is built and maintained by huajianjiu (@huajianjiu000); the current version is v1.0.0.

💬 Comments