Skip to content

feat: improve semantic search marimo notebook#582

Merged
jhamon merged 1 commit into
mainfrom
semantic-search-marimo-improvements
May 21, 2026
Merged

feat: improve semantic search marimo notebook#582
jhamon merged 1 commit into
mainfrom
semantic-search-marimo-improvements

Conversation

@jhamon
Copy link
Copy Markdown
Collaborator

@jhamon jhamon commented May 21, 2026

Summary

Follow-up improvements to the semantic search marimo notebook merged in #581.

Changes

Multilingual support

  • Switch embedding model to multilingual-e5-large for cross-lingual retrieval
  • Embed both English and Spanish sentences from Tatoeba using filter_pairs + extract_sentences(lang)
  • Add cross-lingual query examples and a language filtering section using Pinecone metadata filters

Interactivity

  • Interactive query input with mo.ui.text and mo.ui.radio language selector
  • Interactive API key input: reads PINECONE_API_KEY from env/.env with a mo.ui.text(kind="password") fallback for molab users; uses mo.callout admonitions for each state

Display

  • Search results rendered as mo.ui.table with a lang column showing which language each hit came from
  • Progress bar via mo.status.progress_bar (replacing tqdm)

Correctness / hygiene

  • Pin datasets==3.5.1datasets>=4 dropped support for custom loading scripts used by Helsinki-NLP/tatoeba
  • Use keyword argument names in all Pinecone API calls
  • Remove unused numpy and tqdm dependencies
  • Remove notebook-specific deps from root pyproject.toml (they belong in the notebook's # /// script inline metadata)

Test Plan

  • Notebook runs end-to-end in sandbox mode (uvx marimo edit --sandbox) with a valid PINECONE_API_KEY
  • Password input appears when env var is unset; success callout appears when set
  • Cross-lingual queries return results in both English and Spanish
  • Language filter correctly scopes results to en or es
  • Interactive query input updates results on change

🤖 Generated with Claude Code


Note

Low Risk
Low risk documentation/notebook-only changes that adjust dependency pinning and interactive API key handling; no production code paths affected.

Overview
Improves the docs/semantic-search.py semantic search marimo notebook setup experience by pinning datasets==3.5.1 and replacing the env-only Pinecone key requirement with an interactive API key input (env/.env auto-detect + password field fallback with callouts).

Adds a guard (mo.stop) to halt execution until a key is provided and introduces a brief section clarifying client instantiation (including the example-only source_tag).

Reviewed by Cursor Bugbot for commit 6da4180. Bugbot is set up for automated code reviews on this repo. Configure here.

- Multilingual support: switch to multilingual-e5-large, embed English
  and Spanish sentences, show cross-lingual retrieval and language filtering
- Interactive query input with mo.ui.text and mo.ui.radio language selector
- Interactive API key input: reads from env/.env with a password field
  fallback for molab users, with callout admonitions for each state
- Display search results as mo.ui.table with lang column
- Pin datasets==3.5.1 (datasets>=4 breaks Helsinki-NLP/tatoeba)
- Use keyword argument names in all Pinecone API calls
- Remove numpy and tqdm (replaced by mo.status.progress_bar)
- Remove notebook deps from root pyproject.toml

Co-Authored-By: Claude Sonnet 4.6 (1M context) <noreply@anthropic.com>
@jhamon jhamon merged commit 48802e5 into main May 21, 2026
11 checks passed
@jhamon jhamon deleted the semantic-search-marimo-improvements branch May 21, 2026 15:29
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