GRAG vs. RAG Demonstration

Bojan Ciric
The Future of Data
Published in
5 min readAug 21, 2024

This short article showcases the effectiveness of GRAG compared to RAG in extracting factual information from unstructured data and providing responses within a relevant context.

The example below uses the book “A Christmas Carol” by Charles Dickens.

Prompt: Who is Scrooge, and what are his main relationships?

GRAG Response (Microsoft GraphRAG)

Ebenezer Scrooge is a central character in Charles Dickens’ novella “A Christmas Carol,” known for his miserly, cold-hearted nature, and his initial disdain for Christmas and festive generosity. He is depicted as a squeezing, wrenching, grasping, scraping, clutching, covetous old sinner, hard and sharp as flint, with a cold demeanor that profoundly affects his physical appearance, social interactions, and his preference for solitude over family and festivity. Scrooge is solitary, unapproachable, and widely disliked by the community, showing no warmth or generosity towards others, even during Christmas, and expressing a lack of compassion for the poor, preferring to support established institutions like prisons and workhouses over direct charity [Data: Entities (31)].

# Main Relationships of Scrooge

## Bob Cratchit
Bob Cratchit is Scrooge’s underpaid and overworked clerk, who suffers from Scrooge’s miserly behavior but remains a kind and gentle soul despite his harsh working conditions. The relationship between Scrooge and Cratchit undergoes a significant transformation by the end of the story, with Scrooge becoming a benefactor to Cratchit and his family, symbolized by the generous gift of a turkey and the promise of a raise in salary [Data: Relationships (62); Entities (29)].

## Jacob Marley
Jacob Marley, Scrooge’s deceased business partner, plays a pivotal role in the story as the first ghost to visit Scrooge. Marley’s visitation serves as a warning to Scrooge about the consequences of his greed and lack of compassion, setting the stage for the visitations of the other spirits. This relationship underscores the theme of redemption and the impact of one’s actions on others [Data: Relationships (91); Entities (52, 32)].

## Fred
Fred is Scrooge’s cheerful and optimistic nephew, who embodies the spirit of Christmas. Despite Scrooge’s initial rejection and coldness, Fred consistently invites Scrooge to join his Christmas celebrations, showing patience and kindness towards his uncle. Their relationship highlights the contrast between Scrooge’s miserliness and Fred’s generosity, and it ultimately improves as Scrooge’s transformation allows him to accept Fred’s invitation to Christmas dinner [Data: Relationships (17); Entities (34, 12)].

## The Spirits
The spirits of Christmas Past, Present, and Yet to Come play crucial roles in Scrooge’s transformation. Each spirit shows Scrooge scenes from his life and the lives of those around him, prompting him to reflect on his actions and their consequences. These supernatural interventions are pivotal in confronting Scrooge with the reality of his isolation and leading him towards redemption [Data: Relationships (23, 25, 30); Entities (53, 111)].

## Tiny Tim
Tiny Tim is the young son of Bob Cratchit, whose frail health and optimistic outlook on life deeply affect Scrooge. Although Scrooge and Tiny Tim do not interact directly for much of the story, Scrooge’s concern for Tiny Tim’s well-being becomes a significant factor in his transformation. Scrooge’s change of heart leads him to become a benefactor to the Cratchit family, indirectly improving Tiny Tim’s prospects for the future [Data: Relationships (108); Entities (29)].

In summary, Scrooge’s relationships with these characters are central to his journey from a miser to a man who embodies the spirit of Christmas. Through his interactions with Bob Cratchit, Jacob Marley, Fred, the spirits, and Tiny Tim, Scrooge experiences a profound transformation that highlights themes of redemption, compassion, and the importance of generosity and community spirit.

RAG response (ChromaDB)

In the context provided, Scrooge is portrayed as a central character who has a strained relationship with his family and others around him, principally due to his miserly, sour, and secluded disposition. From the snippets of the story, it becomes clear that Scrooge:

1. **Was personally known by many people during their lives:** This hints at Scrooge’s long-standing presence and possibly longstanding negative or at least significant impact on the lives of those around him. It suggests a history of interactions that were likely unfavorable, based on the overall tone regarding him.

2. **Is described metaphorically as the “Ogre of the family”:** This description conveys that within family dynamics, Scrooge is seen as a dreadful, almost monstrous figure, perhaps due to his unpleasant demeanor, lack of warmth, and unwillingness to engage in joyful family occasions.

3. **Has a nephew who, despite Scrooge’s unpleasantry, attempts to include him in family merriment:** His nephew’s efforts to engage him, alongside the mention that Scrooge doesn’t finish his sentences and is considered “a ridiculous fellow,” paint a picture of a man who is both ridiculed and pitied by his family. Despite Scrooge’s demeanor, his nephew still advocates for his inclusion, emphasizing that Scrooge is missing out on pleasant experiences and companionship, which could be beneficial to him.

4. **Had a business partner:** The mention of Scrooge having a partner for many years suggests a professional relationship, though not much detail is provided about the nature of this partnership within the provided context. However, given the overall portrayal of Scrooge, it might be inferred that this partnership was likely more functional than warm or friendly.

In essence, Scrooge is depicted as a complex character who is largely isolated due to his own actions and attitude. His main relationships include familial ties, particularly with his nephew who seems to show him some compassion, and a business partnership that is mentioned in passing without much emotional depth. This aligns with the character of Ebenezer Scrooge from Charles Dickens’ “A Christmas Carol,” who is known for his miserly ways, estrangement from family, and eventual redemption which rekindles his relationships and transforms his life perspective.

GRAG response (FAISS DB)

Scrooge is depicted as a squeezing, wrenching, grasping, scraping, clutching, covetous old sinner, hard and sharp as flint, and solitary as an oyster. His main relationships, as described in the context, include his clerk, whom he treats with miserliness by keeping the coal-box in his own room and ensuring the clerk’s fire is very small; his nephew, who greets him with a cheerful “Merry Christmas, uncle!” only to be met with Scrooge’s cynical “Bah! Humbug!”; and his deceased business partner, Marley, who is mentioned when portly gentlemen visit Scrooge to collect donations for the poor, indicating that Marley and Scrooge were kindred spirits in their approach to business and possibly to life. Scrooge’s interactions with these characters highlight his isolation, lack of empathy, and focus on money over relationships.

Conclusion

Graph RAG provides significant advantages over traditional RAG by leveraging graph-based data structures. These structures enable a more accurate understanding of entities and their relationships, enhancing the context and factual accuracy of generated responses. By representing knowledge as a graph, Graph RAG can better capture complex interconnections between entities, offering more precise and contextually relevant answers. This method excels in extracting and organizing information from unstructured data, making it particularly effective for scenarios requiring deep contextual understanding and relationship mapping, resulting in more reliable and insightful outputs.

What are your thoughts? Comments are welcome and appreciated.

Disclaimer: The views and opinions expressed in this article are those of the author and do not necessarily reflect the views or positions of any entities author represents.

--

--

Bojan Ciric
The Future of Data

Technology Fellow at Deloitte | Data Thinker | Generative AI Hands-on | Converts data into actionable insignts