docs: migrate from Sphinx to mkdocs material#608
Conversation
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
🛡️ Jit Security Scan Results✅ No security findings were detected in this PR
Security scan by Jit
|
There was a problem hiding this comment.
Pull request overview
This PR migrates the project documentation toolchain from Sphinx to MkDocs Material to align RedisVL docs with the broader Redis docs ecosystem (theme/branding, mkdocstrings API reference, notebook rendering, and LLM-friendly indexes).
Changes:
- Replaces the Sphinx build system with MkDocs Material (new
mkdocs.yml, updated docs deps, updated RTD + Makefile targets). - Ports docs pages to MkDocs/CommonMark + pymdownx patterns, and converts
.rstAPI pages to mkdocstrings-backed.md. - Adds AI-agent oriented docs (
AGENTS.mdanddocs/for-ais-only/*) and a docs hook to suppress noisy griffe warnings during strict builds.
Reviewed changes
Copilot reviewed 55 out of 65 changed files in this pull request and generated 2 comments.
Show a summary per file
| File | Description |
|---|---|
| scripts/mkdocs_hooks.py | Adds MkDocs hook to quiet griffe/mkdocstrings warning-level logging during strict builds. |
| pyproject.toml | Replaces Sphinx docs dependencies with MkDocs/MkDocs Material toolchain dependencies. |
| mkdocs.yml | New MkDocs site configuration (theme, plugins, nav, hooks, markdown extensions). |
| Makefile | Switches docs-build/docs-serve targets from Sphinx artifacts to MkDocs commands. |
| docs/user_guide/use_cases/index.md | Converts Sphinx grid directives to MkDocs Material “cards” layout + adds frontmatter description. |
| docs/user_guide/installation.md | Removes MyST metadata block and normalizes code fences/typography for MkDocs. |
| docs/user_guide/index.md | Reworks landing content to MkDocs Material “cards” layout + adds frontmatter description. |
| docs/user_guide/how_to_guides/mcp.md | Converts links/admonitions to MkDocs style; large content sections removed. |
| docs/user_guide/how_to_guides/index.md | Converts grid layout to MkDocs “cards” and keeps quick-reference table. |
| docs/stylesheets/redis-brand.css | Adds Redis-brand CSS overrides and landing hero styling. |
| docs/Makefile | Removes Sphinx docs Makefile. |
| docs/make.bat | Removes Sphinx Windows build script. |
| docs/index.md | Adds branded landing hero and converts site navigation blocks to MkDocs “cards”. |
| docs/for-ais-only/REPOSITORY_MAP.md | Adds repository map for AI coding agents. |
| docs/for-ais-only/index.md | Adds “For AI Agents” landing page with navigation cards. |
| docs/for-ais-only/FAILURE_MODES.md | Adds troubleshooting/failure-mode guide for agents contributing changes. |
| docs/for-ais-only/BUILD_AND_TEST.md | Adds build/test/docs command reference for agents. |
| docs/examples/index.md | Converts admonitions; removes Sphinx gallery-grid-driven “Demo Applications” section. |
| docs/conf.py | Removes Sphinx configuration. |
| docs/concepts/utilities.md | Updates cross-references from Sphinx {doc} to MkDocs-relative links. |
| docs/concepts/search-and-indexing.md | Updates cross-references from Sphinx {doc} to MkDocs-relative links. |
| docs/concepts/queries.md | Converts admonitions to MkDocs style and updates “Learn more” links. |
| docs/concepts/mcp.md | Updates link to MCP how-to guide (MkDocs-relative link). |
| docs/concepts/index.md | Converts concept landing to MkDocs “cards” layout + adds frontmatter description. |
| docs/concepts/field-attributes.md | Updates API reference links from Sphinx {doc} to MkDocs-relative links. |
| docs/concepts/extensions.md | Converts admonitions and updates links to MkDocs-relative links. |
| docs/concepts/architecture.md | Updates image embedding from Sphinx directive to Markdown image link. |
| docs/assets/redisvl-architecture.svg | Adds/relocates architecture diagram into MkDocs assets. |
| docs/assets/redis-logo-script.svg | Adds white script logo for theme header. |
| docs/assets/redis-logo-script-red.svg | Adds red script logo for landing hero. |
| docs/assets/favicon.png | Adds/relocates favicon into MkDocs assets. |
| docs/api/vectorizer.rst | Removes Sphinx API page for vectorizers. |
| docs/api/vectorizer.md | Adds mkdocstrings-based vectorizer API reference page. |
| docs/api/vector.rst | Removes Sphinx API page for Vector. |
| docs/api/vector.md | Adds mkdocstrings-based Vector API page and intra-API link. |
| docs/api/searchindex.rst | Removes Sphinx API page for SearchIndex classes. |
| docs/api/searchindex.md | Adds mkdocstrings-based SearchIndex/AsyncSearchIndex API page. |
| docs/api/schema.rst | Removes Sphinx API page for schema/field types. |
| docs/api/schema.md | Adds mkdocstrings-based schema + field types API page and condensed guidance. |
| docs/api/router.rst | Removes Sphinx router API page. |
| docs/api/router.md | Adds mkdocstrings-based router API page. |
| docs/api/reranker.rst | Removes Sphinx reranker API page. |
| docs/api/reranker.md | Adds mkdocstrings-based reranker API page. |
| docs/api/query.rst | Removes Sphinx query API page. |
| docs/api/query.md | Adds mkdocstrings-based query API page with MkDocs admonitions for notes. |
| docs/api/message_history.rst | Removes Sphinx message history API page. |
| docs/api/message_history.md | Adds mkdocstrings-based message history API page. |
| docs/api/index.md | Replaces Sphinx toctree with MkDocs “cards” API landing page. |
| docs/api/filter.rst | Removes Sphinx filter API page. |
| docs/api/filter.md | Adds mkdocstrings-based filter API page. |
| docs/api/cache.rst | Removes Sphinx cache API page. |
| docs/api/cache.md | Adds mkdocstrings-based cache API page (currently partial coverage). |
| docs/_templates/layout.html | Removes Sphinx template override (GA tag injection). |
| docs/_static/site.webmanifest | Removes Sphinx static manifest. |
| docs/_static/Redis_Logo_Red_RGB.svg | Removes Sphinx static Redis logo asset. |
| docs/_static/gallery.yaml | Removes Sphinx gallery data source. |
| docs/_static/css/custom.css | Removes Sphinx custom CSS. |
| docs/_extension/gallery_directive.py | Removes custom Sphinx gallery directive implementation. |
| AGENTS.md | Adds usage-oriented quick reference for AI agents consuming redisvl. |
| .readthedocs.yaml | Switches RTD build configuration from Sphinx to MkDocs. |
| .gitignore | Replaces Sphinx build output ignore with MkDocs cache ignore (needs site/ ignore as well). |
Comments suppressed due to low confidence (3)
docs/user_guide/how_to_guides/mcp.md:167
- This guide’s frontmatter/intro says it shows how to use the MCP tools, but the page now stops after the config explanation and no longer documents the
search-records/upsert-recordstool contracts (args, request/response shapes) or troubleshooting/examples that previously existed. That’s a behavioral/content regression and also contradicts the PR description’s “like-for-like content port”; either restore those sections here or link clearly to the page that now contains them.
docs/api/cache.md:28 - The page description mentions the embeddings cache and schema classes, but the content only renders
SemanticCache,LangCacheSemanticCache, andCacheEntry.EmbeddingsCacheandCacheHit(which were part of the prior API reference) are missing, so the API reference is now incomplete/misleading. Add the missing mkdocstrings directives (or adjust the page description/scope).
---
description: Semantic cache, embeddings cache, and LangCache integrations for RedisVL.
---
# Cache
## SemanticCache
::: redisvl.extensions.cache.llm.SemanticCache
options:
show_root_heading: true
inherited_members: true
## LangCacheSemanticCache
::: redisvl.extensions.cache.llm.LangCacheSemanticCache
options:
show_root_heading: true
inherited_members: true
## Cache Schema Classes
### CacheEntry
::: redisvl.extensions.cache.llm.schema.CacheEntry
options:
show_root_heading: true
docs/examples/index.md:24
- This migration removes the Sphinx “Demo Applications” gallery (previously generated via the
gallery-griddirective +docs/_static/gallery.yaml) without adding an equivalent mkdocs representation. That’s a notable content drop and conflicts with the PR description’s “like-for-like content port”; consider porting the demo-app list to a mkdocs-friendly format (table/list) so the same information remains available.
💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.
| /* Redis brand tokens and Material theme overrides for the redisvl docs. | ||
| * Mirrors the redis-docs tailwind palette (Redis red #FF4438, Redis ink | ||
| * #091A23) and self-hosts the Space Grotesk + Space Mono pairing used on | ||
| * redis.io. | ||
| */ | ||
| @import url("https://fonts.googleapis.com/css2?family=Space+Grotesk:wght@400;500;600;700&family=Space+Mono:wght@400;700&display=swap"); | ||
|
|
| # API Reference | ||
|
|
||
| Reference documentation for the RedisVL API. | ||
| Reference documentation for the public RedisVL API. Each class and function is generated from the docstrings in the source. | ||
|
|
||
| ```{toctree} | ||
| :caption: RedisVL API | ||
| :maxdepth: 2 | ||
| <div class="grid cards" markdown> | ||
|
|
||
| schema | ||
| searchindex | ||
| vector | ||
| query | ||
| filter | ||
| vectorizer | ||
| reranker | ||
| cache | ||
| message_history | ||
| router | ||
| cli | ||
| ``` | ||
| - :material-file-tree:{ .lg .middle } **[Schema](schema.md)** | ||
|
|
||
| --- | ||
|
|
||
| Define the structure of an index: fields, types, attributes, and storage. | ||
|
|
||
| - :material-database-search:{ .lg .middle } **[Search Index](searchindex.md)** | ||
|
|
||
| --- | ||
|
|
||
| Create, manage, load, and search indexes. Sync and async variants. | ||
|
|
||
| - :material-vector-square:{ .lg .middle } **[Vector](vector.md)** | ||
|
|
||
| --- | ||
|
|
||
| `Vector` containers for multi-vector queries. | ||
|
|
||
| - :material-magnify:{ .lg .middle } **[Query](query.md)** | ||
|
|
||
| --- | ||
|
|
||
| Vector, range, hybrid, text, filter, count, multi-vector, and SQL query builders. | ||
|
|
||
| - :material-filter:{ .lg .middle } **[Filter](filter.md)** | ||
|
|
||
| --- | ||
|
|
||
| Tag, text, numeric, geo, and geo-radius filter expressions. | ||
|
|
||
| - :material-tools:{ .lg .middle } **[Vectorizer](vectorizer.md)** | ||
|
|
||
| --- | ||
|
|
||
| Embedding providers: OpenAI, Cohere, HuggingFace, Vertex, Bedrock, Mistral, VoyageAI. | ||
|
|
||
| - :material-sort:{ .lg .middle } **[Reranker](reranker.md)** | ||
|
|
||
| --- | ||
|
|
||
| Cross-encoder rerankers from Cohere, HuggingFace, and VoyageAI. | ||
|
|
||
| - :material-cached:{ .lg .middle } **[Cache](cache.md)** | ||
|
|
||
| --- | ||
|
|
||
| Semantic cache, embeddings cache, and LangCache integrations. | ||
|
|
||
| - :material-message-text:{ .lg .middle } **[Message History](message_history.md)** | ||
|
|
||
| --- | ||
|
|
||
| Persistent chat history with recency or semantic retrieval. | ||
|
|
||
| - :material-source-branch:{ .lg .middle } **[Router](router.md)** | ||
|
|
||
| --- | ||
|
|
||
| Semantic routing for intent detection and query classification. | ||
|
|
||
| </div> |
Fix the 29 griffe diagnostics that the build was previously silencing via scripts/mkdocs_hooks.py so that mkdocs build --strict passes on unmodified source. Source-level docstring fixes: * redisvl/extensions/cache/llm/semantic.py: remove stray space in filter_expression type annotations; add missing colons in the Raises blocks for update / aupdate. * redisvl/extensions/cache/llm/langcache.py: type the **kwargs documentation on update / aupdate. * redisvl/extensions/message_history/semantic_history.py: fix the hanging continuation line in the as_text Args entry. * redisvl/extensions/router/semantic.py: align Args names with the function signatures (route_name, reference_ids, keys) on add_route_references / get_route_references / delete_route_references and clean up malformed Optional() syntax. * redisvl/query/query.py: type *fields, drop the bogus self return name, add a BaseQuery return annotation on return_fields, and rename text_weights to weights in set_text_weights to match the signature. * redisvl/index/index.py: add BaseSearchIndex return annotations to from_yaml and from_dict so griffe stops flagging the Returns block. * redisvl/utils/vectorize/base.py: type the **kwargs documentation on embed / embed_many / aembed / aembed_many and add a Generator[list, None, None] return annotation on batchify. * redisvl/utils/vectorize/text/huggingface.py: type the **kwargs documentation on __init__. Build pipeline: * Drop scripts/mkdocs_hooks.py and the matching hooks: entry from mkdocs.yml. mkdocs build --strict now exits 0 with zero griffe warnings. * Add .github/workflows/docs.yml to run mkdocs build --strict on every PR that touches docs, mkdocs config, source, or this workflow, and on every push to main. Uploads the rendered site as a build artifact for review. Verified locally with mkdocs build --strict (clean) and mypy on the edited modules (clean).
| name: mkdocs build --strict | ||
| runs-on: ubuntu-latest | ||
| steps: | ||
| - name: Check out repository | ||
| uses: actions/checkout@v6 | ||
| with: | ||
| fetch-depth: 0 | ||
|
|
||
| - name: Install Python | ||
| uses: actions/setup-python@v6 | ||
| with: | ||
| python-version: "3.11" | ||
|
|
||
| - name: Install uv | ||
| uses: astral-sh/setup-uv@v6 | ||
| with: | ||
| version: ${{ env.UV_VERSION }} | ||
| enable-cache: true | ||
| python-version: "3.11" | ||
| cache-dependency-glob: | | ||
| pyproject.toml | ||
| uv.lock | ||
|
|
||
| - name: Install docs dependencies | ||
| run: uv sync --frozen --group docs | ||
|
|
||
| - name: Build docs (strict) | ||
| env: | ||
| DISABLE_MKDOCS_2_WARNING: "true" | ||
| run: uv run mkdocs build --strict | ||
|
|
||
| - name: Upload built site | ||
| if: always() | ||
| uses: actions/upload-artifact@v4 | ||
| with: | ||
| name: site | ||
| path: site/ | ||
| retention-days: 7 |
There was a problem hiding this comment.
Cursor Bugbot has reviewed your changes and found 1 potential issue.
❌ Bugbot Autofix is OFF. To automatically fix reported issues with cloud agents, have a team admin enable autofix in the Cursor dashboard.
Reviewed by Cursor Bugbot for commit fd93955. Configure here.
|
|
||
| @classmethod | ||
| def from_yaml(cls, schema_path: str, **kwargs): | ||
| def from_yaml(cls, schema_path: str, **kwargs) -> "BaseSearchIndex": |
There was a problem hiding this comment.
Classmethod return type loses subclass type information
Medium Severity
The new -> "BaseSearchIndex" return annotation on from_yaml and from_dict classmethods is incorrect for inherited classmethods that return cls(...). When called as SearchIndex.from_yaml(...), type checkers will infer the result as BaseSearchIndex, hiding subclass-specific methods like create, query, load, and delete. The codebase already imports Self from typing_extensions in redisvl/query/aggregate.py — that's the correct annotation here. The same issue applies to return_fields returning "BaseQuery" instead of Self, which breaks typed method chaining on subclasses like VectorQuery.
Additional Locations (2)
Reviewed by Cursor Bugbot for commit fd93955. Configure here.
There was a problem hiding this comment.
Pull request overview
Copilot reviewed 62 out of 73 changed files in this pull request and generated 5 comments.
Comments suppressed due to low confidence (1)
redisvl/extensions/router/semantic.py:783
- The
Returns:line has an extra closing bracket (List[Dict[str, Any]]]: ...). This looks like a typo and can confuse readers/tools parsing the docstring. Remove the extra]so the return type renders cleanly.
| route_name: str = "", | ||
| reference_ids: list[str] = [], | ||
| keys: list[str] = [], | ||
| ) -> list[dict[str, Any]]: | ||
| """Get references for an existing route route. |
| route_name: str = "", | ||
| reference_ids: list[str] = [], | ||
| keys: list[str] = [], | ||
| ) -> int: | ||
| """Get references for an existing semantic router route. |
| --- | ||
| description: Semantic cache, embeddings cache, and LangCache integrations for RedisVL. | ||
| --- | ||
|
|
||
| # Cache |
| * Mirrors the redis-docs tailwind palette (Redis red #FF4438, Redis ink | ||
| * #091A23) and self-hosts the Space Grotesk + Space Mono pairing used on | ||
| * redis.io. | ||
| */ | ||
| @import url("https://fonts.googleapis.com/css2?family=Space+Grotesk:wght@400;500;600;700&family=Space+Mono:wght@400;700&display=swap"); |
| def return_fields( | ||
| self, *fields, skip_decode: str | list[str] | None = None | ||
| ) -> "BaseQuery": |
|
@tylerhutcherson have you given any more thought to migrating the docs to redis.io/docs/ entirely? |


Summary
Migrate the documentation pipeline from Sphinx to mkdocs material so the
public site renders with the same visual language used by sql-redis,
loads faster, and exposes a cleaner Python API surface generated by
mkdocstrings + griffe.
What changed
Documentation toolchain
docs/_extension/,docs/_static/,docs/_templates/,docs/conf.py,docs/Makefile,docs/make.batSphinx tree and every.rstsource file.mkdocs.ymlplus a Material-themed site underdocs/rooted atdocs/index.mdwith the Redis Vector Library hero, navigation tree,branded color palette (Redis red, Space Grotesk / Space Mono), and a
full mkdocstrings-driven API reference under
docs/api/.field-attributes, mcp, and utilities concept pages from Sphinx-flavored
myst to plain Markdown.
docs/user_guide/*.ipynb) intothe site via
mkdocs-jupyterand adddocs/user_guide/index.mdplus aninstallation page.
docs/for-ais-only/(repositorymap, build/test, public API surface, codebase tour) and a top-level
AGENTS.mdentry point. The site emitsllms.txt/llms-full.txtvia
mkdocs-llmstxt.docs/stylesheets/redis-brand.cssplusdocs/assets/(favicon, hero logo in Redis red, architecturediagram).
Build pipeline
.readthedocs.yamlwith amkdocs:blockand switch the build to
uv sync --frozen --group docs.Makefilesomake docs-buildandmake docs-serveinvokemkdocsinstead ofsphinx-build/sphinx-autobuild.[dependency-groups].docsblock inpyproject.tomlpinning
mkdocs,mkdocs-material,mkdocs-jupyter,mkdocs-autorefs,mkdocs-llmstxt,mkdocs-redirects,mkdocs-section-index,mkdocs-git-revision-date-localized-plugin,and
mkdocstrings[python]. Lockfile refreshed.site/output via.gitignore.CI
.github/workflows/docs.ymlrunsmkdocs build --stricton everyPR that touches
docs/,mkdocs.yml,redisvl/**/*.py,pyproject.toml,uv.lock,.readthedocs.yaml, or the workflow itself, and on everypush to
main. The job uploads the rendered site as an artifact soreviewers can inspect rendered output.
Source docstring cleanup
Fix the 29 griffe diagnostics that were previously suppressed by a
custom hook so the build passes strict mode without any
warning-silencing scaffolding:
redisvl/extensions/cache/llm/semantic.py: tightenfilter_expressionannotations and add missing colons inRaises:on
update/aupdate.redisvl/extensions/cache/llm/langcache.py: type the**kwargsdocumentation on
update/aupdate.redisvl/extensions/message_history/semantic_history.py: fix thehanging continuation line in the
as_textArgs entry.redisvl/extensions/router/semantic.py: align Args names with thefunction signatures (
route_name,reference_ids,keys) onadd_route_references/get_route_references/delete_route_referencesand clean up malformedOptional()syntax.
redisvl/query/query.py: type*fields, drop the bogusselfreturn name, add a
BaseQueryreturn annotation onreturn_fields,and rename
text_weightstoweightsinset_text_weightstomatch the signature.
redisvl/index/index.py: addBaseSearchIndexreturn annotationsto
from_yamlandfrom_dict.redisvl/utils/vectorize/base.py: type the**kwargsdocumentationon
embed/embed_many/aembed/aembed_manyand add aGenerator[list, None, None]return annotation onbatchify.redisvl/utils/vectorize/text/huggingface.py: type the**kwargsdocumentation on
__init__.With those fixes in place,
scripts/mkdocs_hooks.pyand thematching
hooks:line inmkdocs.ymlare removed.Verification
uv sync --frozen --group docsDISABLE_MKDOCS_2_WARNING=true uv run mkdocs build --strictexits 0with zero griffe warnings.
uv run mkdocs serverenders the hero, navigation, API reference,and embedded notebooks correctly.
uv run mypy redisvl/index/index.py redisvl/query/query.py redisvl/utils/vectorize/base.pyis clean after the new return annotations.
Follow-ups (out of scope here)
mainonce this lands andconfirm
docs.redisvl.com(CNAME →redisvl.readthedocs.io)publishes the new site.
Note
Medium Risk
Medium risk because it replaces the docs toolchain and publishing/CI pipeline (MkDocs + new RTD config + strict build checks), which could break doc builds or navigation despite minimal impact on runtime code.
Overview
Migrates the documentation system from Sphinx/RST to MkDocs Material with a new
mkdocs.ymlsite config, refreshed navigation/landing pages, and mkdocstrings-based API reference pages underdocs/api/.Updates the build/publish pipeline to match: adds a
DocsGitHub Action that runsmkdocs build --strictand uploads the renderedsite/artifact, switches ReadTheDocs to MkDocs, and changesmake docs-build/make docs-serveto usemkdocs.Removes Sphinx-only assets/config (
docs/conf.py,docs/Makefile, templates/static,.rstfiles) and adds Redis-branded MkDocs styling/assets plus new agent-focused docs (AGENTS.md,docs/for-ais-only/*), while making small docstring/type-hint tweaks across a few Python modules to satisfy strict mkdocstrings/griffe rendering.Reviewed by Cursor Bugbot for commit fd93955. Bugbot is set up for automated code reviews on this repo. Configure here.