科学的発見を加速:BYOKG と GraphRAG を活用した知能型医薬品研究の推進
AWS は、散在する医薬品研究データを統合し、科学的整合性を保ちながら仮説生成を加速させる「BYOKG」と「GraphRAG」を活用した新アプローチを発表しました。
キーポイント
医薬品開発の構造的課題
従来の方法では成功率が 5% に留まり、データが PubMed や社内ノートなどのサイロに分散しているため、知識の継承や証拠の追跡が困難で開発が遅延しています。
GraphRAG と BYOKG の活用
Amazon Neptune Analytics を基盤とした統合された知識グラフ(BYOKG)により、自然言語での複雑な質問に対し、化合物相互作用から遺伝子発現までを裏付ける証拠付きで即座に回答を提供します。
科学的整合性と推論の可視化
単なる回答だけでなく、各結果に至るまでの完全な推論プロセスと詳細な引用元を示すことで、規制当局への承認に必要な証拠トレイルを明確にします。
組織的知識の損失防止
研究者が退職しても価値ある暗黙知が失われるリスクを軽減し、継続的な研究と画期的な発見を支えるための組織記憶を維持する役割を果たします。
KGLinkerによるグラフ連携と応答生成
KGLinker を初期化することで、自然言語の質問に対して知識グラフの文脈を補強した回答を生成するコアインターフェースが確立されます。
ファジィマッチングによるエンティティリンク強化
FuzzyStringIndex と EntityLinker を組み合わせることで、自然言語テキストとグラフ内のエンティティを柔軟に紐付け、情報抽出の精度を向上させます。
研究期間の劇的短縮と効率化
GraphRAGの導入により、研究サイクルが6ヶ月から3週間へ短縮され、87%の効率向上を実現し、迅速な仮説検証を可能にします。
影響分析・編集コメントを表示
影響分析
このアプローチは、医薬品開発という極めてリスクが高く時間がかかる分野において、AI が単なる情報検索ツールを超えて「推論と証拠に基づく発見」を支援する実用的な転換点を示しています。特に、規制承認に必要な透明性と根拠の可視化を実現することで、医療 AI の現場導入における最大の障壁である信頼性問題を解決する可能性を秘めています。
編集コメント
医薬品開発という重厚な領域において、RAG の進化形である GraphRAG が「証拠の追跡可能性」をどう解決するかに焦点が当たっており、実務への適用性が極めて高い記事です。
医薬品研究において、科学者が直面する根本的な課題は、散在する多様なシステムに存在する膨大な科学知識へのアクセスと接続です。公開された文献や内部のラボノート、ゲノムデータベースに至るまで、重要な知見がサイロ化されたまま閉じ込められており、研究者が包括的なつながりを形成し有望な仮説を生成することが困難になっています。この断片化は創薬プロセスを遅らせ、さらに研究者の交代に伴い貴重な組織的知識が失われるリスクをもたらし、結果として業界全体の効率的な研究開発能力に影響を及ぼします。これらの知識ギャップを科学的整合性を保ちつつ知的に橋渡しするソリューションへの必要性は、ますます高まっています。
The challenge: Scattered data across fragmented systems
主要製薬企業において、研究者は創薬の初期段階において決定的な課題に直面しています。従来の手法では成功率がわずか 5% に留まり、初期スクリーニングには 6 ヶ月以上を要します。科学者たちは、PubMed や社内実験ノート、ゲノムデータベースなど、断片化されたシステムに埋もれた知見をつなぎ合わせようと苦闘していますが、競合他社や時間的制約との戦いの中でその作業は困難を極めます。データの散在性は重複作業や機会の損失をもたらすだけでなく、規制承認に必要なエビデンスの追跡を困難にします。さらに、研究者が退職する際には貴重な暗黙知(タシット・ノウリッジ)も持ち去られ、画期的な発見に必要な組織的記憶がさらに損なわれることになります。
創薬初期段階における課題:
- 成功率の低さと時間効率の欠如 – 試行ごとに 6 ヶ月以上のスクリーニング時間を要し、ヒット率はわずか 5% に過ぎません。
- 断片化された知識システム – 重要な知見が PubMed、ラボノート、データベースに散在しており、関連性の発見を見逃す原因となっています。
- 組織的記憶の喪失 – 研究者が退職すると貴重な知識が消え去り、研究活動の継続性が分断されます。
これらの課題は総じて創薬パイプラインにおいて重大なボトルネックを生み出し、非効率さ、機会損失、そして命を救う治療法の開発における潜在的な遅延を引き起こしています。私たちのソリューションは従来の手法を超えてこれらボトルネックに対処します:グラフ駆動型 AI が相互接続された知識環境を構築することで医薬品研究を支えます。Amazon Neptune Analytics を用いることで、研究者は自然言語で複雑な質問を行い、化合物の相互作用から遺伝子発現、臨床試験に至るまでを結びつける統合された知識グラフから即座に証拠に基づく洞察を得ることができます。このアプローチは単なる回答を提供するだけでなく、詳細な引用経路とグラフ走査ステップを示すことで、各結果の背後にある完全な推論過程を明らかにします。システムが相互接続された研究論文やデータポイントをどのようにナビゲートするかを可視化することで、科学的発見をより透明性が高く再現可能なものにします。
グラフと生成 AI を組み合わせることで、研究科学者は単に情報を検索するだけでなく、推論を強化し、組織の記憶を保持し、それまで埋もれていた洞察を浮き彫りにすることができます。また、これによりより良い仮説を立て、より迅速に進み、出力を信頼できるようになります。なぜなら、すべての洞察には文脈と根拠が伴うからです。遅延のコストが金銭だけでなく人命でも計られる分野において、この変化は単に役立つというレベルを超えています。それは研究が行われる方法そのものを変えるのです。
本稿では、グラフデータベースと生成 AI を組み合わせることで科学的研究を変革する「グラフベースの検索拡張生成(GraphRAG)」について探ります。このアプローチにより、科学的誠実性を損なうことなく、発見プロセスを加速させることが可能です。
高性能なグラフ処理のための Amazon Neptune Analytics と Amazon Bedrock を統合することで、研究者は複雑な科学的関係を理解するだけでなく、直感的な自然言語インターフェースを提供する高度なシステムを構築できます。GraphRAG アーキテクチャは、知識グラフを知的に探索して関連情報パスを特定することで、AI 生成回答の品質を向上させます。これにより、回答が検証済みの科学的データに確実に根ざしていることが保証されます。
このソリューションが科学研究において強力である理由は、植物や化合物からタンパク質、遺伝子、そしてそれらに関連する健康効果に至るまで、エンティティ間の複雑な関係を理解し結びつける能力にあります。この包括的な理解により、研究者はより効率的に洞察を発見し、データ駆動型の意思決定をより高い自信を持って行うことができます。
ソリューション概要
本ソリューションは、Bring Your Own Knowledge Graph (BYOKG) 手法と GraphRAG 機能を強化したアプローチを通じて、研究プロセスを再構築します。知識グラフ(Knowledge Graph)とは、相互に接続されたノードとエッジのネットワークとして異なるエンティティ間の関係を示す情報の構造化表現です。Amazon Neptune を基盤とし、PubMed や Gene Ontology などの公開ソースからのデータと独自データを橋渡しする統合された知識ネットワークへ、多様な科学エンティティ(植物、化合物、遺伝子、タンパク質、健康効果)を統合します。自動化された取り込みパイプラインとグラフアルゴリズムが継続的にこのグラフを強化し、研究者がこれまでバラバラのデータサイロに隠れていた複雑な生物学的関係や洞察を発見するのを支援します。
Neptune Analytics と Amazon Bedrock を活用することで、本ソリューションはグラフアルゴリズムと自然言語クエリを組み合わせ、科学的探求を分析的かつ直感的なものにします。研究者は平易な英語で複雑な質問を行い、グラフの走査に基づいた根拠のある回答を、出典引用や視覚的な経路と共に受け取ることができます。インタラクティブな可視化ツールはさらに透明性と理解度を高め、ユーザーが関係性を探索し、仮説から結論へと追跡し、明確で検証可能な証拠によって結果を検証することを可能にします。これにより、発見の加速と、あらゆる分野における科学的厳密性の強化が実現されます。
ソリューションアーキテクチャ
本ソリューションは、研究者が疾患やトピックに関わる関連する医学論文を迅速に見つけるのを支援します。データセットには、CC BY および CC0 ライセンスの下で提供される PMC オープンアクセスサブセット の HCLS 誌論文、米国国立生物工学情報センター (NCBI) が Bio.Entrez パッケージを通じて提供する誌メタデータ、Disease Ontology の階層構造、および Amazon Comprehend Medical 内の ICD-10-CM リンキング API を使用して抽出された ICD10 コードが含まれています。最終的なデータセットは提供されますが、以下のアーキテクチャは、そのデータセットを作成するために使用されるフローを示しています。
以下の図は、Amazon Bedrock や Amazon Comprehend などのサービスを利用して医療ジャーナルからデータを抽出し、Amazon Neptune Analytics にデータを読み込む様子を示しています。

