ChatDOC Studio--KnowledgeMate
Create and operate ChatDOC Studio knowledge bases through pd_router using a Bearer API key and JavaScript helpers. Use when Codex needs to upload one or more...
PAODINGAI
@paodingai
What This Skill Does
Uploads local PDF, DOC, and DOCX files to ChatDOC Studio, waits for parsing, and creates a knowledge base in one step. Also supports querying, listing documents, retrieving stats, grep search, syllabus reading, and block reading on existing knowledge bases.
Replaces manually uploading files to ChatDOC Studio and separately creating knowledge bases by combining both steps into a single command that skips failed files without aborting the batch.
When to Use It
- Create a knowledge base from a folder of PDF and DOCX documents
- Upload multiple files and skip any that fail to parse without stopping the whole job
- Query an existing knowledge base with a natural language question
- List all documents inside a knowledge base to see what was uploaded
- Search document content with a grep pattern across uploaded files
- Read specific blocks or the syllabus of a document within a knowledge base
Install
$ openclaw skills install @paodingai/chatdoc-studio-knowledgemateChatDOC Studio KnowledgeMate
Run a JavaScript workflow that uploads local PDF/DOC/DOCX files to ChatDOC Studio through PDRouter, waits for successful parsing, and creates a knowledge base from the successful uploads in one step.
This is suitable for creating knowledge bases from local files or folders, then using the returned library_id for document listing, retrieval, grep, syllabus reading, and block reading.
Installation
npx skills add PaodingAI/skills
For a local Codex installation, place this skill directory under:
$CODEX_HOME/skills/chatdoc-studio-knowledgemate
Usage
Create a knowledge base from files:
node scripts/knowledge-mate.mjs upload-and-create \
--name "Quarterly KB" \
--file ./docs/a.pdf \
--file ./docs/b.docx \
--file ./docs/c.pdf
Create a knowledge base from a folder recursively:
node scripts/knowledge-mate.mjs upload-and-create \
--name "Quarterly KB" \
--dir ./docs
Query an existing knowledge base:
node scripts/knowledge-mate.mjs retrieval --library-id <id> --query <text>
node scripts/knowledge-mate.mjs list-documents --library-id <id>
node scripts/knowledge-mate.mjs stats --library-id <id> --upload-id <id>
node scripts/knowledge-mate.mjs grep --library-id <id> --upload-id <id> --pattern <text>
node scripts/knowledge-mate.mjs read --library-id <id> --upload-id <id> --offset <n>
node scripts/knowledge-mate.mjs read-syllabus --library-id <id> --upload-id <id>
Execution Constraints
- You must invoke
scripts/knowledge-mate.mjsdirectly. Do not reimplement the PDRouter or ChatDOC Studio API flow yourself during normal use. - Route every request through PDRouter at
/openapi/chatdoc-studio/.... - Authenticate only with
Authorization: Bearer <PAODINGAI_API_KEY>. - Do not call
chatdoc_studiodirectly. - Do not add internal
X-PD-*signature headers in this skill. - Do not expose or use separate upload-only or create-only commands; use
upload-and-createfor new knowledge bases. - Only inspect or modify the script implementation when the script itself is unavailable, failing, or needs a fix.
- The behavior contract below explains what the script does, what it outputs, and when to use it. It is not a manual checklist for the model to imitate step by step.
When to Use
- Use this skill when the user wants to create a ChatDOC Studio knowledge base from local PDF, DOC, or DOCX files.
- Use this skill when the user provides a folder and asks to build a knowledge base from the documents inside it.
- Use this skill when the user wants knowledge retrieval, document search, document stats, syllabus inspection, or reading specific document blocks from a ChatDOC Studio knowledge base.
- Use this skill when the workflow must skip failed or unsupported files without aborting the entire upload batch.
- Use this skill only for PDRouter-backed ChatDOC Studio skill APIs, not for direct ChatDOC Studio internal APIs.
Environment Variables
PAODINGAI_API_KEY: Required. The Bearer API key for PDRouter. If it is missing, the script fails immediately and tells the user to create a Bearer API Key in pdrouter, then export it before retrying.
The PDRouter base URL is fixed in the script as https://platform.paodingai.com. The service code is fixed in the script as chatdoc-studio; users do not need to set base-url or service-code environment variables.
The API key can be obtained from the PDRouter platform.
Default Behavior and Optional Settings
- Upload concurrency is fixed at
5. - Supported upload file types are
.pdf,.doc, and.docx. --diris scanned recursively.--fileand--dircan be mixed in one command.- Duplicate file paths are removed before upload.
- Unsupported file types are not uploaded and are reported as skipped failures.
- If more than
300supported files are found, the script stops before uploading and asks the user to clean the folder to at most300PDF/DOC/DOCX files. - If every file fails to upload or parse, knowledge-base creation is skipped and the script exits with a non-zero status.
Script Behavior
- Read
PAODINGAI_API_KEYfrom the environment and use the fixed PDRouter base URLhttps://platform.paodingai.com. - Expand all
--fileinputs and recursively scanned--dirinputs into one de-duplicated file list. - Count supported
.pdf,.doc, and.docxfiles before uploading. If the count is greater than300, fail immediately without uploading anything. - Upload supported files through
POST /openapi/chatdoc-studio/knowledge-base/uploadwith concurrency5. - Skip unsupported files, upload failures, parse failures, and per-file backend errors without aborting the whole batch.
- Call
POST /openapi/chatdoc-studio/knowledge-baseonly with successfulupload_ids. - Print JSON output. Successful API responses are unwrapped to their
datapayload. Failed requests print a clear error reason and include the backend response when available. - After
upload-and-createreturns alibrary_id, use the read/query commands for retrieval, listing documents, stats, grep, syllabus reading, or block reading.
Resources
- Run scripts/knowledge-mate.mjs instead of rewriting the HTTP client by hand.
Top skills in this category
Humanizer
@biostartechnologyRemove signs of AI-generated writing from text. Use when editing or reviewing text to make it sound more natural and human-written. Based on Wikipedia's comprehensive "Signs of AI writing" guide. Detects and fixes patterns including: inflated symbolism, promotional language, superficial -ing analyses, vague attributions, em dash overuse, rule of three, AI vocabulary words, negative parallelisms, and excessive conjunctive phrases.
Elite Longterm Memory
@nextfrontierbuildsUltimate AI agent memory system for Cursor, Claude, ChatGPT & Copilot. WAL protocol + vector search + git-notes + cloud backup. Never lose context again. Vibe-coding ready.
Model Usage
@steipeteUse CodexBar CLI local cost usage to summarize per-model usage for Codex or Claude, including the current (most recent) model or a full model breakdown. Trigger when asked for model-level usage/cost data from codexbar, or when you need a scriptable per-model summary from codexbar cost JSON.
Answer Overflow
@rhyssullivanSearch indexed Discord community discussions via Answer Overflow. Find solutions to coding problems, library issues, and community Q&A that only exist in Discord conversations.
Summarize Pro
@mkpareek0315When user asks to summarize text, articles, documents, meetings, emails, YouTube transcripts, books, PDFs, reports, conversations, or any long content. Also...