QuantumKuba/dsh-graphify-plugin ↗★ 1
dsh-graphify
Native Graphify knowledge graph plugin for DeepSeek Harness (DSH)
安装
$
npx -p @deepseek-ai/dsh dsh plugin --profile web add github:QuantumKuba/dsh-graphify-plugin说明文档
阅读完整 README ↗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():
| Option | Type | Default | Description |
|---|---|---|---|
command | string | 'graphify' | CLI executable command (auto-resolves uv or python3 -m graphify.serve). |
args | string[] | ['serve', '--transport', 'stdio'] | Subprocess arguments for the Graphify MCP server. |
graphPath | string | undefined | Explicit path to graph.json (bypasses auto-detection when set). |
autoDetect | boolean | true | Probes parent directories for graphify-out/graph.json. |
enablePromptSection | boolean | true | Injects knowledge graph guidance into the agent system prompt. |
timeoutMs | number | 60000 | Cooperative timeout per tool execution in milliseconds. |
serverName | string | 'graphify' | Stable identifier used for server registration and logs. |
toolPrefix | string | '' | Optional prefix for registered tools (e.g. 'kg_' -> 'kg_query_graph'). |
cwd | string | undefined | Working 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()