Skip to content

Show semantic search UI when available and evict old Redis indexes#1127

Merged
vaclisinc merged 2 commits into
mainfrom
jimmy/semantic-search-when-available
Apr 6, 2026
Merged

Show semantic search UI when available and evict old Redis indexes#1127
vaclisinc merged 2 commits into
mainfrom
jimmy/semantic-search-when-available

Conversation

@vaclisinc

@vaclisinc vaclisinc commented Apr 6, 2026

Copy link
Copy Markdown
Contributor

Overview

This PR limits when the semantic search UI is shown and introduces eviction for Redis indexes to prevent memory issues.

Problem Statement

Frontend Logic

  • The semantic search UI is currently shown for every semester.
  • Clicking into the UI triggers index building.
  • This leads to excessive Redis memory usage and can cause OOM due to too many indexes being created and retained.

Refresh Logic

  • Old Redis indexes were not being cleaned up, causing stale or incorrect search results and unnecessary memory usage.

Solution

  • Only show the semantic search UI when it is actually available, instead of for all semesters.
  • Add eviction logic to remove old Redis indexes and control memory usage.

@github-actions

github-actions Bot commented Apr 6, 2026

Copy link
Copy Markdown

Linting Failed

Note: The status check will always pass. Run npm run lint -- --continue to see the full output locally.

Click to expand lint output

> lint
> turbo run lint --continue --output-logs=errors-only


Attention:
Turborepo now collects completely anonymous telemetry regarding usage.
This information is used to shape the Turborepo roadmap and prioritize features.
You can learn more, including how to opt-out if you'd not like to participate in this anonymous program, by visiting the following URL:
https://turborepo.com/docs/telemetry

• Packages in scope: @repo/BtLL, @repo/common, @repo/eslint-config, @repo/gql-typedefs, @repo/shared, @repo/sis-api, @repo/storybook, @repo/theme, @repo/typescript-config, ag-frontend, api-sandbox, backend, datapuller, frontend, staff-frontend
• Running lint in 15 packages
• Remote caching disabled
�[;31mbackend:lint�[;0m
cache miss, executing d3bf246a0280e657

> lint
> eslint src/


/home/runner/work/berkeleytime/berkeleytime/apps/backend/src/modules/semantic-search/client.ts
  50:13  error  Empty block statement  no-empty

✖ 1 problem (1 error, 0 warnings)

npm error Lifecycle script `lint` failed with error:
npm error code 1
npm error path /home/runner/work/berkeleytime/berkeleytime/apps/backend
npm error workspace backend
npm error location /home/runner/work/berkeleytime/berkeleytime/apps/backend
npm error command failed
npm error command sh -c eslint src/
[WARN] command finished with error, but continuing...
::error::backend#lint: command (/home/runner/work/berkeleytime/berkeleytime/apps/backend) /opt/hostedtoolcache/node/22.12.0/x64/bin/npm run lint exited (1)

 Tasks:    6 successful, 7 total
Cached:    0 cached, 7 total
  Time:    11.593s 
Failed:    backend#lint

 ERROR  run failed: command  exited (1)

@johngerving johngerving left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM

@vaclisinc vaclisinc merged commit 73d799c into main Apr 6, 2026
18 checks passed
@vaclisinc vaclisinc deleted the jimmy/semantic-search-when-available branch April 6, 2026 19:43
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants