-
Notifications
You must be signed in to change notification settings - Fork 0
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
Pipeline rag #61
Pipeline rag #61
Conversation
implemented the class, the class is currently empty
- added retrievers - built the class to build the chain for the pipeline
it extracts the topic out of the users first question
- changed prompts to be more concise and reduce token usage - added routing node factory to produce routing nodes fast - added a retrieval node - created a function for routing node - added a generate node function - finished the pipeline rag
-Updated Copyright to be correct -Updated terminal example to include the pipeline rag -Bug fixes to pipeline rag
Hey Gohaun! I am currently going through your additions and so far things are looking good. The pipeline is pretty straightforward in the code. There are a few things that I think could benefit from some slight changes, but I haven't finished looking through the code quite yet. I am going to go through the rest of it tomorrow; once I do, I'll leave a more detailed comment with my suggestions. |
Hey, so I noticed that some of the memory filepaths for the pipeline rag are hardcoded instead of being pulled from config.yaml (Ex: memory_filepath for pipeline_rag is set to f"chat_logs/pipeline_memory.db" instead of f"{LOG_SOURCE_PATH}/pipeline_memory.db"; vectorstores for pipeline rag also don't refer to VEC_STORE_PATH). I have created PR #72 that replaces these hardcoded filepaths with dynamic ones pulled from the config. More importantly, however, I have not been able to get the pipeline rag to work. Any question I ask results in llm_topic returning a response of I have tried the following initial questions and they all result in this error:
Regardless of what I ask, it appears that llm_topic always returns a None response. I know you were working on handling None responses in this specific instance. Do you still see this error on your end? |
I know what is wrong, the VEC_SOTRE_PATH is not compatible with the
pipeline rag and different implementation needs to be put into place
because the pipeline requires a dictionary with topics alligned with each
path
…On Sat, Mar 29, 2025, 17:27 Ayden Bales ***@***.***> wrote:
Hey, so I noticed that some of the memory filepaths for the pipeline rag
are hardcoded instead of being pulled from config.yaml (Ex: memory_filepath
for pipeline_rag is set to f"chat_logs/pipeline_memory.db" instead of
f"{LOG_SOURCE_PATH}/pipeline_memory.db"; vectorstores for pipeline rag also
don't refer to VEC_STORE_PATH). I am creating a pull request that replaces
these hardcoded filepaths with dynamic ones pulled from the config.
More importantly, however, I have not been able to get the pipeline rag to
work. Any question I ask results in llm_topic returning a response of None
and the ValueError "Invalid topic 'None' encountered in state. Please
ensure a valid topic is set." is thrown.
I have tried the following initial questions and they all result in this
error:
- Who was Karl G. Maeser?
- Why was Karl G. Maeser significant to BYU history?
- What contributions did Karl G. Maeser make to education?
- What is the history of BYU?
- When was BYU founded?
- What majors are offered at BYU?
- Can you help answer some of my questions?
Regardless of what I ask, it appears that llm_topic always returns a None
response. I know you were working on handling None responses in this
specific instance. Do you still see this error on your end?
—
Reply to this email directly, view it on GitHub
<#61 (comment)>, or
unsubscribe
<https://github.com/notifications/unsubscribe-auth/BLVPHUVT5CZ3L3LJXDGJFBD2W4T77AVCNFSM6AAAAABZWGDYOOVHI2DSMVQWIX3LMV43OSLTON2WKQ3PNVWWK3TUHMZDONRUGI4DQMJYHA>
.
You are receiving this because you were assigned.Message ID:
***@***.***>
[image: Parsistence]*Parsistence* left a comment (byu-cpe/Maeser#61)
<#61 (comment)>
Hey, so I noticed that some of the memory filepaths for the pipeline rag
are hardcoded instead of being pulled from config.yaml (Ex: memory_filepath
for pipeline_rag is set to f"chat_logs/pipeline_memory.db" instead of
f"{LOG_SOURCE_PATH}/pipeline_memory.db"; vectorstores for pipeline rag also
don't refer to VEC_STORE_PATH). I am creating a pull request that replaces
these hardcoded filepaths with dynamic ones pulled from the config.
More importantly, however, I have not been able to get the pipeline rag to
work. Any question I ask results in llm_topic returning a response of None
and the ValueError "Invalid topic 'None' encountered in state. Please
ensure a valid topic is set." is thrown.
I have tried the following initial questions and they all result in this
error:
- Who was Karl G. Maeser?
- Why was Karl G. Maeser significant to BYU history?
- What contributions did Karl G. Maeser make to education?
- What is the history of BYU?
- When was BYU founded?
- What majors are offered at BYU?
- Can you help answer some of my questions?
Regardless of what I ask, it appears that llm_topic always returns a None
response. I know you were working on handling None responses in this
specific instance. Do you still see this error on your end?
—
Reply to this email directly, view it on GitHub
<#61 (comment)>, or
unsubscribe
<https://github.com/notifications/unsubscribe-auth/BLVPHUVT5CZ3L3LJXDGJFBD2W4T77AVCNFSM6AAAAABZWGDYOOVHI2DSMVQWIX3LMV43OSLTON2WKQ3PNVWWK3TUHMZDONRUGI4DQMJYHA>
.
You are receiving this because you were assigned.Message ID:
***@***.***>
|
I just tried getting it to work with your implementation, without changing the paths in the vectorstore_config dictionary. I am still running into the same issue where it is throwing the same ValueError for any given input. It is able to successfully connect to the sq3lite database files, the error is being thrown specifically at line 136 of pipeline_rag.py where current_topic is always assigned a value of None. Maybe we can meet up and I can see how you were able to get it to work. |
Pull Request Changelog
Summary
This pull request introduces a dynamic Retrieval-Augmented Generation (RAG) pipeline that optimizes retrieval by only loading relevant vector stores based on the user's topic. It also integrates this RAG system into the example code and updates copyright information.
Changes
🚀 New Features
pipeline_rag.py
:🔧 Enhancements
Integrated the new RAG pipeline into the example code
Improved copyright information
📜 Detailed Explanation of
pipeline_rag.py
Purpose
pipeline_rag.py
provides a modular and efficient approach to retrieval-augmented generation by dynamically loading only the necessary vector stores based on extracted topics.Key Components
TypedDict
): Defines the conversation state, including message history, current topic, and retrieved context.normalize_topic(topic: str)
: Ensures topic names are standardized for retrieval matching.get_pipeline_rag(...)
:vectorstore_config
.gpt-4o-mini
) with structured system prompts to guide topic determination and routing.SqliteSaver
.initial_topic_node(state, vectorstore_config)
:routing_node(state, vectorstore_config)
:make_retrieval_node(topic)
):generate_node(state)
:✅ Impact
📌 Next Steps
This changelog provides a structured overview of your changes while highlighting the technical improvements in
pipeline_rag.py
. Let me know if you’d like any modifications! 🚀