-
Notifications
You must be signed in to change notification settings - Fork 75
feat(migrator): [6/7] CLI commands and documentation with rvl migrate subcommand, user guide, and concept docs #565
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Open
nkanu17
wants to merge
5
commits into
feat/migrate-wizard
Choose a base branch
from
feat/migrate-cli-docs
base: feat/migrate-wizard
Could not load branches
Branch not found: {{ refName }}
Loading
Could not load tags
Nothing to show
Loading
Are you sure you want to change the base?
Some commits from the old base branch may be removed from the timeline,
and old review comments may become outdated.
+4,164
−17
Open
Changes from all commits
Commits
Show all changes
5 commits
Select commit
Hold shift + click to select a range
b3d4fee
feat(migrate): [6/7] add CLI commands and documentation with rvl migr…
nkanu17 2986e6e
fix: CLI bug fixes and improvements (#565)
nkanu17 63e85dc
fix: add explanatory comments for local imports in CLI (#565)
nkanu17 46a8a04
chore: add rvl migrate CLI docs + progress callback dedup + migrate-i…
nkanu17 a1d54c9
fix: address review round 3 for migrate-cli-docs (#565)
nkanu17 File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
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
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
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,165 @@ | ||
| # AGENTS.md - RedisVL Project Context | ||
|
|
||
| ## Frequently Used Commands | ||
|
|
||
| ```bash | ||
| # Development workflow | ||
| make install # Install dependencies | ||
| make format # Format code (black + isort) | ||
| make check-types # Run mypy type checking | ||
| make lint # Run all linting (format + types) | ||
| make test # Run tests (no external APIs) | ||
| make test-all # Run all tests (includes API tests) | ||
| make check # Full check (lint + test) | ||
|
|
||
| # Redis setup | ||
| make redis-start # Start Redis container | ||
| make redis-stop # Stop Redis container | ||
|
|
||
| # Documentation | ||
| make docs-build # Build documentation | ||
| make docs-serve # Serve docs locally | ||
| ``` | ||
|
|
||
| Pre-commit hooks are also configured, which you should | ||
| run before you commit: | ||
| ```bash | ||
| pre-commit run --all-files | ||
| ``` | ||
|
|
||
| ## Important Architectural Patterns | ||
|
|
||
| ### Async/Sync Dual Interfaces | ||
| - Most core classes have both sync and async versions (e.g., `SearchIndex` / `AsyncSearchIndex`) | ||
| - Follow existing patterns when adding new functionality | ||
|
|
||
| ### Schema-Driven Design | ||
| ```python | ||
| # Index schemas define structure | ||
| schema = IndexSchema.from_yaml("schema.yaml") | ||
| index = SearchIndex(schema, redis_url="redis://localhost:6379") | ||
| ``` | ||
|
|
||
| ## Critical Rules | ||
|
|
||
| ### Do Not Modify | ||
| - **CRITICAL**: Do not change this line unless explicitly asked: | ||
| ```python | ||
| token.strip().strip(",").replace(""", "").replace(""", "").lower() | ||
nkanu17 marked this conversation as resolved.
Show resolved
Hide resolved
|
||
| ``` | ||
|
|
||
| ### Git Operations | ||
| **CRITICAL**: NEVER use `git push` or attempt to push to remote repositories. The user will handle all git push operations. | ||
|
|
||
| ### Branch and Commit Policy | ||
| **IMPORTANT**: Use conventional branch names and conventional commits. | ||
|
|
||
| Branch naming: | ||
| - Human-created branches should use `<type>/<short-kebab-description>` | ||
| - Automation-created branches may use `codex/<type>/<short-kebab-description>` | ||
| - Preferred branch types: `feat`, `fix`, `docs`, `refactor`, `test`, `chore`, `perf`, `build`, `ci` | ||
| - Examples: | ||
| - `feat/index-migrator` | ||
| - `fix/async-sentinel-pool` | ||
| - `docs/index-migrator-benchmarking` | ||
| - `codex/feat/index-migrator` | ||
|
|
||
| Commit messages: | ||
| - Use Conventional Commits: `<type>(optional-scope): <summary>` | ||
| - Preferred commit types: `feat`, `fix`, `docs`, `refactor`, `test`, `chore`, `perf`, `build`, `ci` | ||
| - Examples: | ||
| - `feat(migrate): add drop recreate planning docs` | ||
| - `docs(index-migrator): add benchmarking guidance` | ||
| - `fix(cli): validate migrate plan inputs` | ||
|
|
||
| ### Code Quality | ||
| **IMPORTANT**: Always run `make format` before committing code to ensure proper formatting and linting compliance. | ||
|
|
||
| ### README.md Maintenance | ||
| **IMPORTANT**: DO NOT modify README.md unless explicitly requested. | ||
|
|
||
| **If you need to document something, use these alternatives:** | ||
| - Development info → CONTRIBUTING.md | ||
| - API details → docs/ directory | ||
| - Examples → docs/examples/ | ||
| - Project memory (explicit preferences, directives, etc.) → AGENTS.md | ||
|
|
||
| ## Code Style Preferences | ||
|
|
||
| ### Import Organization | ||
| - **Prefer module-level imports** by default for clarity and standard Python conventions | ||
| - **Use local/inline imports only when necessary** for specific reasons: | ||
| - Avoiding circular import dependencies | ||
| - Improving startup time for heavy/optional dependencies | ||
| - Lazy loading for performance-critical paths | ||
| - When using local imports, add a brief comment explaining why (e.g., `# Local import to avoid circular dependency`) | ||
|
|
||
| ### Comments and Output | ||
| - **No emojis in code comments or print statements** | ||
| - Keep comments professional and focused on technical clarity | ||
| - Use emojis sparingly only in user-facing documentation (markdown files), not in Python code | ||
|
|
||
| ### General Guidelines | ||
| - Follow existing patterns in the RedisVL codebase | ||
| - Maintain consistency with the project's established conventions | ||
| - Run `make format` before committing to ensure code quality standards | ||
|
|
||
| ## Testing Notes | ||
| RedisVL uses `pytest` with `testcontainers` for testing. | ||
|
|
||
| - `make test` - unit tests only (no external APIs) | ||
| - `make test-all` - run the full suite, including tests that call external APIs | ||
| - `pytest --run-api-tests` - explicitly run API-dependent tests (e.g., LangCache, | ||
| external vectorizer/reranker providers). These require the appropriate API | ||
| keys and environment variables to be set. | ||
|
|
||
| ## Project Structure | ||
|
|
||
| ``` | ||
| redisvl/ | ||
| ├── cli/ # Command-line interface (rvl command) | ||
| ├── extensions/ # AI extensions (cache, memory, routing) | ||
| │ ├── cache/ # Semantic caching for LLMs | ||
| │ ├── llmcache/ # LLM-specific caching | ||
| │ ├── message_history/ # Chat history management | ||
| │ ├── router/ # Semantic routing | ||
| │ └── session_manager/ # Session management | ||
| ├── index/ # SearchIndex classes (sync/async) | ||
| ├── query/ # Query builders (Vector, Range, Filter, Count) | ||
| ├── redis/ # Redis client utilities | ||
| ├── schema/ # Index schema definitions | ||
| └── utils/ # Utilities (vectorizers, rerankers, optimization) | ||
| ├── rerank/ # Result reranking | ||
| └── vectorize/ # Embedding providers integration | ||
| ``` | ||
|
|
||
| ## Core Components | ||
|
|
||
| ### 1. Index Management | ||
| - `SearchIndex` / `AsyncSearchIndex` - Main interface for Redis vector indices | ||
| - `IndexSchema` - Define index structure with fields (text, tags, vectors, etc.) | ||
| - Support for JSON and Hash storage types | ||
|
|
||
| ### 2. Query System | ||
| - `VectorQuery` - Semantic similarity search | ||
| - `RangeQuery` - Vector search within distance range | ||
| - `FilterQuery` - Metadata filtering and full-text search | ||
| - `CountQuery` - Count matching records | ||
| - Etc. | ||
|
|
||
| ### 3. AI Extensions | ||
| - `SemanticCache` - LLM response caching with semantic similarity | ||
| - `EmbeddingsCache` - Cache for vector embeddings | ||
| - `MessageHistory` - Chat history with recency/relevancy retrieval | ||
| - `SemanticRouter` - Route queries to topics/intents | ||
|
|
||
| ### 4. Vectorizers (Optional Dependencies) | ||
| - OpenAI, Azure OpenAI, Cohere, HuggingFace, Mistral, VoyageAI | ||
| - Custom vectorizer support | ||
| - Batch processing capabilities | ||
|
|
||
| ## Documentation | ||
| - Main docs: https://docs.redisvl.com | ||
| - Built with Sphinx from `docs/` directory | ||
| - Includes API reference and user guides | ||
| - Example notebooks in documentation `docs/user_guide/...` | ||
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
Oops, something went wrong.
Oops, something went wrong.
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.
Uh oh!
There was an error while loading. Please reload this page.