Skip to content

Knowledge-graph tools

alphafold_sovereign.tools.knowledge_graph_tools

MCP tools for querying the local AlphaFold Sovereign Knowledge Graph.

These tools expose the accumulated research intelligence stored in the local relational database — turning every past query into a reusable asset.

This is one of the most powerful aspects of AlphaFold Sovereign: the platform LEARNS from usage. Every variant triage, druggability assessment, and protein dossier enriches the local graph, enabling:

  • Instant recall of previously analysed entities (no API call required)
  • Cross-session pattern discovery ("which HIGH-tier variants share a WARM target?")
  • Batch analytics export to pandas for downstream ML
  • Audit-complete provenance for regulatory submissions
Tool inventory
  1. query_variant_database — search accumulated variant triage results
  2. query_protein_database — search accumulated protein assessments
  3. get_knowledge_graph_stats — database health and coverage summary
  4. export_research_dataset — export to JSON for pandas/ML pipelines
  5. find_drug_gene_network — traverse the accumulated drug-gene-disease graph

query_variant_database async

query_variant_database(params: VariantQueryInput) -> dict[str, Any]

Search the local knowledge graph for previously analysed variants.

Returns variants matching the filter criteria from your accumulated research sessions. No API calls are made — all data is served from the local SQLite knowledge graph.

This is how AlphaFold Sovereign enables longitudinal research: every variant triaged by generate_variant_clinical_report is automatically stored and becomes instantly searchable here.

Parameters:

Name Type Description Default
params.gene

Gene symbol filter.

required
params.tier

Clinical tier (HIGH/MEDIUM/LOW/UNKNOWN).

required
params.clinvar_class

ClinVar classification string.

required
params.min_am_score

Minimum AlphaMissense score.

required
params.max_gnomad_af

Maximum gnomAD allele frequency.

required
params.limit

Maximum results.

required

query_protein_database async

query_protein_database(params: ProteinQueryInput) -> dict[str, Any]

Search the local knowledge graph for previously assessed proteins.

Returns proteins matching the filter criteria from accumulated research. Serves from local SQLite — no API calls.

Parameters:

Name Type Description Default
params.druggability_tier

HOT/WARM/COLD/NOT_DRUGGABLE filter.

required
params.min_plddt

Minimum AF2 confidence score.

required
params.limit

Maximum results.

required

get_knowledge_graph_stats async

get_knowledge_graph_stats() -> dict[str, Any]

Return statistics about the local knowledge graph.

Shows entity counts, database size, and last activity — useful for understanding the breadth of your accumulated research.

export_research_dataset async

export_research_dataset(params: ExportInput) -> dict[str, Any]

Export accumulated research data for downstream analysis.

Returns all stored entities as JSON-serialisable dicts, suitable for: - Loading into pandas DataFrames for ML feature engineering - Importing into R or Julia for statistical analysis - Feeding into downstream bioinformatics pipelines

Example (Python)::

import pandas as pd
result = await export_research_dataset(ExportInput(tables=["variants"]))
df = pd.DataFrame(result["data"]["variants"])
high_tier = df[df["clinical_tier"] == "HIGH"]

Parameters:

Name Type Description Default
params.tables

Tables to export (empty = all entity tables).

required
params.limit_per_table

Maximum rows per table.

required

find_drug_gene_network async

find_drug_gene_network(params: DrugNetworkInput) -> dict[str, Any]

Traverse the local knowledge graph from a seed entity.

Given any seed (UniProt ID, gene symbol, or MONDO disease ID), expands up to max_hops through the drug-gene-disease graph stored in the local knowledge graph.

This reveals hidden connections between entities accumulated across multiple research sessions — a form of network medicine powered by your own research history.

Parameters:

Name Type Description Default
params.seed

Starting entity identifier.

required
params.max_hops

Graph traversal depth (1–3).

required