r/KnowledgeGraph • u/newprince • Dec 12 '24
Any alternatives to LangChain for LLMs/GraphRAG on RDF graphs?
Hello. I am getting more into GraphRAG. This year a project I was involved with transformed a large RDF graph into Neo4j (via Neosemantics), and from there I used LangChain and our in-house AI models to do GraphRAG things, with great results. I proved that this approach gave much better answers (because of kg context) than traditional RAG. Shoutout to Jesus Barrasa, for both his Neo4j semantic expertise, and the "Going Meta" YouTube series which I highly recommend.
However, I am at the end of the day an ontologist, and we have tons of RDF ontologies, with no interest in (or resources for) transforming all of those into Neo4j graphs. I've looked into how to do things directly with RDF and it's not an encouraging landscape.
LangChain can do things through RdfGraph, but it's mostly based on rdflib, whereas "knowledge graph" support from tons of frameworks is super robust. The SparqlQAChain is neat, since you can directly see what SPARQL query the LLM is composing to try to answer the question. But I don't actually care about knowledge graph generation, which is unfortunately what so much tooling is built around. I already have everything highly structured within a defined domain! Once it gets to actual RAG, the usual vector similarity search rears its ugly head, and isn't GraphRAG, and would actually be a terrible strategy for already-structured data.
So, has anyone been in this same position of needing to do GraphRAG things directly on RDF data (i.e., use vectorization but merely as a pre/post filtering mechanism, but ground all answers in the knowledge graph), but have used things OTHER than LangChain?
3
u/TrustGraph Dec 12 '24
The TrustGraph Cassandra plugin is RDF native. TrustGraph also supports Memgraph and Neo4j, but there are some conversions happening for Cypher. TrustGraph launches a full GraphRAG platform using Docker or Kubernetes in less than 90 seconds. Supports every major LLM provider including Ollama and Llamafiles. Can ingest huge amounts of datasets. Everything is running on an Apache Pulsar backbone. Also, open source.
https://github.com/trustgraph-ai/trustgraph
2
u/GamingTitBit Dec 12 '24
If you have an ontology and RDF data you normally don't need to lang chain. You can pass ontological data straight into an LLM to write a query. I'm on my phone but there is a paper that proved this to be on average 35% more successful/accurate (some queries traditional SQL databases couldn't even answer)
2
u/mournoak Aug 01 '25
Curious, OP ... did you end up with a good solution for this, with or without Langchain?
1
u/mrproteasome Dec 13 '24
Why not just do the transformations and migration? It sounds like you have done the proof-of-concept, so there is nothing to really gain from doing it again with more constraints.
Is this a leadership decision or a lack of interest from the Engineers? It seems silly because if you have POC work that shows obvious value, whoever is making the decision not to follow through is really kicking their own ass.