In the beginning there was keyword search.
Eventually word embeddings came along and we got Vector Databases and Retrieval Augmented Generation (RAG). They were good for writing blog posts about topics that sounded smart, but didn’t actually work well in the real world. Fast forward a few years and some VC hungry individuals bolted Graph Databases onto the Vector Databsaes and Graph RAG was born.
It’s still great for blog posts. Still doesn’t work well in the real world.
Enter SemDB.ai.
SemDB is an abbreviation for Semantic Database. It’s a database of “semantics” – a database of meaning. SemDB strives to go beyond mathematical tricks and triples. It stores “meaning”. It allows us to index, retrieve, and act upon data by its meaning – not just its cosine similarity.
Behind the scenes, SemDB uses Ontology-Guided Augmented Retrieval (OGAR); a leap forward, enabling faster, more cost-effective, and scalable solutions for real-world applications.
In this post we will focus on a few shortcomings of the Graph RAG approach and how SemDB solves them. Take a look at this article Graph RAG Has Awesome Potential, But Currently Has Serious Flaws | by Troyusrex | Generative AI for an overview of both Graph RAG and some of its problems.
Advantages of Graph RAG
Graph RAG is a huge advance over traditional Vector search.
- Enhanced Contextual Understanding: By leveraging graph structures, Graph RAG can capture complex relationships between entities, leading to more accurate and context-aware information retrieval. This is particularly useful for tasks requiring deep understanding and reasoning.
- Improved Retrieval Precision: Graph RAG can improve retrieval precision by using graph-based indexing and retrieval methods. This ensures that the most relevant information is retrieved, even if it is buried within a large dataset.
- Mitigation of Hallucination: Traditional language models sometimes generate "hallucinated" information, which is not accurate or relevant. Graph RAG helps mitigate this issue by referencing structured knowledge bases, ensuring the generated content is grounded in factual data.
- Domain-Specific Knowledge: Graph RAG can be tailored to specific domains by incorporating domain-specific knowledge graphs, making it highly effective for specialized applications such as legal research, medical diagnostics, and technical documentation.
Problems with Graph RAG
But, real world Graph RAG applications have a couple significant problems:
- Speed: Graph RAG is horrendously slow for real world applications, often taking minutes to respond.
- Cost: Data preparation can cost many thousands of dollars for moderately sized datasets.
- Scalability: The reliance on clustered communities makes scaling challenging.
- Accuracy: Testing has shown little increase in search accuracy compared to traditional RAG.
SemDB to the Rescue
If the progression has been
Keyword Search → Vector Search (RAG) → Graph Search (Graph RAG)
Then let’s skip ahead a few progressions and get the end:
Keyword Search → Vector Search (RAG) → Graph Search (Graph RAG) → ??? →OGAR - Ontology Guided Augmented Retrieval
You gotta admit, it’s an awesome acronym, right? OGAR…. Grrr.
Vector Search and Graph RAG attempt to allow us to search by meaning. Before the arrival of ChatGPT, scientists used to think about things like “How do we represent meaning? What does it mean “to mean”?” There is a rich history of meaning representation that goes beyond word embeddings (vectors) and triples (graphs). Unfortunately, it’s now easier to outsource every task to a multi-hundred gigabyte neural network, than it is to write code. When all you have is an LLM, everything looks like a prompt engineering task.
In contrast to Graph RAG, Semantic Database (SemDB) is designed to handle complexity effortlessly. Its ontology-driven framework and Local Understanding solve the problems of Graph RAG.
Local Understanding
As I previously mentioned, not everything needs to be outsourced to ChatGPT. SemDB is able to understand somewhere around 80-90% of sentence inputs without the use of an LLM. That means it can do 80-90% of the processing work without paying a per-token fee.
One of the greatest challenges with traditional Graph RAG systems is the prohibitively high cost of entity extraction, driven by heavy reliance on LLMs. Each data chunk and cluster requires multiple LLM calls, quickly adding up to tens of thousands of dollars for large datasets. SemDB, however, does most of this work locally, without involving Big Brother Open AI.
Why is that important?
- Cost: Less LLM calls mean less $$$.
- Accuracy: Local Understanding allows for Organization Specific vocabularies.
- Speed: Local Understanding means local processing… and that’s fast.
- Security: Not every piece of data needs to be sent to our AI overlords, so that they may use it to train their next models
- Note: Open AI and Google both super-duper promise not to ever use your data to train their models. Seriously, they pinky-sweared and everything.
Cost Advantages of Local Understanding
With Local Understanding, SemDB significantly reduces the dependency on costly LLM calls, allowing organizations to process larger datasets at a fraction of the price:
- Reduced External LLM Calls:
- Traditional systems require 1 LLM call per data chunk and 1 per cluster. SemDB’s Local Understanding handles these tasks algorithmically, bypassing the need for external calls entirely.
- This approach slashes costs, making large-scale projects financially viable.
- Scalable Data Extraction:
- Because Local Understanding operates within the organization’s infrastructure, there is no incremental cost for scaling. SemDB can handle datasets with millions of entities without ballooning expenses.
- For example, where traditional methods might cost $60,000 for a million records, SemDB achieves the same results at a fraction of the cost, with no ceiling on dataset size or complexity.
- Optimized Processing for Domain-Specific Graphs:
- By tailoring its Local Understanding capabilities to the specific needs of the organization, SemDB enables the creation of more complex, richly detailed graphs without incurring additional costs.
Beyond Cost Savings: Enabling Richer Graphs
SemDB’s ability to extract more data for less cost doesn’t just save money—it also empowers organizations to build bigger, more detailed, and more accurate graphs:
- Incorporating Nuanced Relationships: Local Understanding allows SemDB to detect subtle, domain-specific relationships that external systems might overlook, enriching the knowledge graph with deeper insights.
- Expanding Data Coverage: By lowering costs, organizations can afford to process larger datasets, capturing more entities and relationships that drive value.
- Iterative Improvement: SemDB’s architecture allows for ongoing refinement of graphs as new data becomes available, further enhancing accuracy and depth.
- Organization Specific Vocabularies: Every company has their own lingo, vocabulary, and internal speak that the LLMs don’t fully understand. SemDB is able to capture that meaning, store it, and operate upon it like any other semantic nugget.
Organizations form their own vocabularies
Conclusion
At Intelligence Factory we use SemDB as the backbone of our applications. It allows us to build complex graphs for various domains. Honestly, our customers don’t care one bit about the advantages of Ontologies over Graphs. Some projects we’ve built on SemDB:
- HIPAA Compliant Chat Bots: That don’t hallucinate give dieting advice to anorexics.
- Iterative Improvement: SemDB’s architecture allows for ongoing refinement of graphs as new data becomes available, further enhancing accuracy and depth.
- Sales Tools: To discover mine thousands of conversations for missed opportunities
What’s most important, however, is that you can take advantage of these technologies with our consumer focused products:
FeedingFrenzy.ai and
SemDB.ai. Both are built on this infrastructure and offer features that make running your business easier. For the more technical side of things, feel free to check out
Buffa.ly.