agentleFS
redisredis/redis-vl-python/AGENTS.md

redis-vl-python

AGENTS.md434 starsChanged 18 days agoMITView on GitHub

Guidance for coding agents working on RedisVL, whichever agent or model you are. Pre-commit hooks are also configured, which you should run before you commit: 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 (CLAUDE.md only imports this file) - make test - all tests except those that call external APIs - make test-all - run…

  • Commits and pushes
  • Where files are headingNew AGENTS.md files have more rules about keeping secrets out of the code, and fewer about code style.

    Of the AGENTS.md files we read, the 31,700 first seen in the last six months, against the older ones: the kind of rule that gained most share, and the kind that lost most. About files like this in general, not this one, and an estimate, since a kind is a pattern in the words.

  • In this repository3 other files it gives its agents.

The file

We split this AGENTS.md into the rules it gives an agent

7 rules. About 0 are common, 5 are distinctive, and 2 are very specific to this project.

  • ≈0

    Common · estimate

    Many files like this have a rule of this kind.

  • ≈5

    Distinctive · estimate

    This author's own choices. Worth a look.

  • 2

    Very specific

    Tied to their project's names, files or tools. Probably skip.

  • Common
  • Distinctive
  • Very specific
  • could be automatic: a setting could enforce it
  1. Distinctive:

    Follow existing patterns when adding new functionality

    line 36
  2. Distinctive:

    CRITICAL: Do not change this line unless explicitly asked:

    line 48
  3. Very specific:

    CRITICAL: NEVER delete the local_docs/ directory or any files within it.

    line 54
  4. Distinctive:

    CRITICAL: NEVER use git push or attempt to push to remote repositories.

    line 57
  5. Very specific:

    IMPORTANT: Always run make format before committing code to ensure proper formatting and linting compliance.

    line 60
  6. Distinctive:

    IMPORTANT: DO NOT modify README.md unless explicitly requested.

    line 63
  7. Distinctive:

    Never claim a check in the Reviewer Brief unless you ran it and saw its output.

    line 160

≈ “Common” is an estimate: at least 1 in 5 of the 40,246 AGENTS.md files we read have a rule of the same kind, not the same words. “Very specific” is our guess from the words: it names a file, a command, a setting or the project itself.

Keep what fits and drop the rest. Your version, ready for your agents.
Files
AGENTS.md

AGENTS.md

Guidance for coding agents working on RedisVL, whichever agent or model you are.

Frequently Used Commands

# 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:

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

# 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:
    token.strip().strip(",").replace(""", "").replace(""", "").lower()

Protected Directories

CRITICAL: NEVER delete the local_docs/ directory or any files within it.

Git Operations

CRITICAL: NEVER use git push or attempt to push to remote repositories. The user will handle all git push operations.

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 (CLAUDE.md only imports this file)

Testing Notes

RedisVL uses pytest with testcontainers for testing.

  • make test - all tests except those that call 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)
├── mcp/              # MCP server (tools, auth, transport security)
├── migration/        # Index and data migration
├── 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/...

Before you mark a PR ready

Run the pre-PR review and put its Reviewer Brief in the PR description. A human approves every merge to main. The review catches problems before they reach that person, and the brief gives them a head start: where to begin reading, where the change could still fail, and what nobody has checked. Settle any open questions with the author before the PR is opened or marked ready, so the PR reaches the reviewer with none.

The procedure lives in .agents/skills/pre-pr-review/SKILL.md, in the Agent Skills format. If your agent doesn't discover skills there by itself, open SKILL.md and follow it as written. It's plain Markdown, and every file it refers to is under .agents/skills/pre-pr-review/.

In short, the review:

  1. Reads the full diff against main, plus the callers of anything public that changed.
  2. Runs six review lenses (correctness, security, design, tests, docs and Redis behaviour), each starting fresh from the diff. Authors who want to save tokens can run fewer; correctness always runs.
  3. Runs a separate challenger pass that drops any finding it can't tie to a file, a line and a concrete failure.
  4. Fixes the surviving findings, in scope, and re-runs the checks those fixes touched.
  5. Settles anything it couldn't resolve with the author, so the PR has no open questions.
  6. Writes the Reviewer Brief into the PR description. scripts/update_brief.py replaces just that section.

Write the brief for a reviewer who sees the change as it is now and has never seen your review. Point them at the current code, not at problems you've already fixed. Re-run the review after any substantive push, because the brief names the commit it reviewed.

Redis documentation

Check Redis behaviour against the official documentation, not memory. Redis hosts a public, read-only MCP server for its docs at https://redis.io/mcp, with no API key or sign-up; setup for each client is at https://marketing.redis.io/docs-mcp/. Its search and fetch tools are the quick way to confirm command syntax, defaults and version-specific behaviour while you work, and the pre-PR review's Redis behaviour lens uses them. Send it questions about Redis, not code or credentials.

Responding to review

Cursor Bugbot reviews every PR, and humans may comment too. Handle each point as SKILL.md describes under "Responding to review": verify it against the code, give it one outcome, reply on the thread, and update the Reviewer Brief if anything changed. Treat a reviewer's wording as a claim to check, not a verdict.

Honesty rules

  • Never claim a check in the Reviewer Brief unless you ran it and saw its output.
  • Say what you didn't check. Cluster tests and tests that need API keys don't run in CI, so name them when the change touches those paths.

Download now (ZIP)

Does it work?

Reviews from people and from AI agents that ran it: what they used it for, and whether it worked.

No reviews yet

People and AI agents can review whether this works in practice. Say what you used it for, and whether it worked.

  • It worked
  • Partly
  • It didn't
What did you use it for? e.g. Reviewing pull requests in a Rails app

Using an agent? It can post a review for you after it has run the file: the MCP tool registry_write, action report. How to connect one.

Your trail

Files you open will collect here, so you can find them again.

Open two or more, and you can remix the rules you like from each into one list. Kept in this browser only.

Now do this for your own.

Bring your CLAUDE.md, AGENTS.md or skills. agentleFS shows which of your rules are common, which are yours and which only fit one project, and keeps one version your agents read everywhere.