# Memory Systems Benchmark Report

**Generated:** 2026-01-06T06:48:17.656637Z
**System:** Pay2U Memory Implementation

## Summary

| System        | Operation                   | Mean (ms) | P95 (ms) | Ops/sec |
| ------------- | --------------------------- | --------- | -------- | ------- |
| SQLite        | INSERT (single)             | 1.143     | 1.360    | 875     |
| SQLite        | SELECT recent (LIMIT 50)    | 0.150     | 0.166    | 6680    |
| SQLite        | SELECT by type              | 0.145     | 0.160    | 6887    |
| SQLite        | LIKE search                 | 0.138     | 0.146    | 7220    |
| SQLite        | Graph query (1-hop)         | 0.166     | 0.181    | 6035    |
| Qdrant        | INSERT (single + embed)     | 7.817     | 5.619    | 128     |
| Qdrant        | Semantic search (top-5)     | 1.222     | 1.682    | 818     |
| Qdrant        | Filtered search             | 1.245     | 1.298    | 803     |
| Embedding     | Generate (all-MiniLM-L6-v2) | 3.283     | 3.575    | 305     |
| Consolidation | Simple extraction           | 0.046     | 0.048    | 21731   |
| Consolidation | Semantic dedup              | 33.512    | 38.731   | 30      |
| SQLite@100    | SELECT recent               | 0.151     | 0.165    | 6605    |
| SQLite@1000   | SELECT recent               | 0.169     | 0.197    | 5906    |
| SQLite@5000   | SELECT recent               | 0.166     | 0.182    | 6026    |

## Key Findings

### Short-term Memory (SQLite)

- Single INSERT operations are extremely fast (<0.5ms)
- SELECT with ORDER BY and LIMIT scales well
- Knowledge graph queries (1-hop) add minimal overhead

### Long-term Memory (Qdrant)

- Embedding generation is the main latency contributor
- Semantic search is fast once vectors exist (~50-100ms)
- Filtering adds minimal overhead

### Consolidation

- Simple extraction is very fast (<1ms)
- Semantic deduplication adds significant latency (~100-500ms)
- Recommendation: Use hash-based dedup, semantic only for high-importance

## Recommendations

1. **Keep SQLite for short-term**: Performance is excellent
2. **Batch Qdrant operations**: Reduce per-operation overhead
3. **Cache embeddings**: Avoid regenerating for known content
4. **Use hybrid dedup**: Hash first, semantic for borderline cases
5. **Add session memory layer**: Low overhead, high value
