A Beginner’s Guide to Retrieval-Augmented Generation with Graphs – The Extractor
In this blog, we dive deeper into the inner workings of the extractor, and the factors that decide the efficacy of an Entity Extractor. This is the third blog in the Graph RAG series, if you have missed the previous blogs, please find them below.
Blog 1 – A Gentle Introduction to Graph RAG
Blog 2 – Unpacking the Indexing Pipeline
With that out of the way, let’s quickly summarise the Indexing pipeline, before going onto the details on the Entity Extractor.
Graph RAG is a Retrieval Augmented Generation (RAG) technique that retrieves information related to user query from a Graph DB and appends it to user query, before fetching a LLM response. We understand that, Graph RAG has 2 components:
- Indexing
- Retrieval
In the previous blog we dove deep into the inner workings of the Indexing pipeline of a graph rag. Let’s understand the Extractor in detail, it’s a very key component of the Indexing Pipeline.
The Extractor is a key piece in building a KG, as it extracts the nodes and edges from a given chunk of text. It achieves this by a custom tailored prompt, designed to extract either based on a schema, or all relevant nodes (entities) and edges (relationships). The Extractor as discussed in the previous blog, could either be Private or Public LLMs.
Public LLMs, such as GPT (Generative Pre-trained Transformer) models, are developed and maintained by organizations like OpenAI, Google, and Microsoft. These models are available to the general public via APIs or pre-trained models, allowing users to leverage their capabilities for various tasks like text summarisation, text generation, etc.
Private LLMs, on the other hand, are customized models developed for specific organizations or individuals. These models are trained on proprietary data and tailored to meet the unique requirements and objectives of the entity utilizing them. Private LLMs offer greater flexibility and control over data privacy, model customization, deployment needs, and fine-tuning compared to their public counterparts.
We should note that, while Public LLMs offer accessibility and affordability through pay-per-use pricing models, the long term costs associated with using these models can be significant, especially for organizations with a higher volume of text transactions. Private LLMs, on the other hand, are known to have a higher upfront cost for model development and infrastructure setup but can offer cost savings in the long run, particularly for organizations with consistent and predictable workloads.
Another key factor in deciding which type of LLM might be apt for your company’s needs is understanding the regulatory compliances. Organizations operating in a highly regulated industry, like healthcare, finance, legal and Aerospace, must comply with stringent regulatory requirements pertaining to data privacy and security regulations.
| Aspect | Public | Private |
| Customization and Flexibility | Limited customization due to predefined architectures and parameters. | High flexibility to tailor models with domain-specific knowledge and fine-tuning capabilities. |
| Data Privacy and Security | May involve sharing data with third-party providers, raising privacy and security concerns. | Ensures full control over data, infrastructure, and compliance with regulatory requirements. |
| Scalability and Performance | Can face scalability challenges and latency during peak usage periods. | Optimized for dedicated infrastructure, ensuring better scalability and performance. |
| Cost Considerations | Pay-per-use pricing model; can be costly for high-volume usage over time. | High upfront costs, but potential long-term savings for consistent workloads. |
| Regulatory Compliance | Data sharing requirements may complicate compliance with industry regulations. | Easier to meet regulatory standards due to greater control over data and processes. |
| Integration and Support | Robust support from providers, including documentation and community forums. | Requires more resources for integration and maintenance but allows customized support processes. |
| Long-term Strategy | Provides immediate access to state-of-the-art AI but may not align with evolving needs. | Adaptable to changing requirements, scalable for growth, and aligns with long-term innovation. |