https://github.com/booleanhunter/redish
Shopping AI assistant with recipe tools, product search, and semantic caching for grocery e-commerce.
https://github.com/booleanhunter/redish
langchain langgraph langgraph-js openai redis
Last synced: 4 months ago
JSON representation
Shopping AI assistant with recipe tools, product search, and semantic caching for grocery e-commerce.
- Host: GitHub
- URL: https://github.com/booleanhunter/redish
- Owner: booleanhunter
- License: mit
- Created: 2025-09-13T10:06:42.000Z (5 months ago)
- Default Branch: main
- Last Pushed: 2025-10-05T10:44:20.000Z (4 months ago)
- Last Synced: 2025-10-05T11:37:40.960Z (4 months ago)
- Topics: langchain, langgraph, langgraph-js, openai, redis
- Language: JavaScript
- Homepage: https://tryredish.vercel.app/
- Size: 7.99 MB
- Stars: 3
- Watchers: 0
- Forks: 0
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
- License: LICENSE
Awesome Lists containing this project
README
# π Redish
**Redis-powered grocery e-commerce with intelligent shopping assistance.**
Redish is an AI-powered grocery shopping platform that combines Redis's speed with LangGraph's intelligent workflow orchestration. Get personalized recipe recommendations, smart product suggestions, and lightning-fast responses through semantic caching.
## App screenshots

---
## Product Features
- **Smart Grocery Shopping**: AI-powered assistant helps you find ingredients, discover recipes, and manage your cart
- **Product Search**: Both text and vector-based search across grocery products with embeddings
- **Recipe Intelligence**: Get ingredient lists with suggested products for any recipe
- **Cart Management**: Add, view, and manage shopping cart items
---
## Tech Stack
- **Node.js** + **Express** (Backend API)
- **Redis** (Product store, conversational history, and semantic caching with LangCache)
- **LangGraph** (AI workflow orchestration)
- **OpenAI API** (GPT-4 for intelligent responses)
- **HTML + CSS + Vanilla JS** (Frontend)
---
## Getting Started
### Prerequisites
- **OpenAI API Key**: [Create an API key](https://platform.openai.com/account/api-keys)
- **Redis LangCache API**: [Get LangCache credentials](https://redis.io/langcache/)
### Clone this repository
```bash
git clone https://github.com/redis-developer/Redish.git
cd Redish
```
### Configure environment variables
Create a `.env` file at the root:
```bash
APP_NAME="Redish"
SERVER_PORT=3000
OPENAI_API_KEY=your_openai_api_key
REDIS_URL=your_redis_connection_string
LANGCACHE_API_KEY="your_langcache_api_key"
LANGCACHE_API_BASE_URL="your_langcache_api_base_url"
LANGCACHE_CACHE_ID="your_langcache_cache_id"
MODEL_NAME="gpt-4o-mini"
# For tracing with Langsmith
LANGSMITH_TRACING="true"
LANGSMITH_ENDPOINT="your_langsmith_endpoint"
LANGSMITH_API_KEY="your_langsmith_api_key"
LANGSMITH_PROJECT="your_langsmith_project"
```
π Make sure to replace these placeholders with your real values before running the app.
### Option 1: Manual installation
#### β
Prerequisites
- **Node.js (v18 or higher)**: [Download & Install Node.js](https://nodejs.org/)
- **Redis**: You can either:
- Install Redis locally: [Redis installation guide](https://redis.io/docs/getting-started/installation/)
- Use Docker: `docker run --name redish-redis -p 6379:6379 redis:8.0`
- Use [Redis Cloud](https://redis.io) (no installation required)
#### β
Setup
1. Install dependencies:
```bash
npm install
```
2. Load sample grocery data:
```bash
npm run load-products
```
3. Start the server:
```bash
npm start
```
### Option 2: π³ Run with Docker Compose
Skip manual setup and run everything using Docker:
```bash
docker compose up
```
To stop the containers:
```bash
docker compose down -v
```
### Access the app
Visit http://localhost:3000 in your browser (or use the port specified in `.env`).
---
## AI Features
- **Recipe Ingredients**: Ask for ingredients for any recipe and get suggested products
- **Product Search**: Find products by name, category, or description
- **Smart Recommendations**: AI suggests alternatives and complementary items
- **Cart Management**: Add, remove, and view cart items through natural conversation
## Technical features
- **Semantic Cache**: Similar queries return instantly using Redis LangCache
- **Vector Search**: Find products using AI-powered similarity search
- **Redis as memory layer**: for fast data retrieval
- **LangGraph Workflows**: AI agent routing, tool selection
- **Multi-tool Agent**: Recipe tools, search tools, cart tools, and knowledge tools
---
## Architecture
The grocery agent uses a LangGraph-powered AI agent that routes requests through specialized tools.
1. **Cache Check**: First checks Redis semantic cache for similar queries
2. **AI Agent**: Routes to appropriate tools based on request type
3. **Specialized Tools**: Recipe ingredients, product search, cart operations, direct answers
4. **Services Layer**: Product, cart, and chat services
5. **Redis Storage**: Vector embeddings, semantic cache, and session data


### Project architecture
```
services/
βββ products/ # Product Business Component
β βββ api/ # REST API endpoints
β βββ domain/ # Business logic
β βββ data/ # Data access layer
βββ cart/ # Cart Business Component
β βββ api/
β βββ domain/
β βββ data/
βββchat/ # Chat/Cache Business Component
β βββ api/
β βββ domain/
β βββ data/
βββ ai/grocery-ai-agent/ # AI Agent
β βββ tools.js # API/Interface Layer
β βββ nodes.js # Agent Logic
β βββ index.js # Orchestration
β βββ state/ # Data Access
```
---
## API Endpoints
- `POST /api/chat` - Main chat interface for AI shopping assistant
- `GET /api/products/search` - Search products with text/vector similarity
- `POST /api/cart/add` - Add items to shopping cart
- `GET /api/cart` - View cart contents
- `DELETE /api/cart` - Clear cart
---
## π€ Contributing
1. Fork the repository
2. Create your feature branch (`git checkout -b feature/amazing-feature`)
3. Commit your changes (`git commit -m 'Add amazing feature'`)
4. Push to the branch (`git push origin feature/amazing-feature`)
5. Open a Pull Request
---
## π License
This project is licensed under the MIT License - see the [LICENSE](LICENSE) file for details.
---
## π Reporting Issues
If you find a bug or have a feature request, [open an issue](https://github.com/redis-developer/Redish/issues).