次の画像は、最終的なグラフを示しており、このグラフには以下のノードタイプが含まれています。
- disease: 疾患オントロジー(Disease Ontology)内の疾患を表します。疾患オントロジーは、どの疾患が他の疾患のサブクラスであるかを理解するためのマッピングを提供します。
- author: 特定のジャーナルの著者を表します。
- journal: ジャーナルそのものを表します。
- journalChunk: 与えられたジャーナルの一部(チャンク)を表します。これらのチャンクは、Amazon Bedrock Knowledge Bases を通じて提供されるデフォルトのチャンキング戦略を使用して決定されました。
- icd10: 医療問題の標準化された分類である ICD-10 コードを表します。icd10 ノードと journal および journalChunk ノード間のエッジは、Amazon Comprehend Medical の ICD-10-CM リンキング機能を使用して作成されました。

独自のグラフデータモデルを使用しているため、BYOKG-RAG ツールキットを利用して、グラフ上での自然言語クエリを実装しています。次の図は BYOKG の構成要素を示しています。

前提条件
始める前に、以下の前提条件が整っていることを確認してください。
- AWS Command Line Interface (AWS CLI) バージョン 2.11.0 以降がインストールされ、設定されていること(インストールガイド)
- 以下の AWS サービスへのアクセス権限があること:
Amazon Neptune Analytics
- Amazon Bedrock (Claude 4.5 Sonnet モデル)
- Amazon SageMaker
- Amazon Simple Storage Service (Amazon S3)
- Amazon Comprehend Medical
- 以下の権限を持つ IAM ロール:
NeptuneAnalyticsFullAccess
- AWSServiceRoleForAmazonNeptuneAnalytics
- AmazonS3ReadOnlyAccess
- AmazonBedrockFullAccess
- ComprehendMedicalFullAccess
- Python 3.9 以降
- graphrag_toolkit バージョン 1.0.0 以降
- Jupyter Notebook 環境
ソリューションの費用概要
このデモを実行した場合の時間あたりの概算コスト:
- Neptune Analytics グラフ、16 mNCU、スタンバイなし、パブリック接続 – $0.48/時間。
- SageMaker Jupyter notebook、t3.medium 型、EBS ボリューム 5 GB – コンピューティングで$0.05/時間、ストレージで$0.70/時間。
- S3 ストレージ(標準)、161 MB – 0.161 GB × $0.023 = 月額$0.0037。
- Amazon Bedrock – Amazon Bedrock のコストは、モデルの使用状況とトークン消費量に依存します。最新の情報は価格設定ページをご覧ください。
Neptune Analytics のセットアップ
GraphRAG ソリューションの実装を開始するために、Neptune Analytics のセットアップから始めましょう。以下の手順では、データインポート、グラフ作成、およびノートブック設定を通じて、知識グラフの基盤を構築する方法をご案内します:
- S3 バケットを作成する: aws s3 mb s3://amzn-s3-bucket-name.
- AWS CLI を使用してデータを自分のバケットにコピーする:
aws s3 sync s3://aws-neptune-customer-samples-us-east-1/sample-notebooks/vector-graph-hybrid-search/graph-data/ s3://amzn-s3-bucket-name/
- Amazon S3 の場所(最初のステップでコピーした先)からインポートするために、CreateGraphUsingImportTask API を使用して Neptune Analytics グラフを作成する。詳細については、Neptune ユーザーガイドを参照してください。プロビジョニングされるメモリの最小値と最大値は 16 に設定します。
- グラフ作成中に、そのグラフに関連付けられた Neptune ノートブックを作成します。ノートブックを使用すると、グラフへのクエリや対話が容易になり、GraphRAG ツールキットの設定と実行も簡単になります。Neptune ノートブックの作成方法の詳細については、Neptune ユーザーガイドを参照してください。
- サンプルノートブックをダウンロードし、Jupyter 環境にアップロードします。

