RAG Pipeline Sidecar Architecture for Long-Context LLM Coherence

Resolve Bottlenecks,
Find Innovative Solutions
Generate Solutions

Solution Overview

Problem

Large Language Models (LLMs) face challenges in maintaining coherence and performing long-range reasoning when processing long documents, leading to performance drops, especially in domains like legal, engineering, and healthcare, and existing Retrieval-Augmented Generation (RAG) systems struggle with inefficient document chunking and inadequate context preservation.

Innovation Solution

The system employs an iterative attention focusing technique (LASER) to refine and condense document context, and a scored context-optimized retrieval enhancement (SCORE-RAG) for improved coherence and relevance, along with a network of smaller LLMs for specialized tasks, and Functional Language Modeling (FLM) using Hierarchical Tokens (H-Tokens) for enhanced context management.

Engineering Contradictions & Design Principles

VSEngineering Contradiction Analysis

1Reliability

If LLMs process long documents directly, then they can maintain original context, but their attention span is exceeded and coherence deteriorates

Engineering Contradiction:
ImprovecoherenceVSAvoidattention span
Core Design Contradiction:
ReliabilityVSLength of moving object

Solution Approach 1:

The patent divides long documents into smaller chunks or segments that fit within the LLM's attention span. This segmentation allows the model to process manageable portions while maintaining coherence through iterative attention focusing techniques that refine and condense context across segments.

Inventive Principle:
Principle #1Segmentation

Solution Approach 2:

The patent introduces hierarchical token structures (H-Tokens) that add a new dimension to token representation. By organizing tokens hierarchically, the system can capture long-range dependencies without exceeding the attention span, effectively adding a temporal or structural dimension to the processing.

Inventive Principle:
Principle #17Another dimension (Dimensionality change)

2Loss of information

If existing RAG systems retrieve context from long documents, then they can provide relevant information, but document chunking is inefficient and context preservation is inadequate

Engineering Contradiction:
Improvecontext preservationVSAvoidretrieval efficiency
Core Design Contradiction:
Loss of informationVSProductivity

Solution Approach 1:

The patent performs preliminary action by pre-processing documents into optimized chunks with preserved contextual relationships before retrieval. The hierarchical token structure and iterative attention focusing are applied in advance, so that when retrieval occurs, the context is already optimized for both preservation and efficiency.

Inventive Principle:
Principle #10Preliminary action

Solution Approach 2:

The patent introduces H-Tokens as an intermediary representation between raw document text and LLM processing. These hierarchical tokens serve as a mediator that preserves contextual information while enabling efficient retrieval and processing, bridging the gap between raw text and model input.

Inventive Principle:
Principle #24Intermediary (Mediator)

3Adaptability or versatility

If a single large LLM is used for all tasks, then it can handle diverse queries, but computational efficiency decreases

Engineering Contradiction:
Improvetask coverageVSAvoidcomputational efficiency
Core Design Contradiction:
Adaptability or versatilityVSUse of energy by moving object

Solution Approach 1:

The patent segments the monolithic LLM approach into a network of smaller, specialized LLMs, each optimized for specific task types. This segmentation maintains versatility through the network's collective capability while improving computational efficiency by routing queries to appropriately-sized models.

Inventive Principle:
Principle #1Segmentation

Solution Approach 2:

The patent creates a universal system through a network of specialized LLMs that collectively handle diverse queries. Each model in the network serves multiple functions within its domain, and the network as a whole provides universal coverage, achieving multi-functionality without requiring a single large model.

Inventive Principle:
Principle #6Universality (Multi-functionality)

Data Source

PatentUS20250355908A1Method and System for Optimizing Use of Retrieval Augmented Generation Pipelines in Generative Artificial Intelligence Applications
Publication Date: 2025.11.20 MADISETTI VIJAY
  • US20250355908A1 patent drawing
  • US20250355908A1 patent drawing
  • US20250355908A1 patent drawing

AI summary

Systems and methods for implementing a sidecar pattern for an AI agent including providing a main large language model (LLM) agent within a container included by a pod in a container environment, attaching a plurality of sidecar services to the main LLM agent, including at least two of implementing a logging service, implementing a guardrails service, implementing a memory management service, and implementing an explanation generator service, and operating the plurality of sidecar services within a container included by the pod that includes the container within which the main LLM agent is provided.