Building a Healthcare Copilot for Biology and Life Science Research

owkin · Healthcare · 2025 · source Agentic: no · promotional bias: low · source-backed · extracted with prompt 0.5.4 (schema v2)

Generated from extraction.json — do not edit by hand. Every claim cites verbatim source evidence; stated means the quote directly asserts the claim, implied means it supports it indirectly.

Problem

Domain: Healthcare and life-science research copilot

Owkin needed a copilot that helped biology and life-science researchers answer scientific questions over structured biological databases and literature while respecting healthcare privacy, semantic ambiguity, cost, latency, and evaluation constraints.

Constraints:

Architecture

Owkin built a healthcare copilot with multiple research tools: a prior-knowledge database tool that translates natural-language biology questions into simple Polars SQL over curated Parquet databases, then sends the filtered subset to another LLM for a cited answer; and a literature-search tool that retrieves PubMed abstracts with hybrid sparse+dense search, metadata filters, and reranking before generation. Monitoring runs through LangFuse and OpenTelemetry, and domain experts validate outputs.

Diagram confidence: reconstructed (reconstructed from prose).

flowchart LR
  healthcare-copilot["Healthcare copilot"] --> prior-knowledge-database-tool["Prior knowledge database tool"]
  healthcare-copilot --> literature-search-tool["Literature search tool"]
  healthcare-copilot --> monitoring-and-feedback["Monitoring and feedback"]
  prior-knowledge-database-tool --> polars-query-engine["Polars query engine"]
  prior-knowledge-database-tool --> structured-output-layer["Structured-output layer"]
  prior-knowledge-database-tool --> sql-sandbox["SQL sandbox"]
  polars-query-engine --> answer-generation-llm["Answer generation LLM"]
  literature-search-tool --> vector-database["Vector database"]
  vector-database --> metadata-filters["Metadata filters"]
  vector-database --> reranker["Reranker"]
  reranker --> answer-generation-llm
  monitoring-and-feedback --> domain-expert-panel["Domain expert panel"]
Drag to pan · scroll or use +/− to zoom · reconstructed from the source's described component topology

Components

Component Role Interacts with
Healthcare copilot Research-facing interface that exposes data-visualization, prior-knowledge database, and literature-search tools. Prior knowledge database tool, Literature search tool, Monitoring and feedback
Prior knowledge database tool Transforms natural-language questions into simple SQL over curated biological databases, then formats a cited answer. Healthcare copilot, Polars query engine, Structured-output layer, SQL sandbox, Answer generation LLM
Polars query engine Loads Parquet biological databases and executes filtered SQL queries over smaller subsets. Prior knowledge database tool, SQL sandbox, Answer generation LLM
Structured-output layer Uses Pydantic and Instructor to force the generated SQL request into an expected schema and retry invalid outputs. Prior knowledge database tool
SQL sandbox Checks generated SQL against keyword rules, non-production data, and Polars exceptions before execution on sensitive data. Prior knowledge database tool, Polars query engine
Literature search tool RAG tool for PubMed literature that combines embeddings, lexical signals, metadata filtering, reranking, and cited answer generation. Healthcare copilot, Vector database, Metadata filters, Reranker, Answer generation LLM
Vector database Stores encoded PubMed abstracts and supports sparse+dense retrieval over the literature corpus. Literature search tool, Metadata filters, Reranker
Metadata filters Filters retrieved literature by fields such as author, date, and review-versus-original paper before generation. Vector database, Literature search tool
Reranker Reorders retrieved papers by relevance to the complete research question. Literature search tool, Vector database, Answer generation LLM
Answer generation LLM Generates structured natural-language answers and citations from filtered tables or retrieved literature. Prior knowledge database tool, Literature search tool
Monitoring and feedback LangFuse, OpenTelemetry, thumbs-up/down, and detailed user reviews for production feedback. Healthcare copilot, Domain expert panel
Domain expert panel Biomedical researchers, biostatisticians, and data scientists who validate tools and provide rapid feedback. Monitoring and feedback

Data flow

