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
The Wrong Way: File Upload + Search
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:
Good:
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)
Step 3: Connect Related Information
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:
- Understands “downtown” = delivery zone
- Connects “healthy” to vegetarian/low-calorie options
- Finds Margherita is popular AND vegetarian in downtown
- 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
- One concept per entry - Don’t mix menu items with delivery zones in the same entry
- Rich context - Explain what the data means and how to use it
- Clear relationships - Show how concepts connect to each other
- 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!