Introduction

The plugin mechanism in DeepSeek Harness (DSH) allows developers to extend its core functionality. dsh-workspace-api is designed to answer the question of “how to expose DSH workspace content and agent task capabilities to external systems.” It does not rely on complex vector databases or index construction; instead, it directly leverages the real-time retrieval capability of AI agents to provide enterprises and developers with a lightweight entry point for enterprise knowledge Q&A.

What Is This

This is an enterprise knowledge Q&A Agent plugin, maintained by liaoyonghong and released under the MIT license.

Its core value is turning enterprise documents (contracts, manuals, policies, etc.) into a conversational chatbot. The system does not require a prebuilt index; the AI agent retrieves and reads documents in real time based on the user’s natural-language questions, then provides accurate answers with source citations. It also provides a complete HTTP API for file directory management (listing, tree view, search, and reading), making it easy for third-party applications to integrate.

Installation and Activation

To install this plugin, run the following command via the DSH CLI:

dsh plugin --profile web add dsh-workspace-api

After installation is complete, restart the dsh web process to activate the plugin.

Core Features

The plugin mainly provides two types of capabilities:
1. Knowledge Q&A: Supports natural-language questions and returns citations with file names and line numbers.
2. File Management: Provides HTTP interfaces for external systems to query the directory tree, search for files, or read file content.

Typical Usage

Ask Directly

Ask directly in the chat box on the DSH Web interface. For example:

“According to the company documents, what is the reimbursement limit for hotel accommodation?”

Ask via API

Call it through the HTTP interface. By default, the plugin runs on the DSH Web port (default 127.0.0.1:3080), with the path prefix /workspace-api.

Synchronous request example (wait for the answer):

curl -X POST -H "Content-Type: application/json" \
  -d '{"prompt":"根据企业文档,酒店住宿报销上限是多少?"}' \
  "http://127.0.0.1:3080/workspace-api/task?wait=1"

Example response:

{
  "ok": true,
  "task": {
    "status": "done",
    "result": "酒店报销上限:标准间每晚上限 HK$1200(出处:报销政策.md 第 3 行)",
    "exitCode": 0
  }
}

Configuration and Security

The plugin provides the following environment variables for configuration and enhanced security:

  • WORKSPACE_API_ROOT: Specifies the document root directory. The default is the current DSH workspace.
  • TOKEN: Access token. By default, it listens only on 127.0.0.1. If you need to expose it externally, be sure to set TOKEN and include Authorization: Bearer your-secret-token in the request header.

Use Cases and Notes

  • Use cases: Internal knowledge base Q&A, contract clause lookup, system operation guidance, onboarding training assistance, and more.
  • Performance characteristics: Based on real-time retrieval by the AI agent, no index is required. It works best with up to a few dozen documents. For very large corpora, consider adding RAG vector retrieval.
  • Document formats: Supports txt, md, PDF, Word, and Excel. Scanned PDFs must first be converted to text (OCR) to be searchable.
  • Security: All paths are validated against real paths to prevent directory traversal attacks; the task agent has DSH file capabilities and should only be used by trusted callers.

Conclusion

dsh-workspace-api provides a solution for standardizing the output of document capabilities within the DSH plugin ecosystem. With simple configuration and API calls, you can quickly build an intelligent Q&A assistant for internal enterprise use.