実装ステップ:GraphRAG ツールキットと Amazon Bedrock を用いたモジュール型 GraphRAG システムの構築
この ノートブック では、graphrag-toolkit Python パッケージと Amazon Bedrock の Anthropic Claude 4.5 Sonnet モデルを使用して、ヘルスケア知識グラフ上で構築される検索拡張生成(RAG: Retrieval Augmented Generation)システムに対するモジュール型アプローチを実証します。このソリューションは、高度な言語モデルによる生成と構造化されたグラフデータによる検索を組み合わせることで、自然言語でのクエリ実行や知識グラフ内におけるエンティティリンクをサポートします。
主要コンポーネント
- 言語モデルの初期化 まず、自然言語応答を支える Amazon Bedrock ベースの言語モデル生成器を初期化することから始めます。
from graphrag_toolkit.byokg_rag.llm import BedrockGenerator
def init_llm_generator(model_name='us.anthropic.claude-3-5-sonnet-20240620-v1:0', region_name='us-west-2'):
return BedrockGenerator(
model_name=model_name,
region_name=region_name
)
llm_generator = init_llm_generator()- 知識グラフリンカーの設定 KGLinker は、グラフストアと言語モデル生成器を渡すことで初期化されます。これはグラフへのクエリ実行と回答生成のための中核インターフェースとして機能します。
from graphrag_toolkit.byokg_rag.graph_connectors import KGLinkerdef init_kg_linker(graph_store, llm_generator):
return KGLinker(graph_store=graph_store, llm_generator=llm_generator)
kg_linker = init_kg_linker(graph_store, llm_generator)
- 問い合わせからの応答生成 kg_linker を用いることで、自然言語の質問を投げかけ、知識グラフの文脈によって強化された生成応答を取得することができます。
def generate_kg_response(kg_linker, question, schema, graph_context="Not provided. Use the above schema to understand the graph."):
return kg_linker.generate_response(
question=question,
schema=schema,
graph_context=graph_context
)
使用例
response = generate_kg_response(kg_linker, question, schema)
print(response)
- 検索強化のためのエンティティリンキング 情報抽出の向上と、自然言語テキストをグラフエンティティにリンクさせるために、ファジー文字列インデックス(Fuzzy String Index)と EntityLinker を組み合わせて使用します。
from graphrag_toolkit.byokg_rag.indexing import FuzzyStringIndex
from graphrag_toolkit.byokg_rag.graph_retrievers import EntityLinker
def init_and_link_entities(graph_store, artifacts):
string_index = FuzzyStringIndex()
string_index.add(graph_store.nodes())
retriever = string_index.as_entity_matcher()
entity_linker = EntityLinker(retriever=retriever)
linked_entities = entity_linker.link(artifacts["entity-extraction"], return_dict=False)
linked_answers = entity_linker.link(artifacts["draft-answer-generation"], return_dict=False)
entity_linker, linked_entities, linked_answers を返す
entity_linker, linked_entities, linked_answers = graph_store と artifacts を用いて初期化およびエンティティリンクを実行する
概要
このモジュール構造は、以下のコンポーネントを明確に分離しています:
- 大規模言語モデル(LLM)の初期化(Amazon Bedrock を使用)。
- 知識グラフとのインタフェース(KGLinker)。
- NLP(自然言語による照会)。
- グラフノード上でのエンティティリンク。
このモジュール構造により、異なるドメインやデータセットに対する柔軟な実験と straightforward な拡張が可能になります。
ファジー文字列マッチャーの統合は、ノイズの多い複雑な医療データの文脈において重要な、堅牢なエンティティ認識を可能にします。
Amazon Bedrock の高度な言語モデルと構造化グラフ照会・リンクを組み合わせることで、このソリューションは、知識グラフ上での文脈に応じた質問応答および情報検索のための強力な基盤を形成します。
ソリューションの利点とパフォーマンス指標
本ソリューションの実装から得られた以下の主要なパフォーマンス指標(KPI)は、この GraphRAG 解決策が製薬研究組織に対してどのように測定可能な価値と競争優位性をもたらすかを示しています:
- リサーチタイムラインの加速 – GraphRAG は研究サイクルを 6 ヶ月から 3 週間に短縮し、87 パーセントの効率向上を実現します。これにより迅速な仮説検証と、より速い科学的ブレークスルーが可能になります。
- 成功率の最適化 – 当社の導入事例において GraphRAG は研究サイクルを 6 ヶ月から 3 週間に短縮しました。このソリューションは高度なグラフアルゴリズム(graph algorithms)によって駆動されています。ドメイン横断的な分析により、より効果的な研究方向性と最適なリソース配分が実現されます。
- ワークフロー効率の向上 – 主要指標において測定可能な改善が確認されました:レビュー時間の 70 パーセント短縮、データアクセス速度の 85 パーセント向上、知識活用度の 90 パーセント強化です。チームは戦略的な研究優先事項に集中できるようになります。
- データ駆動型検証 – 高度な追跡および可視化機能により、研究の完全な透明性が確保されます。明確なデータパスが規制遵守を強化し、科学的コミュニケーションを改善します。
- インテリジェントな知識統合 – システムは最小限のリソース影響で新しいデータソースを効率的にスケーリング・統合します。協働の強化により、重要な組織知見が維持されます。
業界リーダーシップの実現
原文を表示
In pharmaceutical research, scientists face a fundamental challenge: accessing and connecting the vast amount of scientific knowledge scattered across disparate systems. From published literature and internal lab notes to genomics databases, critical insights remain trapped in silos, making it difficult for researchers to form comprehensive connections and generate promising hypotheses. This fragmentation slows down the drug discovery process. It also risks valuable institutional knowledge being lost as researchers transition, ultimately affecting the industry’s ability to research and develop efficiently. The need for a solution that can intelligently bridge these knowledge gaps while maintaining scientific integrity has become increasingly important.
The challenge: Scattered data across fragmented systems
At leading pharmaceutical companies, researchers face a critical challenge in early-stage drug discovery, where traditional methods yield only a 5 percent success rate and initial screening takes over six months. Scientists struggle to connect insights buried across fragmented systems such as PubMed, internal lab notes, and genomics databases, all while racing against competitors and time constraints. The scattered nature of data leads to redundant work and missed opportunities. It also makes it difficult to trace the evidence trail needed for regulatory approval. When researchers depart, they often take valuable tacit knowledge with them, further compromising the institutional memory needed for breakthrough discoveries.
Challenges in early-stage drug discovery:
- Poor success rate and time efficiency – Only 5 percent hit rate with over 6 months of screening time per attempt.
- Fragmented knowledge systems – Critical insights scattered across PubMed, lab notes, and databases, leading to missed connections.
- Loss of institutional memory – Valuable knowledge disappears when researchers leave, breaking continuity in research efforts.
These challenges collectively create a significant bottleneck in the drug discovery pipeline, leading to inefficiencies, missed opportunities, and potential delays in developing life-saving treatments. Our solution addresses these bottlenecks by moving beyond traditional methods: graph-powered AI supports pharmaceutical research by creating an interconnected knowledge environment. Using Amazon Neptune Analytics, researchers can now ask complex questions in natural language and receive instant, evidence-backed insights drawn from a unified knowledge graph that connects everything from compound interactions to gene expressions and clinical studies. This approach doesn’t only provide answers. It reveals the complete reasoning behind each result by showing detailed citation paths and graph traversal steps. By exposing how the system navigates through interconnected research papers and data points, it makes scientific discovery more transparent and reproducible.
By combining graph and generative AI, research scientists don’t only retrieve information. They can amplify reasoning, preserve institutional memory, and surface insights that would otherwise stay buried. It also helps them generate better hypotheses, move faster, and trust the outputs, because every insight comes with context and proof. In a field where the cost of delay is measured in both dollars and lives, this shift is more than helpful. It changes how research gets done.
In this post, we explore how Graph-based Retrieval Augmented Generation (GraphRAG) is transforming scientific research by combining graph databases with generative AI. With this approach, you can accelerate discovery processes without compromising scientific integrity.
By integrating Amazon Neptune Analytics for high-performance graph processing with Amazon Bedrock, researchers can build sophisticated systems that not only understand complex scientific relationships but also provide intuitive natural language interfaces. The GraphRAG architecture helps enhance the quality of AI-generated responses by intelligently traversing knowledge graphs to identify relevant information paths. This makes sure that the responses are firmly anchored in verified scientific data.
What makes this solution powerful for scientific research is its ability to understand and connect intricate relationships between entities, from plants and compounds to proteins, genes, and their associated health effects. With this comprehensive understanding, researchers can uncover insights more efficiently and make data-driven decisions with greater confidence.
Solution overview
The solution reimagines the research process through a Bring Your Own Knowledge Graph (BYOKG) approach enhanced with GraphRAG capabilities. A knowledge graph is a structured representation of information that shows relationships between different entities as a network of interconnected nodes and edges. Powered by Amazon Neptune, it integrates diverse scientific entities (plants, compounds, genes, proteins, and health effects) into a unified knowledge network that bridges data from public sources like PubMed and Gene Ontology with proprietary datasets. Automated ingestion pipelines and graph algorithms continuously enrich the graph, helping researchers uncover complex biological relationships and insights that were previously hidden across disconnected data silos.
Using Neptune Analytics and Amazon Bedrock, the solution combines graph algorithms with natural language querying to make scientific exploration both analytical and intuitive. Researchers can ask complex questions in plain English and receive evidence-based answers derived from graph traversal, complete with source citations and visual pathways. Interactive visualization tools further help enhance transparency and understanding, allowing users to explore relationships, trace hypotheses to conclusions, and validate results with clear, verifiable evidence. This accelerates discovery and strengthens scientific rigor across domains.
Solution architecture
Our solution helps researchers quickly discover relevant medical journal articles across conditions and topics. The dataset includes the HCLS journal articles provided by the PMC Open Access Subset licensed with CC BY and CC0 licenses, journal metadata provided by the National Center for Biotechnology Information (NCBI) via the Bio.Entrez package, Disease Ontology hierarchies, and ICD10 codes that have been extracted using the ICD-10-CM linking API within Amazon Comprehend Medical. Although the final dataset is provided to you, the following architecture depicts the flow used to create the dataset.
The following diagram illustrates the loading of the data to Amazon Neptune Analytics using services like Amazon Bedrock and Amazon Comprehend to extract data from medical journals.

