Examples
Semantic Memory
Extract and store general knowledge facts that are true regardless of time.
Core Module
Scenario: Identifying Emma's colleagues and family
When to Use
Use semantic memory for facts, concepts, and relationships. Unlike episodic memory (which is about "events"), semantic memory is about "knowledge". Perfect for:
- User profiles (Name, Occupation, Family)
- World knowledge (Product details, Policies)
- Extracted entities and their relationships
Key Operations
add_fact()Insert a single knowledge fact
search()Retrieve facts relevant to a query
Code Example
Here we manually add facts extracted from a conversation. In a real automated agent, these might be extracted by an LLM first.
Key Takeaways
- Semantic memory consolidates information. If you add "Emma is a PM" and later "Emma works as a Product Manager", the system handles the semantic similarity.
- Facts are stored in a Knowledge Graph, allowing for structured retrieval.
- This is the "long-term knowledge base" of your agent.