feat: add scientific research context to RAG#11
Open
ridzkyyy wants to merge 1 commit into
Open
Conversation
|
I've been analyzing the current RAG challenges in ISAAC-497. While PR #4 and this PR address basic citations and external fetching, I'm working on a more robust architecture using Llama Index that unifies Semantic Scholar data with local PDFs through a Hierarchical Indexing strategy. My approach includes:
|
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
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.
Summary
POST /api/fetch-researchto retrieve external research context from Semantic Scholar with bounded results, timeout handling, optional API-key support, and no-fail behavior for the chat flow.CHROMA_PATH, boundednResults, and preformatted citation-bearing evidence.localhost:3000, combine uploaded-document evidence with external research evidence, and require citation keys in answers.Bounty context
Related to the Algora ISAAC-497 bounty for an enhanced RAG pipeline for scientific/research workflows. Algora currently links that bounty to
aietal/isaac#45, but I could not access a publicaietal/isaacrepository. This repo contains the existing AimenGPT RAG implementation and already has related RAG bounty work under review, so I am submitting this here for maintainers to confirm fit./claim #45
Why this approach
The current RAG flow only retrieves uploaded Chroma chunks and asks the model to cite them, but it does not provide stable citation keys or broader research context. This patch keeps uploaded documents as the primary evidence source and adds external paper context as a secondary source, which is useful for scientific workflows where users often ask about a concept before uploading every relevant paper locally.
The Semantic Scholar fetch is intentionally bounded and non-fatal. If the external API is slow, unavailable, or rate-limited, the chat still proceeds with local retrieved documents instead of failing the whole answer.
Testing
From
ui/:Results: