Skip to content

allierays/redis-wellness

Repository files navigation

Redis Wellness ❤️

Python TypeScript Redis FastAPI Privacy

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.


🛠️ Tech Stack

  • 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

🖼️ Side-by-Side Comparison

Side-by-side chat interface showing stateless vs stateful agents

Left: Stateless agent with no memory. Right: Stateful agent powered by Redis.


📊 Core Architecture

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


🎯 The Difference

Stateless vs Stateful comparison

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.

📖 See detailed comparison →


🚀 Quick Start

Prerequisites:

  • Docker & Docker Compose
  • Ollama with models: ollama pull qwen2.5:7b and ollama pull mxbai-embed-large
  • Apple Health export in apple_health_export/export.xml

📖 Detailed prerequisites →

# 1. Start services
make up

# 2. Import Apple Health data
make import

# 3. Open http://localhost:3000

Try 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%)"

📖 Full setup guide →


📚 Documentation

Getting Started:

  1. Prerequisites - Docker, Ollama, Apple Health export
  2. Quickstart - Running in 5 minutes

Agent Architecture:

  1. Stateless Agent - Simple tool loop without memory
  2. Stateful Agent - LangGraph with four-layer memory
  3. Stateless vs Stateful Comparison - Side-by-side breakdown

Core Concepts:

  1. Agentic RAG - Autonomous tool calling
  2. Apple Health Data Import - Data pipeline
  3. Qwen Best Practices - Tool calling optimization
  4. Example Queries - Try these to see memory in action

Memory Systems:

  1. Memory Architecture - Four-layer memory system
  2. Redis Patterns - Data structures for AI agents
  3. LangGraph Checkpointing - Conversation state

Reference:

  1. Tools, Services & Utils - Complete code reference

🤝 Contributing

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

📄 License

MIT License - See LICENSE


Built to showcase Redis + RedisVL for intelligent AI agents ❤️

Built with ❤️ by Allierays

About

Comparing stateless and stateful Agentic RAG with Apple Health data, Ollama, LangChain, Redis, and RedisVL.

Topics

Resources

Stars

Watchers

Forks

Packages

 
 
 

Contributors