getzep / graphiti

Build and query dynamic, temporally-aware Knowledge Graphs
https://help.getzep.com/graphiti
Apache License 2.0
1.42k stars 78 forks source link

Proposal: Maintaining a standard schema to convert text to knowledge graphs #221

Open Anindyadeep opened 5 days ago

Anindyadeep commented 5 days ago

Hi, I am not sure, if this sounds accurate, but just a though I wanted to share and understand the feasibility of it. So currently, the way LLMs are generating nodes / edges for KGs can be either be static or dynamic. For static, it does not have much degree of freedom and for dynamic, it can generate too much nodes (without maintaining a uniformity, does not help during searches).

I then recently bumped into this website called Schema.org which is a public standardization for internet level schema. So how about exploring this and incorporating into the text to knowledge graph pipeline?

Example:

Extract entities and relationships from the following text and represent them using the Schema.org vocabulary in JSON-LD format:

"John Doe, a software engineer at TechCorp, attended the AI conference in San Francisco on September 21, 2023."

Provide the output in JSON-LD.

And getting this as output:

{
  "@context": "https://schema.org",
  "@type": "Person",
  "name": "John Doe",
  "jobTitle": "Software Engineer",
  "worksFor": {
    "@type": "Organization",
    "name": "TechCorp"
  },
  "attendedEvent": {
    "@type": "Event",
    "name": "AI Conference",
    "location": {
      "@type": "Place",
      "name": "San Francisco"
    },
    "startDate": "2023-09-21"
  }
}
prasmussen15 commented 22 hours ago

Hey, thanks for the input!

We definitely want to add the ability to have custom ontologies in Graphiti. We wouldn't want to impose an ontology like schema.org on every user, but our goal is to eventually have the option for users to add their own schemas, likely as a ttl file. That way it allows people to use schema.org, OWL-based ontologies, or other proprietary ontologies as well.

When we work on this feature we will also likely release it in pieces (starting with custom entity types).

Anindyadeep commented 22 hours ago

Hey, thanks for the input!

We definitely want to add the ability to have custom ontologies in Graphiti. We wouldn't want to impose an ontology like schema.org on every user, but our goal is to eventually have the option for users to add their own schemas, likely as a ttl file. That way it allows people to use schema.org, OWL-based ontologies, or other proprietary ontologies as well.

When we work on this feature we will also likely release it in pieces (starting with custom entity types).

Ahh yes that makes much more sense. Thank you for considering and having this in the roadmap.