QuantumKuba/dsh-graphify-plugin1

dsh-graphify

Native Graphify knowledge graph plugin for DeepSeek Harness (DSH)

包名
dsh-graphify
版本
0.1.0
许可证
MIT
最近更新
2026年8月31日

安装

$npx -p @deepseek-ai/dsh dsh plugin --profile web add github:QuantumKuba/dsh-graphify-plugin

Step 4: Enable the Plugin in Configuration

Option A: Bundle Patch (cordis.patch.yml)

If you use DSH bundle layers, add the plugin patch:

- insert:
    - id: graphify
      name: dsh-graphify
      config:
        autoDetect: true
        enablePromptSection: true
        timeoutMs: 60000

Option B: Application Config (cordis.yml)

If you configure plugins in your profile cordis.yml:

plugins:
  dsh-graphify:
    autoDetect: true
    enablePromptSection: true
    timeoutMs: 60000

Option C: Programmatic Mounting

In a custom Cordis runtime application:

import { Context } from '@deepseek-ai/cordis'
import * as GraphifyPlugin from 'dsh-graphify'

const ctx = new Context()
await ctx.plugin(GraphifyPlugin, {
  autoDetect: true,
  enablePromptSection: true,
})

Configuration Reference

Options can be defined in cordis.yml, cordis.patch.yml, or passed to ctx.plugin():

OptionTypeDefaultDescription
commandstring'graphify'CLI executable command (auto-resolves uv or python3 -m graphify.serve).
argsstring[]['serve', '--transport', 'stdio']Subprocess arguments for the Graphify MCP server.
graphPathstringundefinedExplicit path to graph.json (bypasses auto-detection when set).
autoDetectbooleantrueProbes parent directories for graphify-out/graph.json.
enablePromptSectionbooleantrueInjects knowledge graph guidance into the agent system prompt.
timeoutMsnumber60000Cooperative timeout per tool execution in milliseconds.
serverNamestring'graphify'Stable identifier used for server registration and logs.
toolPrefixstring''Optional prefix for registered tools (e.g. 'kg_' -> 'kg_query_graph').
cwdstringundefinedWorking directory for the Graphify subprocess.

Programmatic Usage

You can also use the underlying GraphifyMcpClient or detectGraph utilities independently:

import { GraphifyMcpClient, detectGraph } from 'dsh-graphify'

// 1. Detect existing graph
const detected = detectGraph(process.cwd())
console.log('Detected graph:', detected?.graphJsonPath)

// 2. Initialize MCP client
const client = new GraphifyMcpClient({
  command: 'uv',
  args: ['run', '--with', 'graphifyy', '--with', 'mcp', '-m', 'graphify.serve', detected?.graphJsonPath || ''],
  cwd: process.cwd(),
})

// 3. Execute queries
const stats = await client.callTool('graph_stats', {})
console.log(stats)

// 4. Dispose client when done
await client.dispose()