dsRAG (Dynamic Selection RAG)
D-Star AI officially launched dsRAG on January 10, 2025. It is a high-performance search engine solution that enables precise and complete contextual retrieval within high-density, unstructured text information sources. This tool excels in texts where information density is exponentially high and document structure is sophisticated, such as financial statements, regulatory approval documents, and lengthy academic papers. To surpass previous contextual chunking techniques, dsRAG is based on the Semantic Sectioning technique, which intelligently divides the text into meaningful segments, taking into account the overall structure of the document, allowing the language model to understand the context more effectively.
dsRAG, officially launched by D-Star AI on January 10, 2025, is a high-performance search engine solution that enables precise and complete contextual retrieval within high-density, unstructured text information sources. This tool excels in texts with exponentially high information density and sophisticated document structures, such as financial statements, regulatory approval documents, and lengthy academic papers. To surpass previous contextual chunking techniques, dsRAG operates based on Semantic Sectioning, a technique that intelligently divides text into meaningful segments while considering the overall structure of the document. Furthermore, it incorporates AutoContext, which forces the combination of a summary of the entire original file and the key objectives of the parent chapter at the top of each microscopically divided text chunk, and Relevant Segment Extraction, an algorithm that dynamically detects and restores fragmented segments with high query relevance into a single, coherent paragraph at the time of search, achieving a high degree of contextual preservation.
Traditional Retrieval-Augmented Generation (RAG) pipelines have relied entirely on hard-coded chunking rules that break down documents into thousands of characters when initiating the input pipeline, which results in the destruction of information continuity and the limitation of providing only fragmented, biased information to the Large Language Model (LLM). This is akin to handing a researcher a single, fragmented piece of paper cut from a complex contract and urging them to make precise decisions about the entire clause. In contrast, dsRAG provides a seamless search user experience, similar to a knowledge manager who is well-versed in the encyclopedia section of a library, listening to the user's question and immediately exploring the optimal subject area and providing the relevant chapters at once. While conventional methods have repeatedly caused information distortion or critical hallucination phenomena due to the loss of contextual information, dsRAG provides differentiated performance that guarantees high recall and perfect accuracy for multi-dimensional queries through the combination of multi-layered document meta-context.
Furthermore, in the life science and biotechnology research ecosystem, dsRAG demonstrates the potential to drastically improve the quality of tasks involving the analysis of large-scale new drug discovery data and multi-institutional clinical trial protocols. The vast number of pharmaceutical approval review documents are organically connected with numerous quantitative numerical tables and clinical design parameters, so that conventional RAG methods often lead to incorrect conclusions when querying adverse event statistics or efficacy indicators for specific groups. However, if a researcher queries the trend of toxicity detection for a specific route of administration, dsRAG thoroughly filters out noise by referencing the chunk header with the clinical stage and substance classification name injected through the AutoContext function. Subsequently, the Relevant Segment Extraction function is activated to reprocess the scattered adverse event indicator tables into a single, complete report segment and deliver it to the language model, allowing researchers to perfectly digest a high-value research workflow in which they can immediately obtain error-free safety review results.
💻 System Requirements
NVIDIA GPU with at least 8GB VRAM is recommended (when running local embeddings/Reranker). When configured via API calls, it can also operate in a CPU environment.
Approximately 2GB of free space is recommended when installing basic dependencies
⚡ Installation
4-1. Quick Start
pip install dsrag
4-2. Detailed Installation
# Install according to your environment for Qdrant or Faiss integration
pip install "dsrag[qdrant]"
# Install macOS PDF preprocessing tools if needed
brew install poppler
import os
from dsrag.create_kb import create_kb_from_file
from dsrag.knowledge_base import KnowledgeBase
# Set API key
os.environ["OPENAI_API_KEY"] = "your-openai-api-key"
os.environ["COHERE_API_KEY"] = "your-cohere-api-key"
# Parse documents and create knowledge base (automatically applies Semantic Sectioning and AutoContext)
kb = create_kb_from_file("my_knowledge_base", "path/to/clinical_document.pdf")
# Load the created knowledge base and perform Related Segment Extraction (RSE) queries
kb = KnowledgeBase("my_knowledge_base")
results = kb.query(["What are the pharmacokinetic parameters for drug A?"])
print(results)
🧬 Bio Use Cases
Precise Extraction of PK/PD Parameters from FDA-Approved Documents
Load dozens of FDA-approved report PDFs into dsRAG[faiss], and query for clinical area under the curve (AUC) values using rse_params to restore structured tables with 96% accuracy without data loss, contributing to clinical trial analysis.
Comparison of Novel Drug Candidates within Global Patent Specifications
For a collection of 800-page patent documents from a multinational pharmaceutical company, inject compound structure name context with AutoContext, and link with Cohere reranker to accurately map target protein and active concentration data, shortening the initial material discovery period.
Analysis of Toxicity Criteria in Multi-Institutional Clinical Trial Protocols
Automatically group and classify sections related to adverse event evaluation criteria (CTCAE) in clinical protocols for various cancer types using Semantic Sectioning, and extract paragraphs reporting adverse events of a specific grade or higher into single segments of 1024x1024 tokens or more for use in drug safety review.
FAQ
What is dsRAG (Dynamic Selection RAG)?
dsRAG, officially launched by D-Star AI on January 10, 2025, is a high-performance search engine solution that enables precise and complete contextual retrieval within high-density, unstructured text information sources. This tool excels in texts with exponentially high information density and sophisticated document structures, such as financial statements, regulatory approval documents, and lengthy academic papers. To surpass previous contextual chunking techniques, dsRAG operates based on Semantic Sectioning, a technique that intelligently divides text into meaningful segments while considering the overall structure of the document. Furthermore, it incorporates AutoContext, which forces the combination of a summary of the entire original file and the key objectives of the parent chapter at the top of each microscopically divided text chunk, and Relevant Segment Extraction, an algorithm that dynamically detects and restores fragmented segments with high query relevance into a single, coherent paragraph at the time of search, achieving a high degree of contextual preservation. Traditional Retrieval-Augmented Generation (RAG) pipelines have relied entirely on hard-coded chunking rules that break down documents into thousands of characters when initiating the input pipeline, which results in the destruction of information continuity and the limitation of providing only fragmented, biased information to the Large Language Model (LLM). This is akin to handing a researcher a single, fragmented piece of paper cut from a complex contract and urging them to make precise decisions about the entire clause. In contrast, dsRAG provides a seamless search user experience, similar to a knowledge manager who is well-versed in the encyclopedia section of a library, listening to the user's question and immediately exploring the optimal subject area and providing the relevant chapters at once. While conventional methods have repeatedly caused information distortion or critical hallucination phenomena due to the loss of contextual information, dsRAG provides differentiated performance that guarantees high recall and perfect accuracy for multi-dimensional queries through the combination of multi-layered document meta-context. Furthermore, in the life science and biotechnology research ecosystem, dsRAG demonstrates the potential to drastically improve the quality of tasks involving the analysis of large-scale new drug discovery data and multi-institutional clinical trial protocols. The vast number of pharmaceutical approval review documents are organically connected with numerous quantitative numerical tables and clinical design parameters, so that conventional RAG methods often lead to incorrect conclusions when querying adverse event statistics or efficacy indicators for specific groups. However, if a researcher queries the trend of toxicity detection for a specific route of administration, dsRAG thoroughly filters out noise by referencing the chunk header with the clinical stage and substance classification name injected through the AutoContext function. Subsequently, the Relevant Segment Extraction function is activated to reprocess the scattered adverse event indicator tables into a single, complete report segment and deliver it to the language model, allowing researchers to perfectly digest a high-value research workflow in which they can immediately obtain error-free safety review results.
When should I use dsRAG (Dynamic Selection RAG)?
D-Star AI officially launched dsRAG on January 10, 2025. It is a high-performance search engine solution that enables precise and complete contextual retrieval within high-density, unstructured text information sources. This tool excels in texts where information density is exponentially high and document structure is sophisticated, such as financial statements, regulatory approval documents, and lengthy academic papers. To surpass previous contextual chunking techniques, dsRAG is based on the Semantic Sectioning technique, which intelligently divides the text into meaningful segments, taking into account the overall structure of the document, allowing the language model to understand the context more effectively.
What is a biomedical use case for dsRAG (Dynamic Selection RAG)?
Precise Extraction of PK/PD Parameters from FDA-Approved Documents: Load dozens of FDA-approved report PDFs into dsRAG[faiss], and query for clinical area under the curve (AUC) values using rse_params to restore structured tables with 96% accuracy without data loss, contributing to clinical trial analysis.
📝 Update Notes
No update notes yet.
🧪 Related Code of Life
No related Code of Life posts yet.