Skip to content

Commit 308d7ca

Browse files
committed
docs: migrate from Sphinx to mkdocs material
Replace the Sphinx based documentation toolchain with mkdocs material to align branding, typography and information architecture with the wider Redis docs ecosystem. Toolchain - Remove docs/conf.py, docs/_extension, docs/_templates, docs/Makefile, docs/make.bat and the docs/_static tree - Add mkdocs.yml configured with the material theme, Redis brand palette (red 500, ink 900, slate 700) and Space Grotesk / Space Mono typography - Add scripts/mkdocs_hooks.py to suppress pre existing griffe docstring warnings so strict builds pass without modifying source docstrings - Update .readthedocs.yaml to build with mkdocs - Update Makefile docs targets (docs build, docs serve) to invoke mkdocs Content - Rewrite all Sphinx MyST flavored markdown to plain CommonMark plus pymdownx extensions - Convert every .rst API reference page to mkdocstrings .md with the Google docstring style - Render existing user_guide notebooks in place via mkdocs jupyter - Add a Redis branded landing hero on the home page (script logo, title and tagline) and a redis-brand.css overrides file - Carry over Redis favicon and architecture diagram into docs/assets Agent affordances - Add AGENTS.md at the repository root with a usage oriented quick reference for AI agents consuming redisvl - Add docs/for-ais-only/ with REPOSITORY_MAP, BUILD_AND_TEST and FAILURE_MODES tailored to contributors working on the codebase - Emit llms.txt and llms-full.txt at build time via the llmstxt plugin
1 parent ba4c869 commit 308d7ca

65 files changed

Lines changed: 2300 additions & 3088 deletions

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

.gitignore

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -105,8 +105,8 @@ instance/
105105
# Scrapy stuff:
106106
.scrapy
107107

108-
# Sphinx documentation
109-
docs/_build/
108+
# mkdocs build cache
109+
.cache/
110110

111111
# PyBuilder
112112
.pybuilder/

.readthedocs.yaml

Lines changed: 3 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -26,10 +26,6 @@ build:
2626
UV_PROJECT_ENVIRONMENT="${READTHEDOCS_VIRTUALENV_PATH}" \
2727
~/.local/bin/uv sync --frozen --group docs
2828
29-
# Build documentation in the "docs/" directory with Sphinx
30-
sphinx:
31-
configuration: docs/conf.py
32-
33-
formats:
34-
- pdf
35-
- epub
29+
# Build documentation with mkdocs
30+
mkdocs:
31+
configuration: mkdocs.yml

AGENTS.md

