Skip to content

chore: performing sparse search with query expansion in langchain (#443) #453

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 2 commits into from
May 29, 2025

Conversation

jamescalam
Copy link
Collaborator

Problem

Showcase the use of Pinecone sparse embeddings and sparse indexes for in situations where dense vector search might miss specific technical terms.

Solution

  • use Pinecone sparse embeddings
  • use query expansion technique
  • allow Langchain agent to search for specific technical terms from general queries ("Which tech companies were top performers this week?" transforms into vector search about "GOOGL performance", "NVIDIA Performance", ...

Type of Change

  • Bug fix (non-breaking change which fixes an issue)
  • New feature (non-breaking change which adds functionality)
  • Breaking change (fix or feature that would cause existing functionality to not work as expected)
  • This change requires a documentation update
  • Infrastructure change (CI configs, etc)
  • Non-code change (docs, etc)
  • None of the above: (updates to documentation)

Test Plan

Describe specific steps for validating this change.


Problem

Describe the purpose of this change. What problem is being solved and why?

Solution

Describe the approach you took. Link to any relevant bugs, issues, docs, or other resources.

Type of Change

  • Bug fix (non-breaking change which fixes an issue)
  • New feature (non-breaking change which adds functionality)
  • Breaking change (fix or feature that would cause existing functionality to not work as expected)
  • This change requires a documentation update
  • Infrastructure change (CI configs, etc)
  • Non-code change (docs, etc)
  • None of the above: (explain here)

Test Plan

Describe specific steps for validating this change.

## Problem

Showcase the use of Pinecone sparse embeddings and sparse indexes for in
situations where dense vector search might miss specific technical
terms.

## Solution

- use Pinecone sparse embeddings
- use query expansion technique
- allow Langchain agent to search for specific technical terms from
general queries ("Which tech companies were top performers this week?"
transforms into vector search about "GOOGL performance", "NVIDIA
Performance", ...

## Type of Change

- [ ] Bug fix (non-breaking change which fixes an issue)
- [ ] New feature (non-breaking change which adds functionality)
- [ ] Breaking change (fix or feature that would cause existing
functionality to not work as expected)
- [ ] This change requires a documentation update
- [ ] Infrastructure change (CI configs, etc)
- [ ] Non-code change (docs, etc)
- [X] None of the above: (updates to documentation)

## Test Plan

Describe specific steps for validating this change.

---------

Co-authored-by: James Briggs <35938317+jamescalam@users.noreply.github.com>
Copy link

Check out this pull request on  ReviewNB

See visual diffs & provide feedback on Jupyter Notebooks.


Powered by ReviewNB

@jamescalam jamescalam self-assigned this May 29, 2025
@jamescalam jamescalam merged commit e2a74ed into master May 29, 2025
9 checks passed
@jamescalam jamescalam deleted the james/sparse-example branch May 29, 2025 11:46
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