Interactive Examples on GitHub

Explore fully functional, interactive examples with complete code implementations. Clone, run, and modify these examples to see AgentMind in action.

1. Customer Support Agent

from agentmind import Memory

memory = Memory(api_key="YOUR_API_KEY")

# Real conversation with memory
def support_agent(user_id, message):
    # Agent searches its memory naturally
    context = memory.recall(message, user_id=user_id)
    
    # Agent remembers this conversation
    memory.remember(message, user_id=user_id)
    
    # Generate response with full context
    return generate_response(message, context)

# Actual conversation
user: "My app keeps crashing"
agent: memory.remember("User experiencing app crashes", user_id="user_123")
agent: "I'll help you with the crashes. What device are you using?"

user: "iPhone 13"
agent: memory.remember("Using iPhone 13", user_id="user_123")
agent: "Let me check for iPhone 13 specific issues..."

# Days later - agent remembers everything
user: "Still having that problem"
agent: memory.recall("previous issues", user_id="user_123")
agent: "I see you were having crashes on your iPhone 13. Let's try a different solution..."

2. AI Coding Assistant

# Agent learns your project naturally through conversation
user: "I'm building a React app with TypeScript"
agent: memory.remember("Project: React with TypeScript")

user: "We use Tailwind for styling"
agent: memory.remember("Styling: Tailwind CSS")

user: "Create a button component"
agent: memory.recall("project tech stack")
# Agent knows: React, TypeScript, Tailwind
agent: "Here's a TypeScript React component with Tailwind styling..."

# Generated code matches your stack perfectly

3. Personal Assistant

# Natural conversation with persistent memory
user: "I'm allergic to shellfish"
agent: memory.remember("Allergic to shellfish")

user: "I have a meeting every Monday at 9am"
agent: memory.remember("Weekly meeting: Monday 9am")

user: "My wife's birthday is March 15"
agent: memory.remember("Wife's birthday: March 15")

# Agent uses memory contextually
user: "Find me a restaurant for dinner"
agent: memory.recall("dietary restrictions allergies")
agent: "I'll find restaurants without shellfish on the menu"

user: "When's my next meeting?"
agent: memory.recall("meetings schedule")
agent: "Your weekly meeting is Monday at 9am"

user: "I need gift ideas"
agent: memory.recall("family birthdays important dates")
agent: "Your wife's birthday is coming up on March 15. Should I suggest some gift ideas?"

4. Sales Assistant

# Track entire customer journey naturally
def sales_agent(lead_id, message):
    # Remember everything
    memory.remember(
        {"message": message, "timestamp": datetime.now()},
        user_id=lead_id
    )
    
    # Search memory with natural language
    context = memory.recall(message, user_id=lead_id)
    return respond_with_context(message, context)

# Natural sales conversation
lead: "What's your pricing?"
agent: "Our starter plan is $99/month. What size is your team?"

lead: "We have 50 employees"
agent: memory.remember("Team size: 50 employees")
agent: "For 50 users, I'd recommend our Business plan at $999/month"

# Follow-up conversation
lead: "Can we get a discount?"
agent: memory.recall("pricing discussions team size")
agent: "Since you have 50 employees, I can offer a 20% volume discount"

5. Learning Tutor

# Adaptive learning through conversation
student: "I'm learning Python"
tutor: memory.remember("Learning Python", user_id="student_1")

student: "Loops are confusing"
tutor: memory.remember("Struggles with loops", user_id="student_1")
tutor: "Let's start with simple for loops..."

# Next session - tutor adapts
student: "Ready for the next lesson"
tutor: memory.recall("learning progress struggles", user_id="student_1")
tutor: "Since you found loops challenging, let's practice more before moving to functions"

Key Patterns

# No complex queries needed
memory.recall("what did the user say about pricing?")
memory.recall("previous error messages")
memory.recall("user preferences")
memory.recall("all conversations from last week")

Contextual Memory

# Memory understands context
memory.remember("User wants refund")
memory.recall("refund requests")  # Finds all refund-related memories

memory.remember("Bug in checkout flow")
memory.recall("checkout issues")  # Finds all checkout problems

User Segmentation

# Each user has their own memory space
memory.remember("Prefers email", user_id="alice")
memory.remember("Prefers phone", user_id="bob")

memory.recall("contact preference", user_id="alice")  # Returns: "email"
memory.recall("contact preference", user_id="bob")    # Returns: "phone"

Integration Examples