feat(embeddings): add embedding model support and related changes

* Introduced EmbeddingModel method in Client and Provider interfaces
* Updated InsertThought and SearchThoughts methods to handle embedding models
* Created embeddings table and updated match_thoughts function for model filtering
* Removed embedding column from thoughts table
* Adjusted permissions for new embeddings table
This commit is contained in:
Hein
2026-03-25 16:25:41 +02:00
parent c8ca272b03
commit cebef3a07c
19 changed files with 259 additions and 88 deletions

View File

@@ -32,87 +32,87 @@ func New(cfg config.MCPConfig, toolSet ToolSet) http.Handler {
Version: cfg.Version,
}, nil)
mcp.AddTool(server, &mcp.Tool{
addTool(server, &mcp.Tool{
Name: "capture_thought",
Description: "Store a thought with generated embeddings and extracted metadata.",
}, toolSet.Capture.Handle)
mcp.AddTool(server, &mcp.Tool{
addTool(server, &mcp.Tool{
Name: "search_thoughts",
Description: "Search stored thoughts by semantic similarity.",
}, toolSet.Search.Handle)
mcp.AddTool(server, &mcp.Tool{
addTool(server, &mcp.Tool{
Name: "list_thoughts",
Description: "List recent thoughts with optional metadata filters.",
}, toolSet.List.Handle)
mcp.AddTool(server, &mcp.Tool{
addTool(server, &mcp.Tool{
Name: "thought_stats",
Description: "Get counts and top metadata buckets across stored thoughts.",
}, toolSet.Stats.Handle)
mcp.AddTool(server, &mcp.Tool{
addTool(server, &mcp.Tool{
Name: "get_thought",
Description: "Retrieve a full thought by id.",
}, toolSet.Get.Handle)
mcp.AddTool(server, &mcp.Tool{
addTool(server, &mcp.Tool{
Name: "update_thought",
Description: "Update thought content or merge metadata.",
}, toolSet.Update.Handle)
mcp.AddTool(server, &mcp.Tool{
addTool(server, &mcp.Tool{
Name: "delete_thought",
Description: "Hard-delete a thought by id.",
}, toolSet.Delete.Handle)
mcp.AddTool(server, &mcp.Tool{
addTool(server, &mcp.Tool{
Name: "archive_thought",
Description: "Archive a thought so it is hidden from default search and listing.",
}, toolSet.Archive.Handle)
mcp.AddTool(server, &mcp.Tool{
addTool(server, &mcp.Tool{
Name: "create_project",
Description: "Create a named project container for thoughts.",
}, toolSet.Projects.Create)
mcp.AddTool(server, &mcp.Tool{
addTool(server, &mcp.Tool{
Name: "list_projects",
Description: "List projects and their current thought counts.",
}, toolSet.Projects.List)
mcp.AddTool(server, &mcp.Tool{
addTool(server, &mcp.Tool{
Name: "set_active_project",
Description: "Set the active project for the current MCP session.",
}, toolSet.Projects.SetActive)
mcp.AddTool(server, &mcp.Tool{
addTool(server, &mcp.Tool{
Name: "get_active_project",
Description: "Return the active project for the current MCP session.",
}, toolSet.Projects.GetActive)
mcp.AddTool(server, &mcp.Tool{
addTool(server, &mcp.Tool{
Name: "get_project_context",
Description: "Get recent and semantic context for a project.",
}, toolSet.Context.Handle)
mcp.AddTool(server, &mcp.Tool{
addTool(server, &mcp.Tool{
Name: "recall_context",
Description: "Recall semantically relevant and recent context.",
}, toolSet.Recall.Handle)
mcp.AddTool(server, &mcp.Tool{
addTool(server, &mcp.Tool{
Name: "summarize_thoughts",
Description: "Summarize a filtered or searched set of thoughts.",
}, toolSet.Summarize.Handle)
mcp.AddTool(server, &mcp.Tool{
addTool(server, &mcp.Tool{
Name: "link_thoughts",
Description: "Create a typed relationship between two thoughts.",
}, toolSet.Links.Link)
mcp.AddTool(server, &mcp.Tool{
addTool(server, &mcp.Tool{
Name: "related_thoughts",
Description: "Retrieve explicit links and semantic neighbors for a thought.",
}, toolSet.Links.Related)