feat: Redis knowledge backend via hook registry - #434
Closed
esafwan wants to merge 3 commits into
Closed
Conversation
…ds hook Supersedes #235. Direct KnowledgeBackend implementation on redisvl (SearchIndex + VectorQuery + Tag filters) instead of a LlamaIndex adapter: llama-index-vector-stores-redis 0.4.0 pins llama-index-core <0.13 and redisvl <0.4, and redisvl 0.3.x is broken on Python 3.14 (pydantic v1 shim), making the wrapper unusable on Frappe 16. - Registered through huf's own huf_knowledge_backends hook (dogfoods the registry); not a built-in - Connection settings via advanced_config schema (redis_host, redis_port, redis_username, redis_password, redis_index_prefix) per the contract - Site + source tag scoping on metadata, search filters and deletes - Embeddings always HUF-side; float32-byte vectors; cosine/flat index - 21 mocked unit tests + live E2E against Redis 8.8 (RediSearch)
This was referenced Jul 25, 2026
Add Redis as a knowledge backend option alongside pgvector: - knowledgeTypes, VECTOR_KNOWLEDGE_TYPES and knowledgeTypeLabels - KnowledgeType union and zod form schema enum - Redis Connection Settings card in GeneralTab that renders the schema-driven AdvancedConfigFields (redis has no first-class DocType fields; connection settings come from the backend's get_advanced_config_schema)
This was referenced Jul 26, 2026
Contributor
Author
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
feat: Redis knowledge backend (hook-registered, contract-compliant)
Adds Redis (RediSearch) as a knowledge backend, registered through the
huf_knowledge_backendshook introduced in #406 — huf dogfoods its own registry. Supersedes #235, which was written against the pre-#280 architecture (hand-rolled 381-line backend, hardcoded registry dict, first-class DocType fields).Design
KnowledgeBackendimplementation on redisvl (the contract's "direct implementation" path, likesqlite_vec) — not a LlamaIndex adapter.llama-index-vector-stores-redis0.4.0 pinsllama-index-core<0.13(env needs 0.14.x for chroma/pgvector stores) andredisvl<0.4, which is broken on Python 3.14 (pydantic v1 shim crash), so the wrapper is unusable on Frappe 16.huf/hooks.py:huf_knowledge_backends = {"redis": "huf.ai.knowledge.backends.redis_backend.RedisBackend"}. Not a built-in; proves external-app registration works.advanced_configschema (redis_host,redis_port,redis_username,redis_password,redis_index_prefix) per the backend contract — no first-class DocType fields.site_name+knowledge_sourcetags on metadata, search filters, and deletes — safe on a shared Redis server.VectorQuery+Tagfilter expressions.Testing (bench
16_kbreg, Frappe 16.27, Python 3.14, Redis 8.8.1)get_advanced_config_schemawhitelisted API round-tripruff check/ruff formatDependencies
pyproject.toml:redisvl>=0.5(replaces the wrapper).