Skip to main content

Continued…

What Are MCP?

  • MCP(model context protocol) is an api that lets LLM's use applications outside its context.
    • Such as file systems, Jira tickets or Telegram MCP, so next time when you tell it to text to your contacts it knows which tools and how to send the message
  • Introduction - Model Context Protocol
  • MCP vs Agents vs Tools
    • Agents are independent units of execution that use MCP and other tools to plan AI tasks.
    • Agents can plan how to complete a task and may employ tools like code executors or MCP to get the desired outcome.

Graph Based RAG

  • What is GraphRAG?
    • GraphRAG is a structured, hierarchical approach to Retrieval-Augmented Generation (RAG), enhancing traditional RAG by using knowledge graphs instead of plain text snippets for semantic search.
    • Mechanism:
      • Converts text data into a graph structure, with nodes representing entities (e.g., people, places, concepts) and edges capturing relationships between them.
    • Graph Construction:
      • Relies on large language models (LLMs) to extract entities and relationships, which is computationally expensive.
  • Baseline RAG vs. GraphRAG
    • RAG vs. GraphRAG: A Systematic Evaluation and Key Insights
    • Both RAG and GraphRAG provide LLMs with relevant context to improve answer accuracy and reduce hallucination.
    • Baseline RAG:
      • Uses vector similarity search to retrieve relevant text snippets.
    • GraphRAG:
      • Leverages knowledge graphs (nodes and edges) for contextual search and reasoning.
  • Why Use GraphRAG?
    • GraphRAG excels in scenarios where Baseline RAG struggles:
    • Complex Queries:
      • Effective for multi-hop questions requiring synthesis of disparate information through shared attributes.
    • Holistic Understanding:
      • Better at summarizing semantic concepts across large datasets or complex documents.
      • Such as generating answer questions like:
        • "What are the main topics discussed in this document"
  • Challenges of GraphRAG
    • Early Development: Still an evolving field with ongoing research and improvements needed.
    • Cost: Requires multiple LLM calls for graph construction and query answering, increasing computational expense and latency.
    • Reliability: LLMs may not always extract entities and relationships accurately, introducing potential errors.
  • When to Use RAG vs. GraphRAG?
    • Question Answering:
      • RAG: Best for single-hop, fact-based queries (e.g., "When was the UN founded?").
      • GraphRAG: Superior for multi-hop, reasoning-based queries (e.g., "What are the benefits of the UN?" requiring synthesis of multiple facts).
    • Summarization:
      • RAG: Captures fine-grained details.
      • GraphRAG: Produces diverse, multi-faceted summaries by leveraging relationships in the graph.
    • Use Case Guidance:
      • Use RAG for straightforward, fact-retrieval tasks.
      • Use GraphRAG for complex queries involving reasoning or connections across large datasets.
  • Tools related to Graph RAG
    • Neo4j GraphRAG
    • GraphRAG from Microsoft
    • LightRAG and PathRAG
    • LangChain GraphRAG

Useful Agent Tools