Access to a reliable knowledge base for Large Language Models (LLMs) is quintessential for retrieval-augmented generation (RAG). We propose a knowledge base curated from scientific ontologies and data sources. The knowledge base is curated with the aid of a list of keywords compiled by a group of researchers with diverse research backgrounds. The curation process involved a multistep verification of data viability before being ingested into a central datastore.
Several workshop sessions were held to compose this list of keywords. Each keyword had to encompass the topic, interest, and scope of the researcher's discipline. After compiling the list of keywords, each was used to find associated research papers from the OpenAlex repository. The search variables Title, Abstract, Keyword, topic, and field were used to fetch the most relevant research papers.
Each research paper was evaluated using the LitTrue.py ingestion script. After the initial filtering system based on the Openalex Api, the script checked whether the location the research takes place in is within the proposed study area and whether the abstract contained usable information. After this initial check, the script evaluates the abstract to check whether the research paper is relevant to the overarching research scope of this study.
After these checks the data is ingested into the following table structure:
Data Base: DB
SCHEMA: Literature
-
paperlist (First entry point of research papers from the script LitTrue.py)
id
doi (doi number)
oa_id (open alex id)
is_parent (is this paper directly related to the keyword or related)
title (title of the research paper)
publication_year (year the research paper was published)
abstract (short description of the research paper)
primary_topic_name (selected topic by research group)
field_name (scientific field selected by research group)
subfield_name (subfield selected by research group)
keyword (initial keywords selected by research group)
module (the overarching research module: module A, Module B, Module C)
oa_keywords (keywords from the research paper).
-
paper_relationship (a table to link research papers to each other)
id
parent_id (relates to the is_parent column in the paper_list)
link_id (references the id column in paper_list)
relationship_type (defines the relationship type: references, relates)
-
authors (a table listing the authors of the research papers)
id
author_name (original author of the research paper)
oa_author_id (open alex id)
institution (institution of the original research paper)
-
authors_papers (a table linking authors table to the paper_list table)
id
author_id (references authors table, id column)
paper_list_id (references paper_list_table,id column)
After the Littrue.py script is finished, the above tables should be present in the database.
To ingest the actual content for each research paper, we download the research and ingest the content using the pdf2db.py script which gives us the following table structure:
Data Base: DB
SCHEMA: Literature
-
paragraphs (individual paragraphs of the research table)
id
parent_id (references paperlist table where parent_id = true)
full_paper_link (references full_text table, id column)
paragraph_type (type of the research paper: Introduction, result, conclusion)
paragraph_text (original text of the research paper)
paragraph_summary (LLM summary of the original text)
paragraph_embedding (vector embedding of the paragraph)
-
full_text (table hosting the URL for each valid research paper)
id
paper_list_id (references paperlist table)
oa_url (URL to download research pdf)
-
question_answers (table hosting LLM generated questions and answers)
id
paragraph_id (references paragraphs table, id column)
concept (LLM generated conceptual understanding of the original text)
question (LLM generated question related concept)
concept_embedding (vector embedding of the concept)
question_embedding (vector embedding of the question)
-
meta_objectives (DEPRECATED)
Lastly the nodes_insert.py and edges_insert.py scripts transfer the data from its relational database structure to the graph structure. That yields the following database structure:
DataBase: DB
SCHEMA: Literature
-
nodes (Production-ready table hosting the previous data in a graph structure)
id
_label (name of the node. Could be the title, keyword, paragraph type, …)
_type (type of node. Could be one of keyword, paragraph, paper, … )
_properties (properties table hosts the actual data such as the abstract, full text, and other relevant data in a dictionary format)
_embedding (deprecated)
_source_id (references the source table id)
embedding (the embedding column for vector search)
-
edges (Edges table linking nodes to each other. This table follows the design of a graph structure)
id
source_node_id (references the id column of the nodes table.)
target_node_id (references the id column of the nodes table.)
_type (the type of edge. Usually has a capitalized VERB, i.e HAS, WROTE)
These tables can be used for natural language processing. Using natural language processing and given the scope and size of the information in this database, many useful links, hidden structures, and conclusions can be drawn.
The scripts can be adjusted to create a knowledge base for any research topic. Moreover, the scripts can be adjusted to fit your exact research structure and needs.