@rigstate/mcp 0.5.4 → 0.5.5
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/index.js +0 -6
- package/dist/index.js.map +1 -1
- package/package.json +1 -1
- package/src/tools/query-brain.ts +0 -7
package/dist/index.js
CHANGED
|
@@ -977,7 +977,6 @@ async function generateQueryEmbedding(query) {
|
|
|
977
977
|
const openRouterKey = process.env.OPENROUTER_API_KEY;
|
|
978
978
|
const googleKey = process.env.GOOGLE_GENERATIVE_AI_API_KEY;
|
|
979
979
|
if (!openRouterKey && !googleKey) {
|
|
980
|
-
console.warn("Neither OPENROUTER_API_KEY nor GOOGLE_GENERATIVE_AI_API_KEY found, skipping vector search.");
|
|
981
980
|
return null;
|
|
982
981
|
}
|
|
983
982
|
try {
|
|
@@ -999,7 +998,6 @@ async function generateQueryEmbedding(query) {
|
|
|
999
998
|
return embedding;
|
|
1000
999
|
}
|
|
1001
1000
|
} catch (error) {
|
|
1002
|
-
console.error("Failed to generate embedding for search:", error);
|
|
1003
1001
|
return null;
|
|
1004
1002
|
}
|
|
1005
1003
|
}
|
|
@@ -1010,8 +1008,6 @@ async function queryBrain(supabase, userId, projectId, query, limit = 8, thresho
|
|
|
1010
1008
|
}
|
|
1011
1009
|
const embedding = await generateQueryEmbedding(query);
|
|
1012
1010
|
let memories = [];
|
|
1013
|
-
console.error(`Searching brain for "${query}" (limit: ${limit}, threshold: ${threshold})`);
|
|
1014
|
-
console.error(`Embedding present: ${!!embedding}`);
|
|
1015
1011
|
const { data: searchResults, error: searchError } = await supabase.rpc("hybrid_search_memories", {
|
|
1016
1012
|
p_project_id: projectId,
|
|
1017
1013
|
p_query: query,
|
|
@@ -1020,7 +1016,6 @@ async function queryBrain(supabase, userId, projectId, query, limit = 8, thresho
|
|
|
1020
1016
|
p_similarity_threshold: threshold || 0.1
|
|
1021
1017
|
});
|
|
1022
1018
|
if (searchError) {
|
|
1023
|
-
console.error("Hybrid search error:", searchError);
|
|
1024
1019
|
const { data: recentMemories } = await supabase.from("project_memories").select("id, content, category, tags, importance, created_at").eq("project_id", projectId).eq("is_active", true).order("created_at", { ascending: false }).limit(limit);
|
|
1025
1020
|
if (recentMemories) {
|
|
1026
1021
|
memories = recentMemories.map((m) => ({
|
|
@@ -1033,7 +1028,6 @@ async function queryBrain(supabase, userId, projectId, query, limit = 8, thresho
|
|
|
1033
1028
|
}));
|
|
1034
1029
|
}
|
|
1035
1030
|
} else if (searchResults) {
|
|
1036
|
-
console.error(`Found ${searchResults.length} results from RPC`);
|
|
1037
1031
|
memories = searchResults.map((m) => ({
|
|
1038
1032
|
id: m.id,
|
|
1039
1033
|
content: m.content,
|