refactor(mcp-go): 拆除 search.Hybrid 残骸(T4.F)
- search.Hybrid 空转(NewHybrid 返空、Query 返 nil TODO)、构造后存进 Gateway 却从不被调用(真实 RAG 走 rag.Engine)→ 纯误导性死重量 - 删 internal/search 包 + gateway.go 字段/构造参数 + main.go 接线 - build/vet 干净;wiki_search 不受影响(本就用 g.rag) Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>
This commit is contained in:
@@ -15,7 +15,6 @@ import (
|
||||
"github.com/sundynix/sundynix-mcp-go/internal/mcp"
|
||||
"github.com/sundynix/sundynix-mcp-go/internal/memory"
|
||||
"github.com/sundynix/sundynix-mcp-go/internal/rag"
|
||||
"github.com/sundynix/sundynix-mcp-go/internal/search"
|
||||
|
||||
"github.com/sundynix/sundynix-shared/otelx"
|
||||
"github.com/sundynix/sundynix-shared/prompts"
|
||||
@@ -58,8 +57,7 @@ func main() {
|
||||
defer b.Close()
|
||||
log.Printf("[mcp_go] connected %s", natsURL)
|
||||
|
||||
engine := search.NewHybrid() // LLM Wiki 混合检索:Bleve + Milvus + Neo4j
|
||||
mem := memory.Open(pgDSN) // 偏好记忆:sundynix_user_profile(连不上则降级)
|
||||
mem := memory.Open(pgDSN) // 偏好记忆:sundynix_user_profile(连不上则降级)
|
||||
defer mem.Close()
|
||||
hist := history.Open(redisAddr) // 会话短期历史:Redis(连不上则降级)
|
||||
defer hist.Close()
|
||||
@@ -104,7 +102,7 @@ func main() {
|
||||
log.Printf("[mcp_go] subscribe prompts: %v", err)
|
||||
}
|
||||
|
||||
gw := mcp.NewGateway(b, engine, mem, hist, ragEngine, pgDSN)
|
||||
gw := mcp.NewGateway(b, mem, hist, ragEngine, pgDSN)
|
||||
|
||||
log.Println("[mcp_go] serving MCP over sundynix.tools.go.* (Ctrl-C to quit)")
|
||||
if err := gw.Serve(ctx); err != nil && err != context.Canceled {
|
||||
|
||||
Reference in New Issue
Block a user