-
Notifications
You must be signed in to change notification settings - Fork 5
Added tutorial for Langchain Couchbase Vector Search #75
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
base: main
Are you sure you want to change the base?
Conversation
Summary of ChangesHello @azaddhirajkumar, I'm Gemini Code Assist1! I'm currently reviewing this pull request and will post my feedback shortly. In the meantime, here's a summary to help you and other reviewers quickly get up to speed! This pull request delivers a new tutorial designed to walk developers through the creation of an AI-driven PDF chat application. The tutorial highlights how to effectively combine Couchbase Vector Search for document retrieval, LangChain for managing large language model interactions and data processing, and Streamlit for a user-friendly interface. It provides practical guidance on implementing Retrieval-Augmented Generation (RAG) to enhance LLM responses with document context and demonstrates performance improvements through LLM response caching. Highlights
Using Gemini Code AssistThe full guide for Gemini Code Assist can be found on our documentation page, here are some quick tips. Invoking Gemini You can request assistance from Gemini at any point by creating a comment using either
Customization To customize Gemini Code Assist for GitHub experience, repository maintainers can create a configuration file and/or provide a custom code review style guide (such as PEP-8 for Python) by creating and adding files to a Limitations & Feedback Gemini Code Assist may make mistakes. Please leave feedback on any instances where its feedback is incorrect or counter productive. You can react with 👍 and 👎 on @gemini-code-assist comments. If you're interested in giving your feedback about your experience with Gemini Code Assist for Github and other Google products, sign up here. You can also get AI-powered code generation, chat, as well as code reviews directly in the IDE at no cost with the Gemini Code Assist IDE Extension. Footnotes
|
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Code Review
This pull request adds a new tutorial for building a PDF chat application using Couchbase Vector Search with the Query Service, LangChain, and Python. The tutorial is well-structured and comprehensive. I've provided several review comments to enhance clarity, fix minor errors in code snippets and text, and improve formatting. Addressing these points will make the tutorial easier for users to follow and help them avoid potential issues.
tutorial/markdown/python/python-langchain-pdf-chat-query/python-langchain-pdf-chat-query.md
Show resolved
Hide resolved
tutorial/markdown/python/python-langchain-pdf-chat-query/python-langchain-pdf-chat-query.md
Outdated
Show resolved
Hide resolved
tutorial/markdown/python/python-langchain-pdf-chat-query/python-langchain-pdf-chat-query.md
Outdated
Show resolved
Hide resolved
tutorial/markdown/python/python-langchain-pdf-chat-query/python-langchain-pdf-chat-query.md
Show resolved
Hide resolved
tutorial/markdown/python/python-langchain-pdf-chat-query/python-langchain-pdf-chat-query.md
Outdated
Show resolved
Hide resolved
tutorial/markdown/python/python-langchain-pdf-chat-query/python-langchain-pdf-chat-query.md
Outdated
Show resolved
Hide resolved
tutorial/markdown/python/python-langchain-pdf-chat-query/python-langchain-pdf-chat-query.md
Outdated
Show resolved
Hide resolved
nithishr
left a comment
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Please double check all the links as LangChain documentation has changed quite a bit.
Ideally, we should also update the FTS tutorial with the same changes.
| @@ -0,0 +1,593 @@ | |||
| --- | |||
| # frontmatter | |||
| path: "/tutorial-python-langchain-pdf-chat-query" | |||
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
The URL & title needs to be updated to the new terminology
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Done
tutorial/markdown/python/python-langchain-pdf-chat-query/python-langchain-pdf-chat-query.md
Outdated
Show resolved
Hide resolved
tutorial/markdown/python/python-langchain-pdf-chat-query/python-langchain-pdf-chat-query.md
Outdated
Show resolved
Hide resolved
tutorial/markdown/python/python-langchain-pdf-chat-query/python-langchain-pdf-chat-query.md
Outdated
Show resolved
Hide resolved
tutorial/markdown/python/python-langchain-pdf-chat-query/python-langchain-pdf-chat-query.md
Outdated
Show resolved
Hide resolved
tutorial/markdown/python/python-langchain-pdf-chat-query/python-langchain-pdf-chat-query.md
Outdated
Show resolved
Hide resolved
|
|
||
| ### LangChain Expression Language (LCEL) | ||
|
|
||
| We will now utilize the power of LangChain Chains using the [LangChain Expression Language](https://python.langchain.com/docs/expression_language/) (LCEL). LCEL makes it easy to build complex chains from basic components, and supports out of the box functionality such as streaming, parallelism, and logging. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Dead link
|
|
||
| ### Create Retriever Chain | ||
|
|
||
| We also create the [retriever](https://python.langchain.com/docs/modules/data_connection/retrievers/vectorstore) of the couchbase vector store. This retriever will be used to retrieve the previously added documents which are similar to current query. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Dead link
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Done
| - Create a placeholder for streaming the assistant's response. | ||
| - Use the chain.invoke(question) method to generate the response from the RAG chain. | ||
| - The response is automatically cached by the CouchbaseCache layer. | ||
| - [Stream](https://python.langchain.com/docs/use_cases/question_answering/streaming/) the response in real-time using the custom `stream_string` function. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
No description provided.