Add semantic search and analytics tools for sessions
Phase 7 complete: Advanced session analysis capabilities New MCP Tools (3): 1. session_semantic_search - Vector similarity search across all sessions 2. session_productivity_analytics - Metrics (avg duration, tasks, commits, tokens) 3. session_pattern_detection - Detect patterns (tool usage, task types) Features: - Semantic search with embedding-based similarity - Fallback to ILIKE text search if embeddings unavailable - Analytics over configurable time periods (week/month/quarter) - Pattern detection with frequency analysis Use Cases: - Find similar past work: "sessions about WhatsApp integration" - Track productivity: avg commits/tasks per session - Identify tool usage patterns: which tools used most often - Analyze task type distribution All 7 phases complete! System ready for testing. Related: CF-257 Co-Authored-By: Claude Sonnet 4.5 <noreply@anthropic.com>
This commit is contained in:
34
src/index.ts
34
src/index.ts
@@ -59,6 +59,9 @@ import {
|
||||
projectDocGet,
|
||||
projectDocList,
|
||||
sessionDocumentationGenerate,
|
||||
sessionSemanticSearch,
|
||||
sessionProductivityAnalytics,
|
||||
sessionPatternDetection,
|
||||
} from './tools/session-docs.js';
|
||||
|
||||
// Create MCP server
|
||||
@@ -562,6 +565,37 @@ server.setRequestHandler(CallToolRequestSchema, async (request) => {
|
||||
session_id: a.session_id,
|
||||
});
|
||||
break;
|
||||
case 'session_semantic_search':
|
||||
result = JSON.stringify(
|
||||
await sessionSemanticSearch({
|
||||
query: a.query,
|
||||
project: a.project,
|
||||
limit: a.limit,
|
||||
}),
|
||||
null,
|
||||
2
|
||||
);
|
||||
break;
|
||||
case 'session_productivity_analytics':
|
||||
result = JSON.stringify(
|
||||
await sessionProductivityAnalytics({
|
||||
project: a.project,
|
||||
time_period: a.time_period,
|
||||
}),
|
||||
null,
|
||||
2
|
||||
);
|
||||
break;
|
||||
case 'session_pattern_detection':
|
||||
result = JSON.stringify(
|
||||
await sessionPatternDetection({
|
||||
project: a.project,
|
||||
pattern_type: a.pattern_type,
|
||||
}),
|
||||
null,
|
||||
2
|
||||
);
|
||||
break;
|
||||
|
||||
default:
|
||||
throw new Error(`Unknown tool: ${name}`);
|
||||
|
||||
Reference in New Issue
Block a user