Repository navigation
DOC-7268 Add a read-only Repo Memory query action - #4479
andy-stark-redis wants to merge 2 commits into
Conversation
A local composite action, .github/actions/repo-memory-query/, plus a workflow_dispatch workflow, that searches the Repo Memory store from a description of planned work before any PR exists. It returns related PRs, commits and issues with the full squash or commit message behind each. Why a separate action: redis-learn/redis-repo-memory is on the GitHub Marketplace and the query feature is experimental. The team asked to keep the public action unchanged until the feature proves useful, so the query logic (first proposed as redis-learn/redis-repo-memory PR #4) lives here instead. Design: - Read-only. It never creates the index, writes a key, or posts to a PR or commit. It uses the same MEMORY_REDIS_URL and OPENAI_API_KEY secrets. - Compatible with what the memory action writes: repo_memory_idx, memory: hashes, a cosine embedding from text-embedding-3-small. The embedded text has the same shape (title, body, file list, cut to 4000 characters). - Results are limited to the repository the workflow runs in. - Full text is read at the source because stored summaries stop at 500 characters: the squash commit for a merged PR, the commit message for a push, the body otherwise. It falls back silently to the stored summary. - The result is one REPO_MEMORY_QUERY_RESULT_JSON log line, so build/repo-memory-eval/recall/recall.py can parse it. Tested offline with test.js against Redis 8.10 and a mock embedding. The first version of the test let two mutants survive (reversed sort, a stray write on the missing-index path), so it now asserts nearest-first order and an empty keyspace after the missing-index query. Five mutants are caught. Not verified: a real Actions run (github.token default, sparse checkout, input wiring), real OpenAI embeddings, and retrieval quality from a plan. Workflow logs of this public repo are public; the README says so. Co-Authored-By: Claude Sonnet 5.5 <noreply@anthropic.com>
There was a problem hiding this comment.
Cursor Bugbot has reviewed your changes using high effort and found 2 potential issues.
❌ Bugbot Autofix is OFF. To automatically fix reported issues with cloud agents, have a team admin enable autofix in the Cursor dashboard.
Reviewed by Cursor Bugbot for commit f1c8eda. Configure here.
Bugbot found two real problems on #4479. The KNN search ran over the whole index and filtered by repository in JS, so other repositories' items could use up the neighbors, and FT.SEARCH returns only 10 rows by default, which silently capped any query-limit above 5. The search now filters on the repo TAG first (escaping the "/" and "-" in a repo name) and sets LIMIT to the neighbor count. The workflow granted only contents: read, so the token could not be relied on to read PR and issue text. My first draft had pull-requests: read and I dropped it when rewriting the workflow. It now grants pull-requests: read and issues: read. Whether GitHub serves public PRs to a token without that scope is unverified; the grant removes the question. A failed lookup now logs its HTTP status instead of silently dropping the full text. Tests: added a case with 12 other-repo items that match the query better than the in-repo item, and a query-limit of 13. My first crowding test was wrong (the in-repo item was the exact match, so nothing was crowded out); it now fails when the repo filter, LIMIT, or tag escaping is removed. Co-Authored-By: Claude Sonnet 5.5 <noreply@anthropic.com>
🧠 Redis MemoryFound 6 related items from repository history (1 new this commit):
Memory updated at 2809ac3 |

Jira: DOC-7268
Adds a local, read-only action that searches the Repo Memory store from a description of planned work, before any PR exists. It returns related PRs, commits and issues with the full squash or commit message behind each.
Why a separate local action
redis-learn/redis-repo-memoryis on the GitHub Marketplace and a query mode is experimental, so the public action stays unchanged until the feature proves useful. This replaces redis-learn/redis-repo-memory#4, which I'll close.What it does
.github/actions/repo-memory-query/: composite action with one script,query.js. It uses the sameMEMORY_REDIS_URLandOPENAI_API_KEYsecrets and the samerepo_memory_idxindex as the memory action..github/workflows/repo-memory-query.yml:workflow_dispatchentry point (gh workflow run repo-memory-query.yml -f query=... -f files=...). It does a sparse checkout of the action directory.REPO_MEMORY_QUERY_RESULT_JSONlog line and a step-summary list.package-lock.jsonis force-added because the repo ignores lockfiles and the action installs withnpm ci.Tested
test.jsruns offline against Redis 8.10 with a mock embedding: missing index, nearest-first order, limit and distance, other-repo exclusion, nothing written, empty inputs. Five deliberate breakages are each caught.Not tested
github.tokendefault, sparse checkout, input wiring).The workflow can only be dispatched once this is on
main, so the first real run happens after merge. Run logs are public, so the query text is too; the README says so.🤖 Generated with Claude Code
Note
Low Risk
New opt-in CI tooling under
.github/only; read-only Redis access and no changes to application code or the existing memory writer.Overview
Adds a local composite action and
workflow_dispatchworkflow so contributors can search the existing Redis Repo Memory index from a description of planned work (and optional file paths) before opening a PR, without changing the marketplaceredis-learn/redis-repo-memorywriter.query.jsembeds the plan withtext-embedding-3-small, runs a read-only RediSearch KNN query onrepo_memory_idxscoped toGITHUB_REPOSITORY, applies limit/distance filters, optionally hydrates full squash/commit/issue text via the GitHub API, and emits aREPO_MEMORY_QUERY_RESULT_JSONlog line plus a step summary. It never creates the index, writes Redis keys, or posts comments.repo-memory-query.ymlwires the sameMEMORY_REDIS_URLandOPENAI_API_KEYsecrets asrepo-memory.yml, with sparse checkout of the action folder.test.jsexercises the script offline against empty Redis 8 using mock embeddings (repo filter, limits, read-only guarantees).package-lock.jsonis added sonpm ciworks despite repo lockfile ignores.Reviewed by Cursor Bugbot for commit 2809ac3. Bugbot is set up for automated code reviews on this repo. Configure here.