Can AI agents be intelligent without memory?
This project compares Stateless and Stateful (Redis-powered) AI agents using Apple Health data, showing how memory changes the way an agent understands and responds over time.
Built with FastAPI, TypeScript, Redis, RedisVL, and Ollama (Qwen 2.5 7B), all running 100% locally for privacy.
🔒 Your health data never leaves your machine.
- AI/LLM: Ollama (Qwen 2.5 7B) + LangChain + LangGraph
- Vector Search: RedisVL (HNSW index, 1024-dim embeddings via mxbai-embed-large)
- Memory: Redis Stack (checkpointing, indexes)
- Data: Apple Health data export and uploaded to Redis
- Backend: FastAPI + Python 3.11
- Frontend: TypeScript + Vite + Server-Sent Events (SSE)
- Deployment: Docker + Docker Compose
- Privacy: 100% local processing - no external APIs
Left: Stateless agent with no memory. Right: Stateful agent powered by Redis.
| Component | Stateless Agent | Stateful Agent | Technology |
|---|---|---|---|
| LLM | Qwen 2.5 7B | Qwen 2.5 7B | Ollama (local) |
| Orchestration | Simple tool loop | LangGraph StateGraph | LangGraph |
| Short-term Memory | None | Conversation history | Redis checkpointing |
| Episodic Memory | None | User goals & facts | RedisVL vector search |
| Procedural Memory | None | Tool usage patterns | RedisVL vector search |
| Health Data | Redis (read-only) | Redis (read-only) | Redis Hashes |
| Tools | 3 (health only) | 5 (3 health + 2 memory) | Python, LangChain, Langraph |
Health Tools (both agents): get_health_metrics, get_sleep_analysis, get_workout_data
Memory Tools (stateful only): get_my_goals, get_tool_suggestions
Left: Stateless agent forgets everything. Right: Stateful agent stores memory in Redis.
Key difference: Redis memory enables follow-up questions, goal recall, and pattern learning.
Prerequisites:
- Docker & Docker Compose
- Ollama with models:
ollama pull qwen2.5:7bandollama pull mxbai-embed-large - Apple Health export in
apple_health_export/export.xml
# 1. Start services
make up
# 2. Import Apple Health data
make import
# 3. Open http://localhost:3000Try it:
- Ask both agents: "How many workouts do I have?" → Both answer correctly ✅
- Follow up: "What's the most common type?"
- ❌ Stateless: "What are you referring to?"
- ✅ Stateful: "Traditional Strength Training (40 workouts, 26%)"
Getting Started:
- Prerequisites - Docker, Ollama, Apple Health export
- Quickstart - Running in 5 minutes
Agent Architecture:
- Stateless Agent - Simple tool loop without memory
- Stateful Agent - LangGraph with four-layer memory
- Stateless vs Stateful Comparison - Side-by-side breakdown
Core Concepts:
- Agentic RAG - Autonomous tool calling
- Apple Health Data Import - Data pipeline
- Qwen Best Practices - Tool calling optimization
- Example Queries - Try these to see memory in action
Memory Systems:
- Memory Architecture - Four-layer memory system
- Redis Patterns - Data structures for AI agents
- LangGraph Checkpointing - Conversation state
Reference:
- Tools, Services & Utils - Complete code reference
This is a demo project showcasing Redis + RedisVL for AI agent memory. Feel free to:
- Open issues for bugs or questions
- Submit PRs for improvements
- Use locally with your own health data
MIT License - See LICENSE
Built to showcase Redis + RedisVL for intelligent AI agents ❤️
Built with ❤️ by Allierays

