REST APIhttp://localhost:8000
API Reference
Integrate PetriDish's knowledge graph reasoning into your research pipeline. No authentication required during beta.
POST/reasonNatural language → multi-hop graph reasoning → synthesised answer
Request body
{
"question": "What genes does Metformin target and what diseases are they associated with?",
"max_hops": 3,
"india_context": true
}Response
{
"answer": "Metformin targets GPD1, PRKAB1, and ETFDH...",
"paths": [{ "nodes": [...], "edges": [...], "confidence": "HIGH" }],
"cypher_steps": [{ "step": "...", "cypher": "MATCH ..." }]
}POST/cypherExecute a read-only Cypher query directly against the Neo4j graph
Request body
{
"cypher": "MATCH (d:Drug)-[:TARGETS]->(g:Gene)-[:ASSOCIATED_WITH]->(dis:Disease) WHERE toLower(d.name) CONTAINS 'metformin' RETURN d.name, g.name, dis.name LIMIT 10"
}Response
{
"results": [
{ "d.name": "Metformin", "g.name": "GPD1", "dis.name": "hypertriglyceridemia" },
...
]
}GET/healthCheck API health, Neo4j connectivity, and active LLM provider
No body
Response
{
"status": "ok",
"neo4j": "connected",
"node_count": 90408,
"llm_provider": "groq",
"llm_model": "llama-3.3-70b-versatile"
}GET/statsFull graph statistics — node counts by label, edge counts by type
No body
Response
{
"nodes": [{ "label": "Gene", "count": 26973 }, ...],
"edges": [{ "type": "SYNERGISTIC_WITH", "count": 2672628 }, ...]
}Graph Schema
Node labels: Drug — 7,951 nodes (DrugBank) Disease — 11,783 nodes (OMIM, MONDO) Gene — 26,973 nodes (UniProt, NCBI) Pathway — 2,516 nodes (Reactome, KEGG) Phenotype — 6,465 nodes (HPO) Phytochemical — 16 nodes (IMPPAT 2.0) Anatomy — 4,861 nodes (Uberon) BiologicalProcess — 19,755 nodes (GO) Variant — 14 nodes (IndiGen/PharmGKB) Key relationships: Drug -[:TARGETS]-> Gene (16,258 edges) Drug -[:INDICATED_FOR]-> Disease (4,153 edges) Drug -[:CONTRAINDICATED_FOR]-> Disease (12,400 edges) Drug -[:SYNERGISTIC_WITH]-> Drug (2,672,628 edges) Gene -[:ASSOCIATED_WITH]-> Disease (46,205 edges) Gene -[:EXPRESSED_IN]-> Anatomy (223,632 edges) Gene -[:PROTEIN_PROTEIN_INTERACTION]-> Gene (640,708 edges) Phytochemical -[:HAS_TRADITIONAL_USE]-> Disease (39 edges) Variant -[:AFFECTS_RESPONSE]-> Drug (52 edges) All nodes: id (string), name (string), source (string)
Code Examples
import requests
# Drug repurposing query
response = requests.post("http://localhost:8000/reason", json={
"question": "Which drugs could be repurposed for MDR-Tuberculosis?",
"max_hops": 3,
"india_context": True
})
data = response.json()
print(data["answer"])
for path in data["paths"]:
nodes = " → ".join(n["name"] for n in path["nodes"])
print(f"[{path['confidence']}] {nodes}")None (beta)
Auth required
Groq free tier
Rate limit
4.3M edges · 90K nodes
Graph size