Inspiration
Professional research rarely depends on a single database. A legal or policy question may require statutes, court decisions, administrative decisions, academic literature, and scientific evidence, but these sources are often distributed across separate retrieval systems with different interfaces, metadata, and ranking methods.
Research Gateway was inspired by the need to replace a fragile, manually defined search sequence with a structured orchestration layer. Rather than searching every database in a fixed order, the system determines which sources are relevant, adapts the query for each source, and preserves a transparent record of how the final answer was produced.
What it does
Research Gateway provides a unified entry point for multiple specialized retrieval-augmented generation systems.
When a user submits a research question, the system:
- Analyzes the subject, jurisdiction, document types, and evidence requirements.
- Creates a structured retrieval plan.
- Selects the most relevant specialist databases.
- Rewrites the query for each source when necessary.
- Executes searches through standardized adapters.
- Normalizes results into a shared evidence format.
- Detects duplicate and overlapping documents.
- Reranks evidence across sources.
- Generates a citation-backed answer with clear provenance.
- Reports which sources were searched, skipped, or unavailable.
The goal is not only to produce an answer, but also to provide an auditable research process.
How we built it
Research Gateway is built as an orchestration layer above existing legal, case-law, administrative-decision, and scientific-literature retrieval systems. The underlying databases remain independent, allowing each source to retain its own ingestion pipeline, metadata model, search strategy, and update process.
GPT-5.6 is used to analyze the question, generate a structured research plan, select appropriate sources, transform queries, assess retrieved evidence, and produce the final evidence-grounded response.
Each retrieval system is connected through a source adapter with a common interface. The adapters translate shared search requests into source-specific formats, execute keyword, semantic, hybrid, or metadata-filtered searches, handle failures, and convert results into a normalized evidence schema.
The shared evidence model preserves:
- Source name and document identifier
- Title and document type
- Date and jurisdiction
- Retrieved passage
- Source-specific retrieval score
- Citation details
- Provenance metadata
Codex was used to inspect the existing repositories, understand their interfaces, design the adapter architecture, implement orchestration logic, add schema validation, improve error handling, and create automated tests.
Deterministic operations—including execution control, timeout handling, deduplication, logging, validation, and provenance tracking—are handled in application code. The model is used primarily for tasks that require semantic interpretation.
Challenges we ran into
One major challenge was comparing results from retrieval systems that use different ranking methods. A cosine-similarity score from one database cannot be directly compared with a keyword rank or reranker score from another. We addressed this by preserving source-level rankings and performing cross-source reranking as a separate stage.
Another challenge was maintaining citation provenance throughout query transformation, retrieval, deduplication, reranking, and summarization. Each evidence item therefore receives a stable identifier, and the final answer can cite only evidence that remains in the validated evidence set.
We also needed to balance search coverage with efficiency. Searching every source for every question would increase latency, cost, and irrelevant results. The system therefore records why each source was selected or skipped and supports mandatory-source rules for queries that require particular evidence.
Partial failure was another important issue. A single unavailable database should not cause the entire research request to fail. Source adapters execute independently, allowing the gateway to return partial results while clearly identifying missing or failed sources.
Finally, we had to balance agentic flexibility with predictability. The workflow is therefore divided into explicit stages with validated inputs and outputs, allowing the model to make semantic decisions while the application controls execution.
Accomplishments that we're proud of
We created a common research workflow across previously independent retrieval systems without requiring them to be merged into a single database.
Key accomplishments include:
- Structured query analysis and research planning
- Intelligent routing across specialized RAG systems
- A reusable source-adapter architecture
- Cross-source evidence normalization
- Duplicate and overlap detection
- Evidence reranking
- Citation and provenance preservation
- Partial-failure handling
- Inspectable research traces
- Evidence-grounded response generation
We are particularly proud that the architecture preserves the strengths of specialized databases while providing users with a single coherent research interface.
What we learned
We learned that multi-source RAG is not simply a matter of connecting several vector databases to one language model. The central challenge is coordination: deciding which sources to search, adapting queries, comparing heterogeneous results, eliminating duplication, preserving provenance, and explaining the research process.
We also learned that source specialization is valuable. A universal index may appear simpler, but it can remove domain-specific metadata and retrieval behavior. A federated architecture allows each collection to remain optimized for its own content.
Another important lesson was that observability is essential. Research plans, adapter responses, model decisions, ranking outputs, and failures must be inspectable. Without this information, improving retrieval quality becomes guesswork.
Finally, Codex produced the most reliable results when it was given repository context, explicit constraints, limited implementation scopes, and testable acceptance criteria.
What's next for Research Gateway
The next phase will focus on evaluation, retrieval quality, and usability.
Planned improvements include:
- Creating benchmark questions with manually verified evidence
- Measuring source-selection accuracy
- Evaluating citation correctness and evidence coverage
- Adding domain-specific rerankers
- Improving duplicate detection across document versions
- Supporting iterative searches when the first retrieval pass is insufficient
- Adding temporal and jurisdiction-aware retrieval policies
- Visualizing research plans and evidence relationships
- Expanding the adapter framework to additional professional and academic databases
The long-term goal is to make rigorous multi-source research available through one coherent workflow while preserving the reliability, transparency, and accountability required for professional research.
Built With
- codex
- openai
Log in or sign up for Devpost to join the conversation.