DEV Community

Rajiv
Rajiv Subscriber

Posted on

LeaseGuard: Real-time AI for Lease Risk Detection powered by Redis

Redis AI Challenge: Real-Time AI Innovators

This is a submission for the Redis AI Challenge: Real-Time AI Innovators.

What I Built

LeaseGuard analyzes residential lease agreements in real time to flag risky or unlawful clauses. It isn’t a chatbot wrapper; it’s an AI application with Redis as the real-time data layer:

  • Vectorized clauses stored in RedisJSON, indexed with RediSearch for KNN and hybrid retrieval
  • Two-tier semantic caching to cut LLM calls and latency
  • Event-driven pipeline and collaboration powered by Redis Streams and Pub/Sub
  • Conversation/session state fully in Redis structures (Lists/Sets/JSON), with optional TimeSeries

Outcome: sub-second retrieval, grounded answers, and live telemetry/alerts.

Demo

How I Used Redis 8

Vector index (RediSearch over RedisJSON)

Vector index

Storing clauses in RedisJSON with embeddings

RedisJSON clauses

Violation detection via vector similarity (KNN)

KNN detection

Hybrid search (text + vector + filters) with RediSearch

Hybrid search

Semantic caching (L1 memory + L2 RedisJSON + similarity fallback)

Semantic caching

Streams (event sourcing + pipeline telemetry)

Streams

Pub/Sub (violation alerts and collaboration)

Pub/Sub

Conversation state in Redis (Lists + TTL)

Conversation state

Optional TimeSeries (performance/analytics where supported)

TimeSeries

Real-Time AI Innovators: I went beyond a chatbot by combining vector search, semantic caching, streams, and pub/sub to accelerate AI.
Beyond the Cache: I use Redis as a multi‑model platform: JSON as primary store, RediSearch for hybrid vector, TimeSeries for analytics, Streams for event sourcing, Lists/Sets for session and UX, Pub/Sub for real-time collaboration.


Thanks for Reading!

GitHub repo

Top comments (0)