@rigstate/mcp 0.5.0 → 0.5.2
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 +6 -3
- package/dist/index.js.map +1 -1
- package/package.json +1 -1
- package/src/lib/schemas.ts +1 -1
- package/src/tools/query-brain.ts +6 -2
package/package.json
CHANGED
package/src/lib/schemas.ts
CHANGED
|
@@ -8,7 +8,7 @@ export const QueryBrainInputSchema = z.object({
|
|
|
8
8
|
projectId: z.string().uuid('Invalid project ID'),
|
|
9
9
|
query: z.string().min(1, 'Query is required'),
|
|
10
10
|
limit: z.number().min(1).max(20).optional().default(8),
|
|
11
|
-
threshold: z.number().min(0).max(1).optional().default(0.
|
|
11
|
+
threshold: z.number().min(0).max(1).optional().default(0.1)
|
|
12
12
|
});
|
|
13
13
|
|
|
14
14
|
export const GetProjectContextInputSchema = z.object({
|
package/src/tools/query-brain.ts
CHANGED
|
@@ -84,13 +84,16 @@ export async function queryBrain(
|
|
|
84
84
|
let memories: MemoryRecord[] = [];
|
|
85
85
|
|
|
86
86
|
// Use the hybrid search RPC
|
|
87
|
+
console.log(`Searching brain for "${query}" (limit: ${limit}, threshold: ${threshold})`);
|
|
88
|
+
console.log(`Embedding present: ${!!embedding}`);
|
|
89
|
+
|
|
87
90
|
const { data: searchResults, error: searchError } = await supabase
|
|
88
91
|
.rpc('hybrid_search_memories', {
|
|
89
92
|
p_project_id: projectId,
|
|
90
93
|
p_query: query,
|
|
91
|
-
p_embedding: embedding,
|
|
94
|
+
p_embedding: embedding || null,
|
|
92
95
|
p_limit: limit,
|
|
93
|
-
p_similarity_threshold: threshold || 0.
|
|
96
|
+
p_similarity_threshold: threshold || 0.1
|
|
94
97
|
});
|
|
95
98
|
|
|
96
99
|
if (searchError) {
|
|
@@ -115,6 +118,7 @@ export async function queryBrain(
|
|
|
115
118
|
}));
|
|
116
119
|
}
|
|
117
120
|
} else if (searchResults) {
|
|
121
|
+
console.log(`Found ${searchResults.length} results from RPC`);
|
|
118
122
|
memories = searchResults.map((m: any) => ({
|
|
119
123
|
id: m.id,
|
|
120
124
|
content: m.content,
|