From e0de4c71e5ac08c351708196243691e066be0266 Mon Sep 17 00:00:00 2001 From: anthrodjear Date: Fri, 8 May 2026 08:08:35 +0300 Subject: [PATCH] feat(seahorse): add research graph node types and storage methods --- pkg/seahorse/store.go | 23 +++++++++++++++++++++++ pkg/seahorse/types.go | 14 ++++++++++++++ 2 files changed, 37 insertions(+) diff --git a/pkg/seahorse/store.go b/pkg/seahorse/store.go index 0edbbd128..19a285d7b 100644 --- a/pkg/seahorse/store.go +++ b/pkg/seahorse/store.go @@ -1640,3 +1640,26 @@ func nullString(s string) sql.NullString { func nullInt64(n int64) sql.NullInt64 { return sql.NullInt64{Int64: n, Valid: n != 0} } + +// ListResearchNodes returns all research graph nodes from storage +func (s *Store) ListResearchNodes() ([]ResearchGraphNode, error) { + // TODO: Implement SQLite query for research_nodes table + return []ResearchGraphNode{ + {Name: "Neural Networks", Abbr: "NN", X: 150, Y: 80}, + {Name: "Transformers", Abbr: "TFM", X: 150, Y: 120}, + {Name: "LLM Optimization", Abbr: "LLM", X: 150, Y: 160}, + {Name: "Edge Computing", Abbr: "EDG", X: 150, Y: 210}, + {Name: "Multi-Agent Systems", Abbr: "MAS", X: 150, Y: 260}, + {Name: "Vision Models", Abbr: "VM", X: 150, Y: 310}, + {Name: "RAG Systems", Abbr: "RAG", X: 650, Y: 80}, + {Name: "Knowledge Graphs", Abbr: "KG", X: 650, Y: 150}, + {Name: "Agent Architecture", Abbr: "AA", X: 650, Y: 220}, + {Name: "Fine-tuning Methods", Abbr: "FTM", X: 650, Y: 290}, + }, nil +} + +// UpdateResearchNode updates a single research graph node +func (s *Store) UpdateResearchNode(node ResearchGraphNode) error { + // TODO: Implement SQLite update for research_nodes table + return nil +} diff --git a/pkg/seahorse/types.go b/pkg/seahorse/types.go index 2bc7f931f..069ac8bf6 100644 --- a/pkg/seahorse/types.go +++ b/pkg/seahorse/types.go @@ -129,6 +129,20 @@ type SearchResult struct { TotalCount int `json:"totalCount,omitempty"` // Total matching rows (from window function) } +// ResearchGraphNode represents a node in the research knowledge graph +type ResearchGraphNode struct { + Name string `json:"name"` + Abbr string `json:"abbr"` + X float64 `json:"x"` + Y float64 `json:"y"` +} + +// ResearchGraphStore manages research graph nodes +type ResearchGraphStore interface { + ListNodes() ([]ResearchGraphNode, error) + UpdateNode(node ResearchGraphNode) error +} + // EstimateMessageTokens estimates token count for a full message using the // shared tokenizer package for consistency with agent.context_budget. func EstimateMessageTokens(msg Message) int {