feat(store): make the fixed result cap of 20 configurable
Maintainers usually reply within 1 day
Nobody has claimed this yet.
Assessment
- Difficulty
- 2/5
- Estimated time
- 1-3 hours
- Newbie friendliness
- 80/100
Research direction
Start in internal/store/store.go: MaxSearchResults is set at :504, hardcoded to 20 in DefaultConfig (:517) and FallbackConfig (:530), and enforced as a clamp in SearchContext (:3530). Read how ENGRAM_MAX_SEARCH_RESULTS-style env vars are parsed elsewhere (e.g. ENGRAM_PORT in cmd/engram/main.go:728) for the invalid-value fallback pattern. Done means ENGRAM_MAX_SEARCH_RESULTS=100 lets search --limit 100 return up to 100 rows, and with the variable unset behavior stays identical at cap 20.
Written by the indexing model from the issue text.
Description
📋 Pre-flight Checks
- I have searched existing issues and this is not a duplicate
- I understand this issue needs
status:approvedbefore a PR can be opened
🔍 Problem Description
The search cap cannot be changed from outside the binary. On 975490b MaxSearchResults is a Config field (internal/store/store.go:504) whose only two constructors both hardcode 20 (:517 in DefaultConfig, :530 in FallbackConfig), and SearchContext clamps every request to it (:3530). No env var, flag or config file reaches it, and search has no offset or paging, so rows past the cap cannot be reached through search.
Measured on 2026-08-24 against a pristine build of 47f281c over a 31k-observation store: 3,242 live observations match docker, and engram search "docker" --limit 100 returns 20 rows. --limit 100 is accepted and the result set is still 20. The cap and the clamp are unchanged on 975490b.
💡 Proposed Solution
ENGRAM_MAX_SEARCH_RESULTS overrides the cap; unset keeps 20.
Invalid values fall back to the default silently, which is how the three non-test Go reads of ENGRAM_PORT behave today (cmd/engram/main.go:728, internal/cloud/config.go:59, cmd/engram/cloud_daemon_probe.go:72, all on 975490b). Happy to log or error instead if you prefer.
Example:
ENGRAM_MAX_SEARCH_RESULTS=100 engram search "docker" --limit 100
One acceptance target: with ENGRAM_MAX_SEARCH_RESULTS=100, search --limit 100 can return up to 100 rows. Unset, behavior stays byte-identical (cap 20).
📦 Affected Area
Store (database, queries)
🔄 Alternatives Considered
Adding --offset or paging to engram search. That is a larger surface and changes the CLI contract; a single cap override covers the need without touching the query path.
Raising the hardcoded number. That would still be a single number for every store.
Reading rows through GET /observations?limit=N, which can return more than 20. That returns recent rows, not ranked matches, so it does not answer a search.
📎 Additional Context
I found no existing issue covering the search cap, open or closed.
Working implementation running in a production fork. Happy to submit it as a focused PR if this gets status:approved.
Split out of #752, where the maintainer asked for focused proposals with one acceptance target each. This supersedes #761, which I filed through the API and therefore without this form's labels.
- Dominant language
- Go
- Stars
- 7.1k
- Forks
- 729
- Avg merge
- 8h 48m
- Merged PRs (30d)
- 340
Getting set up
Starts the project's dev container in your browser, under your own GitHub account.
- No Dockerfile or Docker Compose file
- Has a pull request template
- Read the contributing guide
First steps
- Read the whole issue, then the project's contributing guide.
- Comment on the issue to say you are picking it up — it saves two people doing the same work.
- Fork the repository and make your change on a branch.
- Open a pull request that references the issue number.
More from Gentleman-Programming/engram
-
bug(obsidian): project-scoped export rewrites shared topic hubs from the scoped project's refs onlyPossibly taken A pull request linked to this issue is open or already merged. Openstatus:needs-review type:bug
Difficulty 2/5 1-3 hours Newbie friendliness 73/100
Gentleman-Programming/engram#2003 ·
Maintainers usually reply within 1 day
-
feat(ci): prepare dormant required-job queue interlockPossibly taken @dnlrsls claimed this today. Openstatus:approved type:feature
Gentleman-Programming/engram#2031 · 1 assignee ·
Maintainers usually reply within 1 day
-
feat(ci): wire dormant native and legacy proof boundariesPossibly taken @dnlrsls claimed this today. Openstatus:approved type:feature
Gentleman-Programming/engram#2030 · 1 assignee ·
Maintainers usually reply within 1 day
-
feat(ci): add dormant proof release contractPossibly taken @dnlrsls claimed this today. Openstatus:approved type:feature
Gentleman-Programming/engram#2029 · 1 assignee ·
Maintainers usually reply within 1 day
-
feat(ci): add dormant hosted verification controls for legacy retirementPossibly taken @dnlrsls claimed this today. Openstatus:approved type:feature
Gentleman-Programming/engram#2026 · 1 assignee ·
Maintainers usually reply within 1 day
All issues in Gentleman-Programming/engram
Similar issues
-
bug raised-by:verifier
Difficulty 2/5 1-3 hours Newbie friendliness 76/100
medici-finance/assay#4177 ·
Maintainers usually reply within 1 day
-
bug: admin user creation silently ignores rolePossibly taken @bfs2021 claimed this today. Openbug
Difficulty 2/5 1-3 hours Newbie friendliness 76/100
eugenioenko/autentico#553 ·
Maintainers usually reply within 1 day
-
sidecar: --moriio-parallel-dispatch omits remote_request_id, so a vLLM NixlPushConnector decode dies with KeyErrorPossibly taken @xintin claimed this today. Openkind/bug needs-triage
Difficulty 2/5 1-3 hours Newbie friendliness 78/100
llm-d/llm-d-router#3607 ·
Maintainers usually reply within 1 day
-
automation models
Difficulty 1/5 1-3 hours Newbie friendliness 74/100
Maintainers usually reply within 1 day
-
Difficulty 1/5 Under an hour Newbie friendliness 91/100
Maintainers usually reply within 1 day