For structured biology questions, the copilot loads curated biological data into Polars, uses an LLM with enriched column metadata to produce a simple SQL filter, validates and sandboxes that query, feeds the smaller result table or a statistical description into a second LLM, and formats the answer with database links. For literature questions, it encodes PubMed abstracts, retrieves candidates with hybrid sparse and dense vectors, filters metadata such as paper type, reranks the top results, and generates a cited answer.

4 supporting quotes
“the data this uh uh parket file is loaded with polars and polars enables you to um to query to filter the data uh with SQL language.”transcript, stated
“a smaller subset of the database. the data set and uh go to another uh LLM to create a structured answer. So the answer in free text along with the sources”transcript, stated
“instead of relying only with the with the keywords uh which are encoded with sparse vectors. You going to use it along with dense vectors”transcript, stated
“You can also had add a reranker after the retrieval of those let's say top 100 uh to be able to to ask uh what are the papers that are the most important”transcript, stated

Why this architecture

Owkin split the copilot into bounded tools because healthcare questions require different data access paths and controls. Text-to-SQL keeps structured database access narrow and auditable, while RAG keeps literature grounding outside model memory. Hybrid search, metadata filters, reranking, schema-constrained SQL, and domain validation were added because simple schema prompting, dense retrieval alone, and public benchmarks were inadequate for biomedical use.

4 supporting quotes
“So you cannot put the whole data set the whole table into an LLM in the prompt. It will not work. Even though now cloud son 4 has 1 million tokens as input, it will cost you a lot of money, but it's also really slow. So you need to be careful what you put in the prompt. So”transcript, stated
“database schema we realized quickly that it had to be really well uh written in non-ambiguous term because of the specificity we have to to embed some knowledge uh on let's say the acronyms that I taught you before what is a gene what is a protein mean what is the”transcript, stated
“retrieve this kind of paper and so we decided to go with an hybrid search uh so instead of relying only with the with the keywords uh which are encoded with sparse vectors. You going to use it along with dense vectors which captures more the semantic of the sentence and”transcript, stated
“uh make your own benchmark uh with uh domain expert uh um validate your tools and your agent um to have the to really control what what your uh what your tool is doing. And here at Okin, we are building this copilot not to replace researcher, but we want to to help them”transcript, stated

Models used: Anthropic · Claude Sonnet 4 · embedding models

Scale

Alternatives considered (roads not taken)

Put the whole table into the LLM prompt

Rejected because: The transcript says this would not work, would exceed or stress context limits, be slow, and cost too much.

“So you cannot put the whole data set the whole table into an LLM in the prompt. It will not work. Even though now cloud son 4 has 1 million tokens as input, it will cost you a lot of money, but it's also really slow. So you need to be careful what you put in the prompt. So”transcript, stated
“Even though now cloud son 4 has 1 million tokens as input, it will cost you a lot of money, but it's also really slow.”transcript, stated

Provide only ordinary database schema to the SQL-generating LLM

Rejected because: Column names and types were not enough for biomedical semantics; column descriptions needed biological context.

“more than simple database schema we realized quickly that it had to be really well uh written in non-ambiguous term”transcript, stated

Use dense semantic retrieval alone for literature search

Rejected because: Dense retrieval returned papers from a related-but-wrong protein family, so the team combined sparse and dense vectors.

“it gives me back some some um some papers about ly6 So like okay there's plur in the name but I it happened that it has nothing to do”transcript, stated
“we decided to go with an hybrid search uh so instead of relying only with the with the keywords uh which are encoded with sparse vectors.”transcript, stated

Rely on public biology benchmarks for evaluation

Rejected because: The speaker argued biology answers are contextual and public benchmark items can be wrong, so domain-expert benchmarks are needed.

“usually biology question cannot be answer by yes or no. It's almost all the time it depends. So it depends of what it depends of a lot of things and um something that has been highlighted recently is that I don't know if you know the humanity last exam which is a”transcript, stated
“the bio biology life science part of humanity last exam they found that there were almost 30% of the Q&A in it that were probably wrong”transcript, stated

Patterns

rag-retrieval (retrieval)

The literature tool retrieves PubMed abstracts and passes them to an LLM so answers are grounded in external scientific documents.

“Uh so we used a really famous technique called rag that you probably already know.”transcript, stated
“you will encode this question and retrieve the let's say top 100 items around the space of the closest and you will give them along with the question”transcript, stated

