Bio x AI Hackathon
  • Welcome to the Bio x AI Hackathon
  • Getting Started
    • Quickstart
    • Important Links
  • Developers
    • BioAgents
    • CoreAgents
    • Eliza Agent Framework
    • Knowledge Graphs
    • .cursorrules
    • Starter-repos
    • Plugin Guide
  • Vision and Mission
    • Bio x AI Hackathon
    • The Problems in Science
    • TechBio
    • Guidance from the Judges
      • Important Datasets and Code Repositories
      • Reading List
      • Common Mistakes for Developers new to Academia
    • Hackathon Ideas
      • Full Projects
        • The Complexity Slider - Finding Hypotheses at the Limits of Human Knowledge
        • [Hard Mode] Metadata Generation on datasets with No Manuscript or Code Associated
        • Inverse Reproducibility - Given Manuscript and Data, Make the Code
        • Atlas of Research Methods Formatted for Agentic Reuse
        • Utilizing Knowledge Graphs for the Detection of Potential Null Results
        • Creating an Iterative Publication Stack by Linking Together Existing Tooling
        • Longevity Atlas: Building a Decentralized Knowledge Network with Agentic Research Hypothesis Engine
        • CoreAgent Track - Opportunities to work with BioDAOs
        • SpineDAO Chronos Project Spec
      • Individual Plugins
        • Plug-ins for every piece of research tooling known to humankind
        • Reproducibility Assistant - Code Cleaning, Dockerization, etc
        • Finding and Differentiating Cardinal vs Supporting Assertions
        • [Easier Mode] Metadata Generation on Datasets Given the Manuscript and Code Repository
        • Sentiment Analysis on Existing Citations, Dissenting vs Confirming
        • Agentic Metadata Template Creation for Standard Lab Equipment
  • Ops
    • Calendar
      • Key Dates
      • Office Hours
    • Judges and Mentors
      • Communicating to Judges and Mentors
      • BioAgent Judging Panel
      • CoreAgent Judging Panel
      • Mentors
    • Prize Tracks
    • Hackathon Rules
    • Kickoff Speakers
    • FAQ
Powered by GitBook
On this page
  • Knowledge Graphs
  • What is a Knowledge Graph?
  • Pre-Built Graphs
  • Make Your Own Graph
  • Other Important Links
  • <<<<<<< HEAD
  1. Developers

Knowledge Graphs

OriginTrail, OxiGraph, Neo4j

PreviousEliza Agent FrameworkNext.cursorrules

Last updated 1 month ago

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

  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 .

  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

Step-by-step

1. Clone the Elizagraph repository

Copy

git clone https://github.com/OriginTrail/elizagraph.git
cd elizagraph

2. Install dependencies and build the project

Copy

pnpm install
pnpm run build

3. Set up environment variables

Copy the .env.example file (from the Elizagraph folder in cloned repository) and rename it to .env and fill in the necessary details. The following instructions will help you populate the .env file.

  1. Node information

If you do not already have a DKG node set up, you can use a public node that the OriginTrail team set up so that everyone has an easy way to interact with the DKG.

Mainnet is the live blockchain for real transactions, while testnet is a risk-free testing environment.

  • ENVIRONMENT: Define your environment. For example, use development if you're running a local setup, testnetfor a testnet setup, or mainneta mainnet setup.

  • OT_NODE_HOSTNAME: Enter the hostname or IP address of your OriginTrail DKG node. This will be the URL of the node you set up or http://localhost if you're running it locally.

  • OT_NODE_PORT: The port used by the DKG node, typically 8900.

  • PUBLIC_KEY: The public key of the wallet you will use to publish Knowledge Assets.

  • PRIVATE_KEY: The private key corresponding to the above wallet. Ensure you keep this secure and never share it outside of the .env file.

  • BLOCKCHAIN_NAME: Specify the blockchain network you’re using. otp:2043 (NeuroWeb mainnet), base:8453 (Base mainnet), gnosis:100 (Gnosis mainnet), otp:20430 (NeuroWeb testnet), base:84532 (Base testnet), gnosis:10200 (Gnosis testnet)

If you are building your agent on the NeuroWeb, you need to get NEURO first and then TRAC.

  1. LLM key

Eliza supports a wide range of LLM providers. To use one of them, create an API key and paste it into the environment file.

For example, if you want to use an Open AI LLM, populate the OPENAI_API_KEY variable in the .env.

Copy

OPENAI_API_KEY= # obtain the key on https://platform.openai.com/
  1. X credentials (in case you want to use X)

Eliza uses a basic X authentication setup. Use your username, password, and email so that the application can post on the platform. If you encounter issues, we recommend you to use the TWITTER_COOKIES variable and copy the cookies from the browser.

4. Customize DKG Knowledge Asset & query templates

If you wish to do so, modify the templates in plugin-dkg/constants.ts to change the format in which your data is stored or queried.

5. Run the character

Firstly, create a character in the characters folder, for example chatdkg.character.json.

You can look at existing examples in the characters folder for inspiration.

Copy

pnpm start --characters="characters/chatdkg.character.json"

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.

Other Important Links

<<<<<<< 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

There's one public node available for mainnet () and one for testnet (). All blockchains are supported on each of the nodes.

Here's an example of how to set up a MetaMask wallet:

In order to fund your wallet on testnet, feel free to use the in the . There's a message pinned in the #faucet-bot channel in case some of the faucets are down. In that case, feel free to ping the core team to send you some testnet funds manually.

Here’s how to get an .

SETUP.md
here
index.ts
https://positron.origin-trail.network
https://v6-pegasus-node-02.origin-trail.network
here
Faucet
OriginTrail Discord
API key from ChatGPT