The following image represents the final graph, which contains these node types:
- disease: Represents a disease within the Disease Ontology. The Disease Ontology provides a mapping to help us understand which diseases are subclasses of other diseases.
- author: Represents an author of a particular journal.
- journal: Represents a journal.
- journalChunk: Represents a chunk of a given journal. Chunks were determined using the default chunking strategy provided through Amazon Bedrock Knowledge Bases.
- icd10: Represents an ICD-10 code, which is a standardized classification of medical issues. Edges between icd10 nodes and journal and journalChunk nodes were created using the Amazon Comprehend Medical ICD-10-CM linking.

Because we’re using our own graph data model, we use the BYOKG-RAG toolkit to implement natural language querying over the graph. The following diagram illustrates the components of BYOKG.

Prerequisites
Before getting started, make sure you have the following prerequisites:
- AWS Command Line Interface (AWS CLI) version 2.11.0 or later installed and configured (installation guide)
- Access to the following AWS services:
Amazon Neptune Analytics
- Amazon Bedrock (Claude 4.5 Sonnet model)
- Amazon SageMaker
- Amazon Simple Storage Service (Amazon S3)
- Amazon Comprehend Medical
- IAM role with the following permissions:
NeptuneAnalyticsFullAccess
- AWSServiceRoleForAmazonNeptuneAnalytics
- AmazonS3ReadOnlyAccess
- AmazonBedrockFullAccess
- ComprehendMedicalFullAccess
- Python 3.9 or later
- graphrag_toolkit version 1.0.0 or later
- Jupyter Notebook environment
Solution cost overview
Cost approximation (per hour) for running this demo:
- Neptune Analytics graph, 16 mNCU, no standby, public connectivity – $0.48/hour.
- SageMaker Jupyter notebook, t3.medium with 5 GB of EBS volume – $0.05/hour for compute plus $0.70/hour for storage.
- S3 storage, standard, 161 MB – 0.161 GB × $0.023 = $0.0037 per month.
- Amazon Bedrock – The cost for Amazon Bedrock depends on model usage and token consumption. For the most up-to-date information, see the pricing page.
Setting up Neptune Analytics
Let’s begin implementing your GraphRAG solution by setting up Neptune Analytics. The following steps will guide you through data import, graph creation, and notebook configuration to build your knowledge graph foundation:
- Create an S3 bucket: aws s3 mb s3://amzn-s3-bucket-name.
- Copy the dataset into your own buckets using the AWS CLI:
aws s3 sync s3://aws-neptune-customer-samples-us-east-1/sample-notebooks/vector-graph-hybrid-search/graph-data/ s3://amzn-s3-bucket-name/- Create a Neptune Analytics graph using the CreateGraphUsingImportTask API to import from the Amazon S3 location you copied to in the first step. For details on how to do this, see the Neptune Analytics User Guide. Set the minimum and maximum provisioned memory to 16.
- While the graph is creating, create a Neptune Notebook associated with the graph. The notebook makes it straightforward to query and interact with the graph, as well as set up and run the GraphRAG Toolkit. For details on how to create a Neptune Notebook, see the Neptune Analytics User Guide.
- Download the sample notebook, and upload it to your Jupyter environment.

