Work with memory
Meko's memory system gives agents persistent recall across sessions. Memories flow through a three-stage pipeline before contributing to an agent's knowledge base.
Overview
A pipeline of activities occur to create Collective Memory and Shared Knowledge from conversations.
1. Extraction Memories are automatically extracted from agent conversations as they occur.
2. Learning Identification Extracted memories are evaluated for relevance and importance. Those deemed particularly significant for the agent's tasks are promoted to learnings. This identification is currently a manual process.
3. Promotion to Collective Memory and Shared Knowledge Users review identified learnings and selectively promote them into the Datapack's shared area, comprised of both collective memory and shared knowledge.
Knowledge Base Composition
Memories and learnings are one component of a Datapack's knowledge base. The other major component is source data, which includes:
- Unstructured data — text files, PDFs, and other documents
- Structured data — databases and tabular sources
Underlying Storage: The Semantic Graph
Memories and all their downstream derivatives are stored internally in a semantic graph. This structure supports two complementary retrieval mechanisms:
- Graph edges — capture entity-to-entity relationships (e.g., John likes bananas)
- Document chunks and vectors — enable semantic similarity search against graph entities and relationships
Together, these allow a memory to be retrieved not just by exact match, but by semantic relevance. For example, the memory "John likes bananas" can be surfaced in response to a later query such as "Who likes fruits?"
Add memories
Via MCP (from your coding agent)
The simplest way to add memories is through natural language in your coding agent:
Please remember that I like to take vacations at tropical beach locations, on a budget
Remember this coding preference: I prefer Python type hints and use pytest for testing
The MCP server calls memory_add behind the scenes, which uses an LLM to extract entities and relationships from your text.
Search memories
Via MCP (from your coding agent)
If Meko is properly configured with your AI agent, the agent will automatically access Meko when formulating responses. To retrieve stored information, ask your agent to recall it directly.
Example 1:
What are my vacation preferences?
Example 2:
What coding standards have I set?
The MCP server performs a semantic similarity search across your memories and returns the most relevant results with relevance scores.
How search works
Memory search combines two strategies:
- Vector similarity. Finds memories with semantically similar embeddings.
- Graph traversal. Finds related entities and relationships. For example, searching for "vacation" might also surface memories about "travel budget" through graph connections.
Results from both strategies are combined and ranked, allowing a memory to be retrieved not just by exact match, but by semantic similarity as well. For example, the memory "John likes bananas" can be surfaced in response to not only the query "who likes banana?" but also a semantic query like "Who likes fruits?"
View all memories
To see everything Meko has remembered for a user or agent, use the get_all operation. This returns every stored memory, and is useful for debugging or building a memory dashboard.
Example
This example demonstrates the difference memory makes.
Without Meko
Prompt: "Propose a 5 day vacation for me."
The agent has no context about you. It asks generic follow-up questions: "What kind of vacation?", "Budget?", "Where?"
With Meko
First, store your preferences:
Please remember that I like to take vacations at tropical beach locations, on a budget
Start a new session, then:
Prompt: "Propose a 5 day vacation for me."
The agent retrieves your stored preferences and immediately proposes a tropical beach vacation within budget; no follow-up questions are needed.