Skip to content
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

fix(api): search vectorstore using only last message #939

Merged

Conversation

alekst23
Copy link
Contributor

@alekst23 alekst23 commented Aug 21, 2024

Description

Adjust the RAG implementation to search the vector store using the last user message instead of the first.

Add a needle in a haystack test to confirm problem and fix.

Apply fix for indexing already existing files to return the found file instead of 500.

@alekst23 alekst23 linked an issue Aug 21, 2024 that may be closed by this pull request
Copy link

netlify bot commented Aug 21, 2024

Deploy Preview for leapfrogai-docs ready!

Name Link
🔨 Latest commit 9e31599
🔍 Latest deploy log https://app.netlify.com/sites/leapfrogai-docs/deploys/66d8b1e3b89b060008bae5df
😎 Deploy Preview https://deploy-preview-939--leapfrogai-docs.netlify.app
📱 Preview on mobile
Toggle QR Code...

QR Code

Use your smartphone camera to open QR code link.
Lighthouse
Lighthouse
1 paths audited
Performance: 43 (🟢 up 2 from production)
Accessibility: 98 (no change from production)
Best Practices: 100 (no change from production)
SEO: 92 (no change from production)
PWA: -
View the detailed breakdown and full score reports

To edit notification comments on pull requests, go to your Netlify site configuration.

@alekst23
Copy link
Contributor Author

There's one issue to call out here, which is the changes to src/leapfrogai_api/backend/rag/index.py. I was encountering an error during testing where the file to be attached to an assistant was already in the vector store. In this case, the endpoint was returning error 500. I don't have an OpenAI conformance test for this yet, but it did not have the same problem during testing.

@alekst23 alekst23 marked this pull request as ready for review August 26, 2024 18:49
@alekst23 alekst23 requested a review from a team as a code owner August 26, 2024 18:49
@gphorvath gphorvath changed the title Search VectorStore using only last message bug(api): Search VectorStore using only last message Aug 26, 2024
@gphorvath gphorvath added the possible-bug 🐛 Something may not be working label Aug 26, 2024
@gphorvath gphorvath changed the title bug(api): Search VectorStore using only last message bug(api): search vectorstore using only last message Aug 26, 2024
@gphorvath gphorvath added bug Something isn't working and removed possible-bug 🐛 Something may not be working labels Aug 26, 2024
@gphorvath gphorvath changed the title bug(api): search vectorstore using only last message fix(api): search vectorstore using only last message Aug 26, 2024
src/leapfrogai_api/backend/rag/index.py Show resolved Hide resolved
tests/integration/api/test_rag_files.py Outdated Show resolved Hide resolved
tests/integration/api/test_rag_files.py Outdated Show resolved Hide resolved
@alekst23 alekst23 force-pushed the 938-bugapi-rag-uses-first-message-in-list-instead-of-last branch from 70b6dda to f49cb75 Compare September 4, 2024 15:57
@alekst23 alekst23 self-assigned this Sep 4, 2024
@alekst23 alekst23 force-pushed the 938-bugapi-rag-uses-first-message-in-list-instead-of-last branch from 6326a85 to 9e31599 Compare September 4, 2024 19:15
@alekst23 alekst23 enabled auto-merge (squash) September 4, 2024 19:20
@alekst23 alekst23 merged commit 8a1d61e into main Sep 4, 2024
23 checks passed
@alekst23 alekst23 deleted the 938-bugapi-rag-uses-first-message-in-list-instead-of-last branch September 4, 2024 21:17
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working
Projects
None yet
Development

Successfully merging this pull request may close these issues.

bug(api) RAG uses first message in list instead of last
6 participants