Lines changed: 131 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,131 @@
1+
# AGENTS.md
2+
3+
Quick reference for AI agents using `redisvl`. For agents working *on* the
4+
codebase itself, see [docs/for-ais-only/](docs/for-ais-only/index.md).
5+
6+
## What redisvl is
7+
8+
A Python library for using Redis as a vector database. It wraps Redis Search
9+
(`FT.CREATE`, `FT.SEARCH`, `FT.AGGREGATE`, vector index types) behind:
10+
11+
- **`SearchIndex` / `AsyncSearchIndex`**: schema-driven index management.
12+
- **Query classes**: `VectorQuery`, `VectorRangeQuery`, `FilterQuery`,
13+
`HybridQuery`, `MultiVectorQuery`, `TextQuery`, `CountQuery`, `SQLQuery`.
14+
- **Filter expressions**: `Tag`, `Text`, `Num`, `Geo`, `GeoRadius`.
15+
- **Extensions**: `SemanticCache`, `LangCacheSemanticCache`, `EmbeddingsCache`,
16+
`MessageHistory` / `SemanticMessageHistory`, `SemanticRouter`.
17+
- **Vectorizers**: OpenAI, Azure OpenAI, Cohere, HuggingFace
18+
(sentence-transformers), Mistral, Vertex AI, Bedrock, VoyageAI, custom.
19+
- **Rerankers**: Cohere, HuggingFace cross-encoder, VoyageAI.
20+
- **CLI**: `rvl index`, `rvl stats`, `rvl mcp`, `rvl version`.
21+
- **MCP server**: serves an existing Redis index over stdio / HTTP / SSE.
22+
23+
## Install
24+
25+
```bash
26+
pip install redisvl
27+
# common provider extras
28+
pip install redisvl[openai,cohere,sentence-transformers]
29+
# everything (heavy)
30+
pip install redisvl[all]
31+
```
32+
33+
Requires Python 3.10+ and a Redis 8.x instance with the search module
34+
(`docker run -d -p 6379:6379 redis:8.4`).
35+
36+
## Minimum viable use
37+
38+
```python
39+
from redisvl.schema import IndexSchema
40+
from redisvl.index import SearchIndex
41+
from redisvl.query import VectorQuery
42+
43+
schema = IndexSchema.from_dict({
44+
"index": {"name": "docs", "prefix": "doc:", "storage_type": "hash"},
45+
"fields": [
46+
{"name": "title", "type": "text"},
47+
{"name": "category", "type": "tag"},
48+
{"name": "embedding", "type": "vector",
49+
"attrs": {"dims": 1536, "algorithm": "hnsw",
50+
"distance_metric": "cosine", "datatype": "float32"}},
51+
],
52+
})
53+
54+
index = SearchIndex(schema, redis_url="redis://localhost:6379")
55+
index.create(overwrite=True)
56+
57+
index.load([
58+
{"title": "intro", "category": "guide", "embedding": vector_bytes},
59+
])
60+
61+
results = index.query(VectorQuery(
62+
vector=query_embedding,
63+
vector_field_name="embedding",
64+
return_fields=["title", "category"],
65+
num_results=10,
66+
))
67+
```
68+
69+
## Public import paths (stable)
70+
71+
Use the **subpackage**, not the module:
72+
73+
```python
74+
from redisvl.index import SearchIndex, AsyncSearchIndex
75+
from redisvl.schema import IndexSchema
76+
from redisvl.query import (
77+
VectorQuery, VectorRangeQuery, FilterQuery, CountQuery, TextQuery,
78+
HybridQuery, MultiVectorQuery, AggregateHybridQuery, SQLQuery, Vector,
79+
)
80+
from redisvl.query.filter import Tag, Text, Num, Geo, GeoRadius
81+
from redisvl.extensions.cache.llm import SemanticCache, LangCacheSemanticCache
82+
from redisvl.extensions.message_history import (
83+
MessageHistory, SemanticMessageHistory,
84+
)
85+
from redisvl.extensions.router import SemanticRouter, Route, RoutingConfig
86+
from redisvl.utils.vectorize import (
87+
HFTextVectorizer, OpenAITextVectorizer, AzureOpenAITextVectorizer,
88+
CohereTextVectorizer, MistralAITextVectorizer, VoyageAIVectorizer,
89+
VertexAIVectorizer, BedrockVectorizer, CustomVectorizer,
90+
)
91+
from redisvl.utils.rerank import (
92+
CohereReranker, HFCrossEncoderReranker, VoyageAIReranker,
93+
)
94+
```
95+
96+
## What docs to read
97+
98+
- Concepts → [docs/concepts/](docs/concepts/index.md): how indexes, schemas,
99+
queries, and extensions fit together.
100+
- User Guide → [docs/user_guide/](docs/user_guide/index.md): notebooks for
101+
every common task.
102+
- API Reference → [docs/api/](docs/api/index.md): the generated reference.
103+
- Examples → [docs/examples/](docs/examples/index.md): links to
104+
redis-ai-resources for end-to-end recipes.
105+
- For AI Agents (codebase contributors) →
106+
[docs/for-ais-only/](docs/for-ais-only/index.md).
107+
108+
## Machine-readable indexes
109+
110+
When the docs are built, they emit:
111+
112+
- [`llms.txt`](https://docs.redisvl.com/llms.txt) — flat index of every doc.
113+
- [`llms-full.txt`](https://docs.redisvl.com/llms-full.txt) — concatenated
114+
full content for one-shot loading.
115+
116+
## Things to know before suggesting code
117+
118+
- **Always combine schema + algorithm changes.** Bundling datatype and
119+
algorithm changes into a single index patch produces one drop/rebuild cycle
120+
instead of two.
121+
- **`MessageHistory` / `SemanticMessageHistory`** replace the deprecated
122+
`SessionManager` / `SemanticSessionManager`. The old names still import but
123+
emit a `DeprecationWarning` and will be removed.
124+
- **SVS-VAMANA** requires Redis ≥ 8.2.0 with Redis Search ≥ 2.8.10 and only
125+
supports `float16` / `float32` datatypes.
126+
- **`SQLQuery`** requires the `redisvl[sql-redis]` extra and translates SQL
127+
`SELECT` into `FT.SEARCH` / `FT.AGGREGATE` via the
128+
[sql-redis](https://github.com/redis-developer/sql-redis) project.
129+
- **`HybridQuery` vs `AggregateHybridQuery`** weight scores differently:
130+
`HybridQuery.linear_alpha` weights *text*, `AggregateHybridQuery.alpha`
131+
weights *vector*. Recheck `alpha` when switching.

Makefile

Lines changed: 3 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -73,12 +73,11 @@ check: lint test ## Run all checks (lint + test)
7373

7474
docs-build: ## Build documentation
7575
@echo "📚 Building documentation"
76-
uv run make -C docs html
76+
uv run mkdocs build --strict
7777

7878
docs-serve: ## Serve documentation locally
79-
@echo "🌐 Serving documentation at http://localhost:8000"
80-
@echo "📁 Make sure docs are built first with 'make docs-build'"
81-
uv run python -m http.server --directory docs/_build/html
79+
@echo "🌐 Serving documentation at http://127.0.0.1:8000"
80+
uv run mkdocs serve --dev-addr 127.0.0.1:8000
8281

8382
build: ## Build wheel and source distribution
8483
@echo "🏗️ Building distribution packages"

docs/Makefile

Lines changed: 0 additions & 22 deletions
This file was deleted.

docs/_extension/gallery_directive.py

Lines changed: 0 additions & 161 deletions
This file was deleted.

docs/_static/.nojekyll

Whitespace-only changes.
-1.89 KB
Binary file not shown.
-461 Bytes
Binary file not shown.

0 commit comments

Comments
 (0)