Skip to content
Open
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
132 changes: 132 additions & 0 deletions submissions/valkey-semantic-cache-LiteLLM-tech-geeks.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,132 @@
# Semantic Cache

## Attendee/Team Details

**Team Name:** Neural Nexus

**Members:**

* Mohammed Jawad
* Enayath Ulla

**GitHub Project Repository:**
https://github.com/JAWAD018/Semantic-Cache

---

## Problem Statement Selected

**Problem Statement 1**

**LiteLLM — Add native Valkey support for caching, rate limiting, and semantic cache**

---

## Project Description

Semantic Cache is a Valkey-powered semantic caching gateway inspired by LiteLLM.

Instead of repeatedly calling LLMs for similar prompts, the system uses embeddings and semantic similarity search to detect equivalent requests and return cached responses. This reduces latency, lowers AI costs, and improves scalability.

The project also integrates TheBreeth to provide long-term memory and knowledge graph capabilities.

---

## Approach

1. User sends a prompt.
2. An embedding is generated.
3. The embedding is compared with cached embeddings stored in Valkey.
4. If a similar prompt exists, the cached response is returned.
5. Otherwise:

* The request is sent to the LLM.
* The response is stored in Valkey.
* The interaction is stored in TheBreeth.

This enables semantic caching rather than traditional exact-match caching.

---

## Tech Stack and Tools Used

**Frontend:** Planned (React)

**Backend:** Node.js, Express.js

**Database:** Valkey

**AI Tools/API:**

* Groq
* Transformers.js
* TheBreeth

**Other Tools:**

* Docker
* GitHub
* Postman

---

## Key Features

1. Valkey-powered semantic cache
2. Embedding-based similarity search
3. Cache analytics and metrics
4. LLM cost reduction
5. Long-term memory using TheBreeth

---

## What is Working?

* Semantic search using embeddings
* Valkey integration
* Cache hit/miss detection
* Groq integration
* Analytics tracking
* TheBreeth memory integration

---

## What is Still in Progress?

* Frontend dashboard
* Multi-provider support
* Native rate limiting using Valkey
* Production deployment

---

## Challenges Faced

* Understanding embeddings and semantic search
* Integrating Valkey as a semantic cache backend
* Debugging TheBreeth integration
* Optimizing similarity thresholds

---

## Learnings

* Semantic caching concepts
* Vector embeddings and similarity search
* Valkey for AI workloads
* AI memory systems and knowledge graphs

---

## Future Improvements

* Native Valkey vector search
* Support for OpenAI, Gemini, and Anthropic
* Advanced analytics dashboard
* Production-ready deployment

---

## Final Note

Semantic Cache demonstrates how Valkey can be used as an open-source semantic caching layer for AI gateways. By combining semantic search, intelligent caching, and long-term memory, the project reduces AI costs while improving performance and scalability.