Skip to content

Performance optimization: select_context on large graphs #13

Description

@jeremiepas

Problem

Profiling needed for select_context with 100k+ node graphs. Current implementation uses Map lookups and Set operations which may degrade at scale.

Solution

Profile and optimize:

  1. Benchmark select_context on 10k, 50k, 100k node graphs
  2. Optimize hot paths (relevanceScore, community-aware selection)
  3. Consider HNSW index for embedding search on >50k nodes
  4. Cache index rebuilds only when graph changes

Acceptance Criteria

  • select_context < 50ms on 10k node graph
  • select_context < 200ms on 100k node graph
  • Benchmark suite in tests/
  • HNSW index considered for >50k nodes (may defer)

Effort: 1-2 days

Priority: Low

See: docs/proposals/memory-agent/04-implementation-roadmap.md (Phase 5)

Metadata

Metadata

Assignees

No one assigned

    Labels

    enhancementNew feature or requestmemory-agentMemory agent capabilitiesphase-5Phase 5: Polish + Optimization

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions