feat(graph-rag): UI fuer Wissens-Graph mit BFS-Traversierung — Modul 11/16 des UI-Backlogs
Check Cross-Plugin Imports / check (push) Has been cancelled

This commit is contained in:
Agent Zero
2026-09-15 08:25:21 +02:00
parent 4eba9eb1d9
commit 0404c8f5dc
8 changed files with 876 additions and 5 deletions
+55
View File
@@ -104,6 +104,45 @@ export interface GraphRelationshipsResult {
total: number;
}
export interface GraphRelationshipCreate {
source_type: string;
source_id: string;
target_type: string;
target_id: string;
relationship_type: string;
metadata?: Record<string, unknown> | null;
}
export interface GraphNode {
entity_type: string;
entity_id: string;
depth: number;
path: string[];
}
export interface GraphEdge {
source_type: string;
source_id: string;
target_type: string;
target_id: string;
relationship_type: string;
metadata: Record<string, unknown> | null;
}
export interface GraphTraverseRequest {
source_type: string;
source_id: string;
max_hops?: number;
relationship_types?: string[] | null;
}
export interface GraphTraverseResult {
nodes: GraphNode[];
edges: GraphEdge[];
total_nodes: number;
total_edges: number;
}
// ─── Ask Knowledge types ───────────────────────────────────────────────────
export interface KnowledgeAskRequest {
@@ -203,6 +242,22 @@ export async function fetchGraphRelationships(params?: {
return apiGet<GraphRelationshipsResult>(`/graph/relationships${qs ? `?${qs}` : ''}`);
}
export async function createGraphRelationship(
data: GraphRelationshipCreate,
): Promise<GraphRelationship> {
return apiPost<GraphRelationship>('/graph/relationships', data);
}
export async function deleteGraphRelationship(relationshipId: string): Promise<void> {
await apiDelete<void>(`/graph/relationships/${relationshipId}`);
}
export async function traverseGraph(
body: GraphTraverseRequest,
): Promise<GraphTraverseResult> {
return apiPost<GraphTraverseResult>('/graph/traverse', body);
}
// ─── Ask Knowledge API ─────────────────────────────────────────────────────
export async function askKnowledge(body: KnowledgeAskRequest): Promise<KnowledgeAskResponse> {