feat(graph): add observation graph with hybrid vector storage

- [x] Add golangci.yml configuration with fieldalignment linter
- [x] Implement observation graph structure with edge detection
- [x] Add LEANN-inspired hybrid vector storage with hub threshold
- [x] Implement graph-aware search with selective recomputation
- [x] Add auto-tuner for dynamic hub threshold adjustment
- [x] Add graph and vector metrics tracking and reporting
- [x] Extend configuration for graph parameters
- [x] Add graph rebuild background service with periodic updates
- [x] Add HTTP endpoints for graph stats and vector metrics
- [x] Update UI with advanced metrics sidebar panel
- [x] Implement AST-aware code chunking for Go, Python, TypeScript
This commit is contained in:
2026-01-07 18:51:40 +00:00
parent 4f4b4ac70f
commit 1ae8035470
24 changed files with 3143 additions and 47 deletions
+9 -1
View File
@@ -1,4 +1,4 @@
import type { Observation, UserPrompt, SessionSummary, Stats, FeedItem, ObservationFeedItem, PromptFeedItem, SummaryFeedItem, RelationWithDetails, RelationGraph, RelationStats } from '@/types'
import type { Observation, UserPrompt, SessionSummary, Stats, FeedItem, ObservationFeedItem, PromptFeedItem, SummaryFeedItem, RelationWithDetails, RelationGraph, RelationStats, GraphStats, VectorMetrics } from '@/types'
const API_BASE = '/api'
const DEFAULT_TIMEOUT = 10000 // 10 seconds
@@ -164,3 +164,11 @@ export async function fetchRelatedObservations(observationId: number, minConfide
export async function fetchRelationStats(signal?: AbortSignal): Promise<RelationStats> {
return fetchWithRetry<RelationStats>(`${API_BASE}/relations/stats`, { signal })
}
export async function fetchGraphStats(signal?: AbortSignal): Promise<GraphStats> {
return fetchWithRetry<GraphStats>(`${API_BASE}/graph/stats`, { signal })
}
export async function fetchVectorMetrics(signal?: AbortSignal): Promise<VectorMetrics> {
return fetchWithRetry<VectorMetrics>(`${API_BASE}/vector/metrics`, { signal })
}