Skip to content

Commit 81d1e0d

Browse files
committed
Fix various commands to work with Redis Cluster
1 parent e5ded57 commit 81d1e0d

29 files changed

+2404
-396
lines changed

.github/workflows/claude.yml

Lines changed: 1 addition & 24 deletions
Original file line numberDiff line numberDiff line change
@@ -36,27 +36,4 @@ jobs:
3636
anthropic_api_key: ${{ secrets.ANTHROPIC_API_KEY }}
3737

3838
# Define which tools Claude can use
39-
allowed_tools: |
40-
Bash(git status)
41-
Bash(git log)
42-
Bash(git show)
43-
Bash(git blame)
44-
Bash(git reflog)
45-
Bash(git stash list)
46-
Bash(git ls-files)
47-
Bash(git branch)
48-
Bash(git tag)
49-
Bash(git diff)
50-
Bash(make:*)
51-
Bash(pytest:*)
52-
Bash(cd:*)
53-
Bash(ls:*)
54-
Bash(make)
55-
Bash(make:*)
56-
View
57-
GlobTool
58-
GrepTool
59-
BatchTool
60-
61-
# Your Anthropic API key (stored as a GitHub secret)
62-
anthropic_api_key: ${{ secrets.ANTHROPIC_API_KEY }}
39+
allowed_tools: "Bash(git status),Bash(git log),Bash(git show),Bash(git blame),Bash(git reflog),Bash(git stash list),Bash(git ls-files),Bash(git branch),Bash(git tag),Bash(git diff),Bash(make:*),Bash(pytest:*),Bash(cd:*),Bash(ls:*),Bash(make),Bash(make:*),View,GlobTool,GrepTool,BatchTool"

.github/workflows/test.yml

Lines changed: 15 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -78,7 +78,7 @@ jobs:
7878
make test-all
7979
8080
test:
81-
name: Python ${{ matrix.python-version }} - ${{ matrix.connection }} [redis ${{ matrix.redis-version }}]
81+
name: Python ${{ matrix.python-version }} - ${{ matrix.connection }} - redis-py ${{ matrix.redis-py-version }} [redis ${{ matrix.redis-version }}]
8282
runs-on: ubuntu-latest
8383
needs: service-tests
8484
env:
@@ -89,7 +89,8 @@ jobs:
8989
# 3.11 tests are run in the service-tests job
9090
python-version: ["3.9", "3.10", 3.12, 3.13]
9191
connection: ["hiredis", "plain"]
92-
redis-version: ["6.2.6-v9", "latest", "8.0-M03"]
92+
redis-py-version: ["5.x", "6.x"]
93+
redis-version: ["6.2.6-v9", "latest", "8.0.1"]
9394

9495
steps:
9596
- name: Check out repository
@@ -116,14 +117,22 @@ jobs:
116117
run: |
117118
poetry install --all-extras
118119
120+
- name: Install specific redis-py version
121+
run: |
122+
if [[ "${{ matrix.redis-py-version }}" == "5.x" ]]; then
123+
poetry add "redis>=5.0.0,<6.0.0"
124+
else
125+
poetry add "redis>=6.0.0,<7.0.0"
126+
fi
127+
119128
- name: Install hiredis if needed
120129
if: matrix.connection == 'hiredis'
121130
run: |
122131
poetry add hiredis
123132
124133
- name: Set Redis image name
125134
run: |
126-
if [[ "${{ matrix.redis-version }}" == "8.0-M03" ]]; then
135+
if [[ "${{ matrix.redis-version }}" == "8.0.1" ]]; then
127136
echo "REDIS_IMAGE=redis:${{ matrix.redis-version }}" >> $GITHUB_ENV
128137
else
129138
echo "REDIS_IMAGE=redis/redis-stack-server:${{ matrix.redis-version }}" >> $GITHUB_ENV
@@ -135,7 +144,7 @@ jobs:
135144
credentials_json: ${{ secrets.GOOGLE_CREDENTIALS }}
136145

137146
- name: Run tests
138-
if: matrix.connection == 'plain' && matrix.redis-version == 'latest'
147+
if: matrix.connection == 'plain' && matrix.redis-py-version == '6.x' && matrix.redis-version == 'latest'
139148
env:
140149
HF_HOME: ${{ github.workspace }}/hf_cache
141150
GCP_LOCATION: ${{ secrets.GCP_LOCATION }}
@@ -144,12 +153,12 @@ jobs:
144153
make test
145154
146155
- name: Run tests (alternate)
147-
if: matrix.connection != 'plain' || matrix.redis-version != 'latest'
156+
if: matrix.connection != 'plain' || matrix.redis-py-version != '6.x' || matrix.redis-version != 'latest'
148157
run: |
149158
make test
150159
151160
- name: Run notebooks
152-
if: matrix.connection == 'plain' && matrix.redis-version == 'latest'
161+
if: matrix.connection == 'plain' && matrix.redis-py-version == '6.x' && matrix.redis-version == 'latest'
153162
env:
154163
HF_HOME: ${{ github.workspace }}/hf_cache
155164
OPENAI_API_KEY: ${{ secrets.OPENAI_API_KEY }}

.gitignore

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -216,9 +216,17 @@ pyrightconfig.json
216216
[Ll]ocal
217217
pyvenv.cfg
218218
pip-selfcheck.json
219+
env
220+
venv
221+
.venv
219222

