
Building ResearchGapAI: An Autonomous Engine for Finding What Science Hasn't Solved Yet
An autonomous research intelligence pipeline that mines thousands of papers to surface genuinely unexplored research directions, verifies each one against real evidence and an adversarial critique stage, and shows how it was built to migrate onto AWS despite hitting account verification delays during development.
The problem we kept running into
Every researcher has had this moment. You spend weeks reading papers on a topic, feel like you finally understand the landscape, and then you propose an idea to your advisor or a funding committee, only to be told someone already did exactly that in 2021. Or worse, you find out six months into a project that your "novel" direction was quietly abandoned by three other labs because it turned out to be a dead end.
The tools that exist to help with this mostly summarize what's already known. Google Scholar and Semantic Scholar rank papers. Tools like Elicit and Consensus give you a synthesized answer to a question you already knew how to ask. None of them are built to answer a harder question: what hasn't anyone tried, and is that because nobody's gotten around to it, or because it doesn't actually work?
That's the gap we set out to close with ResearchGapAI.
What it actually does
ResearchGapAI pulls papers from OpenAlex, arXiv, and PubMed (or lets you upload your own PDFs) and builds a two axis map of the field. One axis is methodology, the other is application domain, both discovered through unsupervised clustering rather than hand picked categories. Cross those two axes and you get a matrix where each cell represents a specific combination, like "graph neural networks applied to rare disease genomics." Some cells are dense with papers. Some are empty even though the cells around them are packed. Those empty cells surrounded by activity are the interesting ones.
But an empty cell alone doesn't mean much. It could be empty because it's genuinely unexplored, or because it's a scientifically pointless combination nobody bothered to try. So every candidate gap has to clear two more hurdles before it gets shown to a user.
First, it needs support from at least one of eight evidence signals pulled directly from the papers themselves: things like a limitation that shows up in two or more independent papers and never gets addressed later, an author stated future direction that nobody followed up on, or a contradiction between two papers' results that never got resolved.
Second, it has to survive an adversarial review we call the Devil's Advocate pass. This is a separate stage in the pipeline whose entire job is to try to kill the idea. It checks whether the gap has secretly already been studied under different terminology, whether the supporting evidence is a real quote from a paper or an AI hallucination, whether the compute and data actually exist to pursue it, and whether solving it would meaningfully move the field or just be a trivial exercise.
Only gaps that survive both checks make it into the final output, which comes as a formatted research dossier with the evidence clearly split into two sections: source facts, which are verbatim extracted from papers, and AI inferences, which are the system's own reasoning layered on top. That separation matters a lot to us. A researcher shouldn't have to guess which parts of a report are grounded and which parts are the model speculating.
How it's built
The backend is a FastAPI service, and the frontend is a Streamlit dashboard with an interactive heatmap of the matrix and a knowledge graph view where node size reflects citation impact. Both talk to a PostgreSQL database running the pgvector extension, which stores paper embeddings so the corpus compounds over time instead of getting re-fetched and re-processed on every run. For fast, low latency retrieval within a single session, we layer FAISS on top for the RAG chat feature, which lets you ask natural language questions and get answers grounded only in the papers actually indexed, with citations attached.
The whole pipeline is orchestrated with LangGraph, which gave us a deterministic state machine instead of a tangle of prompt chains. Each stage, from query expansion through ingestion, clustering, evidence mining, matrix analysis, the Devil's Advocate check, and final dossier synthesis, is a distinct node with its own immutable state. That structure made debugging dramatically easier than a single giant prompt would have, and it means we can swap out or improve individual stages without touching the rest of the system.
PDF parsing runs through PyMuPDF and PDFMiner, tuned specifically to handle the double column layout common in IEEE and ACM papers, since generic PDF extractors tend to scramble text order in that format.
Where AWS fits, and where it doesn't yet
We designed the whole system with cloud deployment in mind from the start. The services are containerized independently so they map cleanly onto managed infrastructure: Postgres and pgvector are meant to run on RDS, file storage is built against an S3 compatible interface, and every service is Dockerized so it should run on ECS or EC2 without modification.
In practice, we hit a wall we didn't expect. New AWS account verification took more than 24 hours to clear, and that ate straight into our build window. Rather than sit and wait, we kept building against a local stack, using LocalStack to emulate S3 during development so that swapping in real S3 later should be a configuration change rather than a rewrite. The RDS and ECS migration path is documented, but we weren't able to stand it up live before the deadline.
It's a little frustrating to have architected something cloud native and then ship the demo running on Docker Compose instead. But it also taught us something concrete about designing for portability from day one. Because we never hardcoded anything to a specific provider, the path to actually deploying on AWS is still just a matter of pointing environment variables at real endpoints, not rearchitecting anything.
What we learned
The most useful realization from this project wasn't technical, it was about trust. Early versions of the pipeline would confidently propose gaps that sounded plausible but weren't actually grounded in anything the papers said. Adding the Devil's Advocate stage and the strict source fact versus AI inference split fixed that, but it also slowed the pipeline down and made us rethink what "done" even means for a system like this. A gap suggestion that's fast but wrong is worse than useless, because it wastes someone's actual research time. Getting comfortable with that tradeoff, speed against trustworthiness, shaped almost every later decision in the project.
We also came away with a much clearer sense of how to build for the cloud without being blocked by it. Designing service boundaries and storage interfaces to be provider agnostic from the start meant an unexpected onboarding delay didn't derail the whole project, just one part of the deployment story.
What's next
The next phase we're planning includes indexing code and model artifacts from GitHub and HuggingFace alongside papers, adding collaborative workspaces so research teams can annotate the matrix together, and setting up webhook alerts for when new preprints land in a matrix void someone's been tracking. Longer term, we want to connect the pipeline to automated experiment generation, so a validated gap doesn't just end at a dossier, it comes with a starting point for actually testing it.
If you want to see the code or run it yourself, it's open source: github.com/pratham15541/research_founder
Enjoyed reading this content? Let the author know!
Your likes, comments, shares, and saves help creators reach more builders.
Loading recommendations
Loading article