RAG & Retrieval

How does an Entity Extractor work ? Indexing Graph RAG

How the extractor turns text into a knowledge graph, and choosing between public and private LLMs.

Key takeaways

  • This is the third post in the Graph RAG series; it focuses on the Extractor, a key component of the indexing pipeline that retrieves graph information to augment a user query before generating an LLM response.
  • The Extractor builds a knowledge graph by extracting nodes (entities) and edges (relationships) from a chunk of text, using a custom-tailored prompt that can work from a schema or extract all relevant entities and relationships.
  • The Extractor can be powered by a public LLM (e.g., GPT models via API, accessible and affordable per-use but potentially costly at high volume) or a private LLM (trained on proprietary data, higher upfront cost but potential long-term savings and greater control).
  • Choosing between public and private LLMs depends on customization needs, data privacy and security, scalability/performance, cost profile, regulatory compliance, integration/support, and long-term strategy — with regulated industries (healthcare, finance, legal, aerospace) facing stricter data privacy and security requirements.
On this pagesections

    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:

    1. Indexing
    2. 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.

     

    Frequently asked questions

    What is the Extractor in Graph RAG?

    It is a key component of the indexing pipeline that builds a knowledge graph by extracting nodes (entities) and edges (relationships) from a given chunk of text, using a custom-tailored prompt that can extract based on a schema or pull all relevant entities and relationships.

    What is the difference between public and private LLMs for extraction?

    Public LLMs (such as GPT models from providers like OpenAI, Google, and Microsoft) are available via APIs with pay-per-use pricing and strong provider support, but can be costly at high volume. Private LLMs are customized models trained on proprietary data, offering more control over data privacy, customization, and deployment, with higher upfront cost but potential long-term savings for consistent workloads.

    How do I choose between a public and private LLM for the Extractor?

    The post outlines trade-offs across customization and flexibility, data privacy and security, scalability and performance, cost, regulatory compliance, integration and support, and long-term strategy. Organizations in highly regulated industries such as healthcare, finance, legal, and aerospace must weigh stringent data privacy and security requirements.

    See what your engineers can ship in production

    Dataworkz is the agentic AI platform enterprises trust to put AI agents into production. Teams build production-ready agents in days, every decision stays traceable, and every agent has ROI attached.

    Explore the platform