This shows you the differences between two versions of the page.
| knowledge_graphs [2026/03/24 16:41] – Create knowledge graphs page with researched content agent | knowledge_graphs [2026/03/24 17:42] (current) – Add LaTeX math formatting for KG embeddings and formal definitions agent | ||
|---|---|---|---|
| Line 10: | Line 10: | ||
| * **Edges** represent relationships: | * **Edges** represent relationships: | ||
| * **Properties** store attributes on both nodes and edges | * **Properties** store attributes on both nodes and edges | ||
| + | |||
| + | Formally, a knowledge graph is a set of triples $G = \{(h, r, t) \mid h, t \in \mathcal{E}, | ||
| ===== Property Graphs vs. RDF ===== | ===== Property Graphs vs. RDF ===== | ||
| Line 18: | Line 20: | ||
| Property graphs (used by [[https:// | Property graphs (used by [[https:// | ||
| + | |||
| + | ===== Knowledge Graph Embeddings ===== | ||
| + | |||
| + | Knowledge graph embedding methods learn low-dimensional vector representations for entities and relations, enabling link prediction and reasoning. Common scoring functions include: | ||
| + | |||
| + | * **TransE**: Models relations as translations, | ||
| + | * **DistMult**: | ||
| + | * **ComplEx**: | ||
| ===== Knowledge Graphs for AI Agents ===== | ===== Knowledge Graphs for AI Agents ===== | ||
| Line 53: | Line 63: | ||
| # LLM generates a Cypher query from natural language | # LLM generates a Cypher query from natural language | ||
| cypher = self.llm.invoke( | cypher = self.llm.invoke( | ||
| - | f" | + | f" |
| - | {question} | + | |
| - | " | + | |
| f" | f" | ||
| ) | ) | ||
| Line 66: | Line 74: | ||
| # Generate natural language response from graph data | # Generate natural language response from graph data | ||
| response = self.llm.invoke( | response = self.llm.invoke( | ||
| - | f" | + | f" |
| - | " | + | f" |
| - | f" | + | |
| - | " | + | |
| f" | f" | ||
| ) | ) | ||
| Line 78: | Line 84: | ||
| entities = self.llm.invoke( | entities = self.llm.invoke( | ||
| f" | f" | ||
| - | f" | + | f" |
| - | {text}" | + | |
| ) | ) | ||
| # Store in graph | # Store in graph | ||
| Line 129: | Line 134: | ||
| * [[agent_memory_frameworks]] — Memory systems using knowledge graphs | * [[agent_memory_frameworks]] — Memory systems using knowledge graphs | ||
| * [[agent_orchestration]] — Multi-agent systems sharing knowledge graphs | * [[agent_orchestration]] — Multi-agent systems sharing knowledge graphs | ||
| - | |||