一键导入
knowledge-graph
Code knowledge graphs and Graph RAG — entity extraction, relationship mapping, and natural-language queries over source repositories
用 Codex 或 Claude 帮你安装 复制这段 Prompt,粘贴到 Codex、Claude 或其他助手里,让它检查 Skill 页面并帮你完成安装。
菜单
Code knowledge graphs and Graph RAG — entity extraction, relationship mapping, and natural-language queries over source repositories
用 Codex 或 Claude 帮你安装 复制这段 Prompt,粘贴到 Codex、Claude 或其他助手里,让它检查 Skill 页面并帮你完成安装。
基于 SOC 职业分类
Self-improving research loops with hypothesis generation, experiment design, and result analysis
Full-stack research and code generation pipeline - research, code, and create
Natural language web UI control — element detection, targeted interaction, and automated form filling
Public opinion analysis and sentiment at scale — sentiment scoring, stance detection, and multi-dimensional bias measurement.
Meta-specialist that auto-discovers and scaffolds new specialists from trending GitHub repos
Safe multi-language code execution via alibaba/OpenSandbox
| name | knowledge_graph |
| display_name | Knowledge Graph Specialist |
| description | Code knowledge graphs and Graph RAG — entity extraction, relationship mapping, and natural-language queries over source repositories |
| version | 0.1.0 |
| source_repo | abhigyanpatwari/GitNexus |
| license | MIT |
| tier | core |
| capabilities | ["knowledge_graph","code_analysis","entity_linking","graph_rag"] |
| allowed_tools | ["build_graph","query_graph","find_relationships"] |
| output_formats | ["python_api","cli","mcp_server","agent_skill","rest_api"] |
knowledge_graph wraps patterns from
abhigyanpatwari/GitNexus for code
entity extraction and graph construction, and
topoteretes/cognee for Graph RAG retrieval.
Given a source artifact — repository URL, file path, or raw code — the specialist builds a directed knowledge graph of entities and relationships, then answers natural-language questions through graph traversal. Results are returned as ranked entity lists, relevance scores, and explicit relationship paths, ready for downstream reasoning or citation.
The specialist is stateless. Each :meth:execute call builds a fresh graph and
returns a self-contained result dict. Graph IDs can be passed across calls to query
a previously built graph without rebuilding.
| Tool | Description | Side Effects |
|---|---|---|
build_graph | Build a knowledge graph from a source artifact | None (v1 local; future: network/disk) |
query_graph | Query the graph with natural language; returns ranked entities and paths | None |
find_relationships | Find all paths between two named entities; returns types and strength | None |
intent.parameters)| Key | Type | Default | Description |
|---|---|---|---|
source | str | (query.user_input) | Repository URL, file path, or raw code to ingest |
graph_type | str | "code" | Entity strategy: code, document, or mixed |
max_depth | int | 3 | Maximum cross-file traversal depth |
query | str | (query.user_input) | Natural-language question to run against the graph |
max_results | int | 10 | Result cap for graph queries |
entity_a | str | None | Source entity for relationship search (optional) |
entity_b | str | None | Target entity for relationship search (optional) |
module, class, function, variable, import entities.
Best for source repository analysis and call-graph reasoning.concept, section, claim, reference entities.
Suited for technical documentation or research papers.{
"graph": {
"graph_id": str, # stable UUID for this graph instance
"node_count": int, # total entity nodes
"edge_count": int, # total directed relationship edges
"entity_types": list[str],# entity labels present in the graph
"graph_type": str, # echo of requested graph_type
},
"query_results": {
"results": list[dict], # ranked entity hits
"relevance_scores": list[float], # parallel relevance values 0-1
"paths": list[dict], # connecting relationship paths
"total_found": int, # total matches before max_results cap
},
# only present when entity_a and entity_b are supplied:
"relationships": {
"paths": list[dict], # all paths from entity_a to entity_b
"relationship_types": list[str], # deduplicated edge labels
"strength": float, # coupling strength 0-1
"path_count": int,
},
}
import asyncio
from agents.specialists.knowledge_graph.agent import KnowledgeGraphSpecialist
from oss_agent_lab.contracts import Intent, Query, SpecialistRequest
specialist = KnowledgeGraphSpecialist()
request = SpecialistRequest(
intent=Intent(
action="knowledge_graph",
domain="code_analysis",
confidence=0.9,
parameters={
"source": "https://github.com/abhigyanpatwari/GitNexus",
"graph_type": "code",
"max_depth": 3,
},
),
query=Query(user_input="Which functions call the authentication module?"),
specialist_name="knowledge_graph",
)
response = asyncio.run(specialist.execute(request))
print(response.result["graph"]["node_count"])
print(response.result["query_results"]["results"][0])
oss-lab run knowledge_graph "Which functions call the authentication module?"
request = SpecialistRequest(
intent=Intent(
action="knowledge_graph",
domain="code_analysis",
confidence=0.9,
parameters={
"source": "./src/",
"entity_a": "UserService",
"entity_b": "DatabaseAdapter",
},
),
query=Query(user_input="How does UserService depend on DatabaseAdapter?"),
specialist_name="knowledge_graph",
)
oss-lab run knowledge_graph "dependency chain for PaymentProcessor" \
--param source=https://github.com/owner/repo \
--param graph_type=code \
--param max_depth=5 \
--param entity_a=PaymentProcessor \
--param entity_b=DatabaseClient
Wraps abhigyanpatwari/GitNexus and topoteretes/cognee.