Feat: Ragtime! Add RAG capability to stack! (WIP!) #128
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
This is a WIP commit so far, represents current state of this thing but is not yet tested.
Things to note:
queryEngine
, which allows you to ask questions and it'll route the question through the whole pipeline. This would be an alternative way to query LLMs.Note that right now we're hard-coded to OpenAI, but we could trivially replace that with Anthropic etc if we wanted to.
Next steps for me as of current commit: I need to actually run this and make sure it behaves in the ways that I expect. I want specifically to confirm that it persists as anticipated in Pinecone, and that re-running it is idempotent and doesn't rebuild the index on every operation - the docs weren't entirely clear for me in that regard.
But, this should serve as a sort of template for RAG-style work within CB. We can take this in various directions - we could hard-code different rags for different sources, we could parameterize this and make the whole thing filter on metadata so a given query only pulls from specific sources, we could merge this into a single index, etc. There are also a ton of third-party libs that integrate with this, so from this baseline we can really expand in any direction.