ruvector 0.1.37 → 0.1.38

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.
Files changed (2) hide show
  1. package/README.md +80 -0
  2. package/package.json +1 -1
package/README.md CHANGED
@@ -277,6 +277,86 @@ npx ruvector export my-index backup.bin
277
277
  npx ruvector import backup.bin restored-index
278
278
  ```
279
279
 
280
+ ## Self-Learning Hooks (Claude Code Integration)
281
+
282
+ RuVector includes a self-learning intelligence layer that improves AI agent decisions over time. These hooks integrate with Claude Code and other AI development tools.
283
+
284
+ ### Setup
285
+
286
+ ```bash
287
+ # Initialize hooks in your project
288
+ npx ruvector hooks init
289
+ ```
290
+
291
+ ### Hook Commands
292
+
293
+ ```bash
294
+ # Session Management
295
+ ruvector hooks session-start # Start session tracking
296
+ ruvector hooks session-end # End session with export
297
+
298
+ # Pre/Post Edit Hooks
299
+ ruvector hooks pre-edit <file> # Get agent suggestions before editing
300
+ ruvector hooks post-edit <file> --success # Record edit outcomes
301
+
302
+ # Pre/Post Command Hooks
303
+ ruvector hooks pre-command "cargo test" # Analyze command before running
304
+ ruvector hooks post-command "cargo test" --success # Record command outcomes
305
+
306
+ # Intelligence
307
+ ruvector hooks stats # Show learning statistics
308
+ ruvector hooks route <task> # Get agent routing suggestion
309
+ ruvector hooks suggest-context # Get context suggestions
310
+
311
+ # Memory
312
+ ruvector hooks remember <content> -t <type> # Store in vector memory
313
+ ruvector hooks recall <query> # Semantic search memory
314
+ ```
315
+
316
+ ### How It Works
317
+
318
+ The intelligence system uses:
319
+ - **Q-Learning**: Learns optimal agent routing from past successes/failures
320
+ - **Vector Memory**: Semantic storage with cosine similarity search
321
+ - **File Sequences**: Predicts related files based on edit patterns
322
+ - **Error Patterns**: Remembers fixes for common errors
323
+
324
+ ### Example Output
325
+
326
+ ```
327
+ 🧠 Intelligence Analysis:
328
+ 📁 ruvector-core/lib.rs
329
+ 🤖 Recommended: rust-developer (80% confidence)
330
+ → learned from past success
331
+ 📚 Similar: 3 past edits
332
+ 📎 Related: mod.rs, tests.rs
333
+ 💬 ⚡ Core lib: run cargo test --lib after changes
334
+ ```
335
+
336
+ ### Claude Code Integration
337
+
338
+ Add to your `.claude/settings.json`:
339
+
340
+ ```json
341
+ {
342
+ "hooks": {
343
+ "PreToolUse": [{ "command": "ruvector hooks pre-edit $file" }],
344
+ "PostToolUse": [{ "command": "ruvector hooks post-edit $file --success" }],
345
+ "SessionStart": [{ "command": "ruvector hooks session-start" }],
346
+ "Stop": [{ "command": "ruvector hooks session-end" }]
347
+ }
348
+ }
349
+ ```
350
+
351
+ ### Learning Data
352
+
353
+ | Storage | Contents |
354
+ |---------|----------|
355
+ | `.ruvector/intelligence.json` | Q-table, memories, trajectories |
356
+ | Patterns | State-action values for agent routing |
357
+ | Memories | Vector embeddings for semantic recall |
358
+ | Trajectories | Learning history for continuous improvement |
359
+
280
360
  ## Integrations
281
361
 
282
362
  ### LangChain
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "ruvector",
3
- "version": "0.1.37",
3
+ "version": "0.1.38",
4
4
  "description": "High-performance vector database with Graph Neural Networks, Cypher queries, and AI agent routing. Build RAG apps, semantic search, recommendations, and agentic AI systems. Pinecone + Neo4j + PyTorch alternative.",
5
5
  "main": "./dist/index.js",
6
6
  "types": "./dist/index.d.ts",