Getting the most out of your Knowledge Graph

LLM vs Agent: What’s the Difference?

LLM (Large Language Model): Think of it like a very smart friend who can answer questions based on what they learned in school, but they can’t look things up or take actions.

Agent: Think of it like a smart assistant who can not only answer questions, but also:

  • Look up information in databases
  • Use tools and APIs
  • Remember context from previous conversations
  • Take actions based on what they learn

The Knowledge Problem

Imagine you’re building a customer service agent for a pizza restaurant. You have an Excel sheet with:

  • Menu items and prices
  • Customer preferences
  • Order history
  • Delivery zones

Most beginners think: “I’ll just upload my Excel file and let the agent search through it!”

Problems with this approach:

  • Agent searches for keywords but misses context
  • Can’t understand relationships between data
  • Treats each row as isolated information
  • Poor performance with complex queries

Example: If someone asks “What’s popular in downtown?”, the agent might find the word “downtown” but won’t connect it to popular menu items in that delivery zone.

The Right Way: Knowledge Graph with Context

Instead of dumping raw data, you build a knowledge graph - think of it as a smart web of connected information.

Step 1: Break Down Your Data

Instead of sending one big Excel file, send each piece of information separately with context:

Bad:

Row 1: Margherita, $12, Downtown, 4.5 stars, 150 orders

Good:

MENU ITEM: "Margherita Pizza costs $12. This is a popular item in the Downtown delivery zone with 4.5-star rating and 150 total orders. Customers often order this with garlic bread."
LOCATION DATA: "Downtown delivery zone has high demand for vegetarian options. Margherita and Veggie Supreme are the top sellers here."
CUSTOMER INSIGHT: "Customers who order Margherita pizza have a 70% chance of becoming repeat customers."

Step 2: Add Context for Each Entry

Every piece of knowledge should answer:

  • What is this? (Menu item, customer data, delivery info)
  • Why is it important? (Popular item, frequent complaint, seasonal trend)
  • How should the agent use it? (Recommend to vegetarians, suggest during promotions)

The knowledge graph connects related concepts:

  • “Margherita” connects to “vegetarian options”
  • “Downtown” connects to “delivery zones” and “popular items”
  • “4.5 stars” connects to “customer satisfaction” and “recommended items”

Real Example: Customer Service Agent

Customer asks: “I’m in downtown and want something healthy”

File Search Approach: Searches for “downtown” and “healthy” - might return random rows with those keywords

Knowledge Graph Approach:

  1. Understands “downtown” = delivery zone
  2. Connects “healthy” to vegetarian/low-calorie options
  3. Finds Margherita is popular AND vegetarian in downtown
  4. Suggests: “Based on your location and preferences, I recommend our Margherita Pizza - it’s our most popular vegetarian option in downtown with 4.5 stars!”

Key Principles for Adding Knowledge

  1. One concept per entry - Don’t mix menu items with delivery zones in the same entry
  2. Rich context - Explain what the data means and how to use it
  3. Clear relationships - Show how concepts connect to each other
  4. Action-oriented - Tell the agent what to DO with this knowledge

Quick Checklist

Before adding knowledge to your agent, ask:

  • Is each piece of information self-contained with context?
  • Did I explain what this data means?
  • Did I specify when the agent should use this?
  • Are relationships between concepts clear?
  • Can someone understand this entry without seeing the original file?

Remember

You’re not building a search engine - you’re building a knowledgeable assistant. The difference between success and failure is context, context, context!