hybrid-search (retrieval)

Owkin combined sparse keyword vectors with dense semantic vectors after dense-only retrieval confused exact biomedical terms with related protein-family names.

“so we decided to go with an hybrid search uh so instead of relying only with the with the keywords uh which are encoded with sparse vectors.”transcript, stated
“You going to use it along with dense vectors which captures more the semantic of the sentence and those together will give you better results.”transcript, stated

structured-output-contract (generation)

The text-to-SQL tool used Pydantic and Instructor to constrain LLM outputs to a schema and retry invalid SQL-request objects.

“we used pyentic and instructor which is a tool uh which is going to force the LLM to enforce a schema a schema defined by pyntic”transcript, stated
“if it doesn't succeed it will retry internally”transcript, stated

guardrails-io-filtering (safety)

Owkin guarded generated SQL by keyword allow/deny lists, sandbox execution, and Polars exception handling before letting queries touch data.

“What you can do is blacklist white list u important keywords like update erase and so on.”transcript, stated
“launch your SQL query in a sandbox environment with not your production data um to ensure that it's valid and not malicious.”transcript, stated

retrieval-ranking (retrieval)

The PubMed RAG system added metadata filtering and reranking so retrieved papers were original, relevant, and useful for answering the question.

“where you're going to have meta data let's say author a date and here if it's a reviewing or original paper to to be able to filter”transcript, stated
“You can also had add a reranker after the retrieval of those let's say top 100 uh to be able to to ask uh what are the papers that are the most important”transcript, stated

eval-driven-development (evaluation)

Owkin treated public benchmarks as insufficient for scientific questions and used domain experts plus production feedback to validate the copilot.

“make your own benchmark uh with uh domain expert uh um validate your tools and your agent um to have the to really control what what your uh what your tool is doing.”transcript, stated
“we add also on on the copilot human human human feedback the availab the availability to give thumb ups of thumb down and add a review”transcript, stated

privacy-preserving-processing (safety)

Healthcare privacy constraints shaped both prompt design and development data access, including avoiding patient data in prompts and using synthetic data for development.

“everything you put in your in the LLM prompt you have to be comfortable sharing it sharing it with the public”transcript, stated
“you don't want patient data to be outputed and visible”transcript, stated

observability-tracing (operations)

The deployed copilot used LangFuse, OpenTelemetry, and explicit user feedback to observe production behavior and feed improvement loops.

“for the monitoring part. So we used to monitor um lung fuse and open telemetry.”transcript, stated
“the availability to give thumb ups of thumb down and add a review on what's what's going on if it's bad.”transcript, stated

Tradeoffs

Structured database access

Chose natural-language-to-SQL over filtered subsets over passing full biological tables into the prompt.

Rationale: Filtered SQL kept the context small enough to be cheaper, faster, and more focused.

“So you cannot put the whole data set the whole table into an LLM in the prompt. It will not work.”transcript, stated
“if the filtered data is too large, it can exceed token limits or become prohibitively expensive”summary, stated

Structured output enforcement

Chose Pydantic and Instructor schema retries over free-form SQL-generation outputs.

Rationale: The team needed reliable query objects rather than extra prose around the SQL.

“the LLM was outputting more than this the SQL query and so it highlighted the the need of having structured output.”transcript, stated
“if it doesn't succeed it will retry internally”transcript, stated

Literature retrieval strategy

Chose hybrid sparse+dense search with metadata filters and reranking over dense-vector semantic search alone.

Rationale: Hybrid search preserved exact biomedical term matching while dense vectors captured semantic similarity.

“it should not retrieve this kind of paper and so we decided to go with an hybrid search”transcript, stated
“those together will give you better results.”transcript, stated

Security checks in the prompt path

Chose selective guardrails and data exclusion over putting sensitive prompts and patient data directly into LLM calls.

Rationale: Prompt scanning can add latency, and any prompt content must be treated as potentially extractable.

“there are today some uh tools that exist some guil that will check uh your your your prompt for any malicious or or anything like this but it adds latency to your system”transcript, stated
“everything you put in your in the LLM prompt you have to be comfortable sharing it sharing it with the public”transcript, stated

Evaluation approach

