Knowledge Graphs

OriginTrail, OxiGraph, Neo4j

Knowledge Graphs

What is a Knowledge Graph?

Knowledge graphs are structured representations of knowledge, consisting of entities (nodes) and their relationships (edges). They provide a powerful framework for organizing and connecting disparate data, making it machine-readable and facilitating sophisticated reasoning. In academic research, especially in fields like biology and medicine, where data is vast and complex, knowledge graphs are becoming increasingly vital for AI applications.

Pre-Built Graphs

You can start by having the Agent interact with a pre-built knowledge graph, either locally with OxiGraph or on Base through OriginTrail

Prerequisites

  • Docker installed

  • pnpm installed

  • Node.js installed

Setup Steps

  1. Follow the setup instructions in SETUP.md

  2. Start the Oxigraph server: (Or use OriginTrail's DKG)

docker run --rm -v $PWD/oxigraph:/data -p 7878:7878 ghcr.io/oxigraph/oxigraph serve --location /data --bind 0.0.0.0:7878

Now your local oxigraph instance is ready to load the processed scientific papers from the sampleJsonLds folder. More info here.

  1. Load JSON-LD data into Oxigraph/OriginTrail's DKG:

pnpm run script scripts/jsonldToTriple.ts

Now your oxigraph has the triples loaded!

  1. (Optional) Start PostgreSQL with vector support:

docker run --name BioAgents-db -e POSTGRES_PASSWORD=123 -p 5432:5432 -d ankane/pgvector

Alternatively, you can use pglite instead of PostgreSQL (Eliza will give you that option when starting for the 1st time)

  1. Start the development server:

pnpm run dev
  1. Enable the hypothesis generation service:

  2. Uncomment line 25 and 27 in index.ts

Make Your Own Graph

The type of knowledge graph, the structure, the algorithm to create the nodes and edges, all factor into how well a BioAgent can traverse the graph to make a hypothesis or reason about a scientific claim.

<<<<<<< HEAD

  • https://docs.origintrail.io/build-with-dkg/dkg-sdk/dkg-v8-js-client

329d4fd (Update knowledge graphs documentation)

  • https://docs.origintrail.io/build-with-dkg/dkg-sdk/dkg-v8-js-client

Last updated