Commit graph

3 commits

Author SHA1 Message Date
chopratejas
e2aac4863a Add wrap commands for Codex/Cursor/Aider with rtk instructions, fix savings metrics
- headroom wrap codex: injects rtk instructions into AGENTS.md
- headroom wrap cursor: injects into .cursorrules, prints config steps
- headroom wrap aider: injects into CONVENTIONS.md, sets both env vars
- All with --no-rtk flag to skip rtk setup

Unified savings metrics across three layers:
- cli_filtering: tokens avoided by rtk before reaching context
- compression: tokens removed by proxy (SmartCrusher, etc.)
- prefix_cache: provider cache discount with honest attribution

Fix flaky test_process_stats_collected when psutil not installed.
2026-03-13 22:02:47 -07:00
chopratejas
eca5c94229 Add SQLite vector backend as default and fix HNSW test skipping
- Add VectorBackend.AUTO that prefers SQLITE_VEC if available, else HNSW
- Add SQLiteVectorIndex configuration options (vector_db_path, vector_cache_size_kb)
- Add update_embedding() method to SQLiteVectorIndex for VectorIndex protocol
- Update factory to create SQLiteVectorIndex when appropriate
- Skip HNSW-specific tests when hnswlib is not available (fixes CI on Python 3.12)
2026-02-01 22:12:45 -08:00
chopratejas
e16691dd38 Add memory observability system (Phase 1)
Implements comprehensive memory tracking for all in-memory components:

- Add MemoryTracker singleton with ComponentStats, ProcessStats, MemoryReport
- Add get_memory_stats() to CompressionStore, BatchContextStore,
  GraphStore, HNSWVectorIndex
- Add /debug/memory API endpoint for runtime monitoring

Components tracked:
- compression_store: CCR compressed tool outputs
- batch_context_store: Batch API request contexts
- graph_store: Knowledge graph entities and relationships
- vector_index: HNSW vector embeddings
- semantic_cache: Response cache
- request_logger: Request metadata

Includes 47 tests (unit + integration) with real API calls.
2026-02-01 19:49:53 -08:00