Chose custom domain-expert benchmarks and feedback over generic biology benchmark scores.

Rationale: Scientific answers are contextual and public benchmarks can encode wrong or underdetermined Q&A pairs.

“usually biology question cannot be answer by yes or no. It's almost all the time it depends.”transcript, stated
“make your own benchmark uh with uh domain expert uh um validate your tools and your agent”transcript, stated

Gotchas (what bit them)

A plain schema prompt did not give the LLM enough biomedical context to generate useful SQL.

Root cause: Biology column names and acronyms carry domain-specific meanings that cannot be inferred from simple type information.

Resolution: Owkin enriched column metadata with non-ambiguous descriptions of the biological meaning and relationships behind fields.

“more than simple database schema we realized quickly that it had to be really well uh written in non-ambiguous term because of the specificity”transcript, stated
“what is a gene what is a protein mean what is the relation between them”transcript, stated

Generated SQL could be invalid, too complex, or malicious.

Root cause: The LLM is producing executable queries over data, so malformed or unsafe operations are possible.

Resolution: The team constrained outputs with schema enforcement, keyword lists, sandbox execution, and Polars exception handling.

“Also you have to ensure that the sq this SQL query which has been created is not is valid and not malicious for your data.”transcript, stated
“polar polars has a um it will raise exception if the if the for example the SQL is not valid or too complex.”transcript, stated

Pure semantic retrieval returned plausible but wrong biomedical papers.

Root cause: Dense embeddings captured related protein-family semantics while missing the user's exact biomedical term intent.

Resolution: Owkin moved to hybrid search combining sparse keyword vectors with dense semantic vectors.

“it gives me back some some um some papers about ly6 So like okay there's plur in the name but I it happened that it has nothing to do”transcript, stated
“You going to use it along with dense vectors which captures more the semantic of the sentence and those together will give you better results.”transcript, stated

The system retrieved too many review papers when researchers wanted original science.

Root cause: Retrieval lacked metadata constraints for paper type before generation.

Resolution: The team indexed metadata such as paper type so reviews could be filtered before retrieval and reranking.

“Then uh the researcher said okay um it only brings backs it brings backs reviewing papers.”transcript, stated
“if it's a reviewing or original paper to to be able to filter before the paper you really do not want to get.”transcript, stated

Scientific evaluation could not rely on binary public benchmarks.

Root cause: Biology questions often depend on context, and public benchmark answers can be wrong or underspecified.

Resolution: Owkin used custom domain-expert validation and production feedback instead of treating generic benchmarks as definitive.

“usually biology question cannot be answer by yes or no. It's almost all the time it depends.”transcript, stated
“make your own benchmark uh with uh domain expert uh um validate your tools and your agent”transcript, stated

Developers could not use real patient data locally, even when anonymized.

Root cause: Healthcare privacy and consent constraints apply to development environments as well as production systems.

Resolution: The team used synthetic omics data, but had to make it biologically meaningful rather than random.

“you cannot you're not permitted to have the data uh the real data that we're work working on even though it's anonymize”transcript, stated
“you have to get synthetic data but it's not easy to make synthetic data of omix data it has to have a meaning you cannot put random values”transcript, stated

Evaluation

Owkin combined production monitoring, thumbs-up/down reviews, detailed user feedback, and custom domain-expert validation rather than relying on generic public benchmarks.

Metrics: thumbs up/down user feedback · detailed production reviews · domain expert validation · benchmark Q&A error analysis

3 supporting quotes
“we used to monitor um lung fuse and open telemetry.”transcript, stated
“we add also on on the copilot human human human feedback the availab the availability to give thumb ups of thumb down and add a review”transcript, stated
“make your own benchmark uh with uh domain expert uh um validate your tools and your agent”transcript, stated

Outcomes

The system operated over curated databases with hundreds of columns and tens of thousands of rows, and over a PubMed corpus of more than 26 million abstracts; its vector database hosting cost about $800 per month.

3 supporting quotes
“We wanted to build a tool that would do this automatically from a natural language question and reply with the formatted answer”transcript, stated
“we decided to go with an hybrid search”transcript, stated
“when we released the the product, it was only meant for um biology researcher academics”transcript, stated