Install

pip install agentmind

Get API Key

Get your free key at agent-mind.com →

Add Memory to Your Agent (3 Steps)

Step 1: Initialize

from agentmind import Memory

memory = Memory(api_key="YOUR_API_KEY")

Step 2: Create Memory Tools

def remember_tool(content: str):
    """Store important information"""
    return memory.remember(content)

def recall_tool(query: str):
    """Search stored memories"""
    return memory.recall(query)

Step 3: Add to Your Agent

# Add tools to your agent
agent = YourAgent(
    tools=[remember_tool, recall_tool]
)

# Agent remembers important context
user: "I'm allergic to peanuts and love Italian food"
agent: memory.remember("User allergic to peanuts, loves Italian food")

user: "Book me a restaurant"
agent: memory.recall("dietary restrictions and preferences")
agent: "I found an Italian restaurant with a peanut-free menu"

Real Chat Example

from agentmind import Memory

memory = Memory(api_key="YOUR_API_KEY")

# Natural conversation with memory
user: "I'm building a SaaS app"
agent: memory.remember("Building a SaaS application")
agent: "Great! What's your tech stack?"

user: "Next.js and Supabase"
agent: memory.remember("Tech stack: Next.js, Supabase")
agent: "Nice modern stack. What features are you building?"

user: "User auth and payments"
agent: memory.remember("Working on: authentication, payments")
agent: "For payments with Next.js, I recommend Stripe..."

# Days later - agent remembers everything
user: "How do I add subscriptions?"
agent: memory.recall("tech stack payments")
# Agent knows: Next.js, Supabase, working on payments
agent: "Since you're using Next.js with Stripe, here's how to add subscriptions..."

Natural Language Memory

# Ask questions in plain English
memory.recall("What did the user say about pricing?")
memory.recall("Any bugs reported yesterday?")
memory.recall("What's their tech stack?")
memory.recall("Show me all customer complaints")

# Memory understands context
memory.remember("User wants to cancel subscription")
later = memory.recall("cancellation requests")  # Finds it!

# Store complex data
memory.remember({
    "customer": "acme_corp",
    "plan": "enterprise",
    "mrr": 5000
})

# Search naturally
result = memory.recall("enterprise customers")
# Returns the Acme Corp data

Framework Examples