220223
libs/redis/docs/.Trash*
221224
.python-version
222225
.idea/*
223226
.vscode/settings.json
224227
.python-version
228+
tests/data
229+
.git
230+
.cursor
231+
.junie
232+
.undodir

CLAUDE.md

Lines changed: 116 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,116 @@
1+
# CLAUDE.md - RedisVL Project Context
2+
3+
## Frequently Used Commands
4+
5+
```bash
6+
# Development workflow
7+
make install # Install dependencies
8+
make format # Format code (black + isort)
9+
make check-types # Run mypy type checking
10+
make lint # Run all linting (format + types)
11+
make test # Run tests (no external APIs)
12+
make test-all # Run all tests (includes API tests)
13+
make check # Full check (lint + test)
14+
15+
# Redis setup
16+
make redis-start # Start Redis Stack container
17+
make redis-stop # Stop Redis Stack container
18+
19+
# Documentation
20+
make docs-build # Build documentation
21+
make docs-serve # Serve docs locally
22+
```
23+
24+
Pre-commit hooks are also configured, which you should
25+
run before you commit:
26+
```bash
27+
pre-commit run --all-files
28+
```
29+
30+
## Important Architectural Patterns
31+
32+
### Async/Sync Dual Interfaces
33+
- Most core classes have both sync and async versions (e.g., `SearchIndex` / `AsyncSearchIndex`)
34+
- Follow existing patterns when adding new functionality
35+
36+
### Schema-Driven Design
37+
```python
38+
# Index schemas define structure
39+
schema = IndexSchema.from_yaml("schema.yaml")
40+
index = SearchIndex(schema, redis_url="redis://localhost:6379")
41+
```
42+
43+
## Critical Rules
44+
45+
### Do Not Modify
46+
- **CRITICAL**: Do not change this line unless explicitly asked:
47+
```python
48+
token.strip().strip(",").replace(""", "").replace(""", "").lower()
49+
```
50+
51+
### README.md Maintenance
52+
**IMPORTANT**: DO NOT modify README.md unless explicitly requested.
53+
54+
**If you need to document something, use these alternatives:**
55+
- Development info → CONTRIBUTING.md
56+
- API details → docs/ directory
57+
- Examples → docs/examples/
58+
- Project memory (explicit preferences, directives, etc.) → CLAUDE.md
59+
60+
## Testing Notes
61+
RedisVL uses `pytest` with `testcontainers` for testing.
62+
63+
- `make test` - unit tests only (no external APIs)
64+
- `make test-all` - includes integration tests requiring API keys
65+
66+
## Project Structure
67+
68+
```
69+
redisvl/
70+
├── cli/ # Command-line interface (rvl command)
71+
├── extensions/ # AI extensions (cache, memory, routing)
72+
│ ├── cache/ # Semantic caching for LLMs
73+
│ ├── llmcache/ # LLM-specific caching
74+
│ ├── message_history/ # Chat history management
75+
│ ├── router/ # Semantic routing
76+
│ └── session_manager/ # Session management
77+
├── index/ # SearchIndex classes (sync/async)
78+
├── query/ # Query builders (Vector, Range, Filter, Count)
79+
├── redis/ # Redis client utilities
80+
├── schema/ # Index schema definitions
81+
└── utils/ # Utilities (vectorizers, rerankers, optimization)
82+
├── optimize/ # Threshold optimization
83+
├── rerank/ # Result reranking
84+
└── vectorize/ # Embedding providers integration
85+
```
86+
87+
## Core Components
88+
89+
### 1. Index Management
90+
- `SearchIndex` / `AsyncSearchIndex` - Main interface for Redis vector indices
91+
- `IndexSchema` - Define index structure with fields (text, tags, vectors, etc.)
92+
- Support for JSON and Hash storage types
93+
94+
### 2. Query System
95+
- `VectorQuery` - Semantic similarity search
96+
- `RangeQuery` - Vector search within distance range
97+
- `FilterQuery` - Metadata filtering and full-text search
98+
- `CountQuery` - Count matching records
99+
- Etc.
100+
101+
### 3. AI Extensions
102+
- `SemanticCache` - LLM response caching with semantic similarity
103+
- `EmbeddingsCache` - Cache for vector embeddings
104+
- `MessageHistory` - Chat history with recency/relevancy retrieval
105+
- `SemanticRouter` - Route queries to topics/intents
106+
107+
### 4. Vectorizers (Optional Dependencies)
108+
- OpenAI, Azure OpenAI, Cohere, HuggingFace, Mistral, VoyageAI
109+
- Custom vectorizer support
110+
- Batch processing capabilities
111+
112+
## Documentation
113+
- Main docs: https://docs.redisvl.com
114+
- Built with Sphinx from `docs/` directory
115+
- Includes API reference and user guides
116+
- Example notebooks in documentation `docs/user_guide/...`

poetry.lock

Lines changed: 19 additions & 31 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

pyproject.toml

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -26,7 +26,7 @@ numpy = [
2626
{ version = ">=1.26.0,<3", python = ">=3.12" },
2727
]
2828
pyyaml = ">=5.4,<7.0"
29-
redis = "^5.0"
29+
redis = ">=5.0,<7.0"
3030
pydantic = "^2"
3131
tenacity = ">=8.2.2"
3232
ml-dtypes = ">=0.4.0,<1.0.0"
@@ -68,8 +68,8 @@ pytest-xdist = {extras = ["psutil"], version = "^3.6.1"}
6868
pre-commit = "^4.1.0"
6969
mypy = "1.9.0"
7070
nbval = "^0.11.0"
71-
types-redis = "*"
7271
types-pyyaml = "*"
72+
types-pyopenssl = "*"
7373
testcontainers = "^4.3.1"
7474
cryptography = { version = ">=44.0.1", markers = "python_version > '3.9.1'" }
7575

0 commit comments

Comments
 (0)