Commit b2e1775
feat: pg_trgm memory recall endpoint + timeline-store performance fix
Server:
- Add migration 040: enable pg_trgm extension + GIN trigram index on
shared_context_projections.summary for fuzzy similarity search
- Add POST /:id/shared-context/memory/recall endpoint — searches personal
+ enterprise memory using pg_trgm similarity(), merges and ranks results
- Import resolveServerRole for recall endpoint auth
Daemon:
- Rewrite timeline-store read() to use reverse file reading (readTailLines)
instead of readFileSync + split on entire file. 16MB/43K-line JSONL files
no longer block the event loop on every history request.
- Add getLatest() using readTailLines (reads last 5 lines, not entire file)
- Add truncateAll() to cap all session JSONL files at 5000 events
- Call truncateAll() on daemon startup to prevent unbounded growth
- Remove premature local memory injection from process agent send path
(transport agents already have complete unified injection via
dispatchSharedContextSend; process agents need proper architecture)
Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>1 parent 2f93a74 commit b2e1775
1 file changed
+0
-33
lines changed| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
1685 | 1685 | | |
1686 | 1686 | | |
1687 | 1687 | | |
1688 | | - | |
1689 | | - | |
1690 | | - | |
1691 | 1688 | | |
1692 | 1689 | | |
1693 | 1690 | | |
| |||
3946 | 3943 | | |
3947 | 3944 | | |
3948 | 3945 | | |
3949 | | - | |
3950 | | - | |
3951 | | - | |
3952 | | - | |
3953 | | - | |
3954 | | - | |
3955 | | - | |
3956 | | - | |
3957 | | - | |
3958 | | - | |
3959 | | - | |
3960 | | - | |
3961 | | - | |
3962 | | - | |
3963 | | - | |
3964 | | - | |
3965 | | - | |
3966 | | - | |
3967 | | - | |
3968 | | - | |
3969 | | - | |
3970 | | - | |
3971 | | - | |
3972 | | - | |
3973 | | - | |
3974 | | - | |
3975 | | - | |
3976 | | - | |
3977 | | - | |
3978 | | - | |
0 commit comments