Implementation steps: Building a modular GraphRAG system with the GraphRAG Toolkit and Amazon Bedrock
In this notebook, we demonstrate a modular approach to building a Retrieval Augmented Generation (RAG) system over a healthcare knowledge graph, using the graphrag-toolkit Python package and the Amazon Bedrock Anthropic Claude 4.5 Sonnet model. This solution supports natural language querying and entity linking within a knowledge graph, combining advanced language model generation with structured graph data retrieval.
Key components
- Language model initialization We begin by initializing the Amazon Bedrock-based language model generator that powers our natural language responses.
from graphrag_toolkit.byokg_rag.llm import BedrockGenerator
def init_llm_generator(model_name='us.anthropic.claude-3-5-sonnet-20240620-v1:0', region_name='us-west-2'):
return BedrockGenerator(
model_name=model_name,
region_name=region_name
)
llm_generator = init_llm_generator()- Knowledge graph linker setupThe KGLinker is initialized by passing the graph store and the language model generator. It acts as the core interface to query the graph and generate answers.
from graphrag_toolkit.byokg_rag.graph_connectors import KGLinker
def init_kg_linker(graph_store, llm_generator):
return KGLinker(graph_store=graph_store, llm_generator=llm_generator)
kg_linker = init_kg_linker(graph_store, llm_generator)- Generating responses from queries With the kg_linker, we can pose natural language questions and obtain generated responses augmented by the knowledge graph context.
def generate_kg_response(kg_linker, question, schema, graph_context="Not provided. Use the above schema to understand the graph."):
return kg_linker.generate_response(
question=question,
schema=schema,
graph_context=graph_context
)
# Example usage
response = generate_kg_response(kg_linker, question, schema)
print(response)- Entity linking for enhanced retrieval To improve information extraction and link natural language text to graph entities, we use a fuzzy string index combined with the EntityLinker.
from graphrag_toolkit.byokg_rag.indexing import FuzzyStringIndex
from graphrag_toolkit.byokg_rag.graph_retrievers import EntityLinker
def init_and_link_entities(graph_store, artifacts):
string_index = FuzzyStringIndex()
string_index.add(graph_store.nodes())
retriever = string_index.as_entity_matcher()
entity_linker = EntityLinker(retriever=retriever)
linked_entities = entity_linker.link(artifacts["entity-extraction"], return_dict=False)
linked_answers = entity_linker.link(artifacts["draft-answer-generation"], return_dict=False)
return entity_linker, linked_entities, linked_answers
entity_linker, linked_entities, linked_answers = init_and_link_entities(graph_store, artifacts)Summary
This modular structure cleanly separates the following components:
- Large language model (LLM) initialization (using Amazon Bedrock).
- Knowledge graph interfacing (KGLinker).
- NLP (natural language querying).
- Entity linking on graph nodes.
The modular structure allows flexible experimentation and straightforward extension for different domains or datasets.
The integration of a fuzzy string matcher facilitates robust entity recognition, which is important in noisy or complex healthcare data contexts.
By combining the Amazon Bedrock advanced language models with structured graph querying and linking, this solution forms a powerful foundation for context-aware question answering and information retrieval over knowledge graphs.
Solution benefits and performance metrics
The following key performance indicators from our implementation of the solution demonstrate how this GraphRAG solution can create measurable value and competitive advantage for pharmaceutical research organizations:
- Research timeline acceleration – GraphRAG reduces research cycles from six months to three weeks, delivering an 87 percent efficiency boost. This supports rapid hypothesis testing and faster scientific breakthroughs.
- Success rate optimization – GraphRAG reduced research cycles in our implementation from six months to three weeks. The solution is powered by advanced graph algorithms. Cross-domain analysis facilitates more effective research directions and optimal resource deployment.
- Workflow efficiency gains – Key metrics show measurable improvements in our tests: 70 percent reduction in review time, 85 percent faster data access, and 90 percent enhanced knowledge use. Teams can focus on strategic research priorities.
- Data-driven validation – Advanced tracking and visualization facilitate full research transparency. Clear data pathways strengthen regulatory compliance and improve scientific communication.
- Intelligent knowledge integration – The system efficiently scales and integrates new data sources with minimal resource impact. Enhanced collaboration preserves vital institutional knowledge.
Industry leadership enable
関連記事
今日のまとめ
AI日報で今日の重要ニュースをまとめ読み