Skip to content

[NEW] Valkey Samples Repository #4276

Open

Description

@jbrinkman

Abstract

This RFC proposes the design, governance model, and contribution framework for a valkey-io/valkey-samples repository. The repository will serve as the official home for cookbook tutorials, focused code samples, and integration patterns that demonstrate Valkey features to developers, operators, and contributors. This document establishes who the repository serves, what content belongs, how contributions are reviewed, and how the repository is structured — addressing the structural and process gaps identified in an initial iteration of the repository.

Motivation

The problem

Valkey is an OSS project with a large and growing community. Valkey is leveraged for a range of caching use-cases like rate-limiter, pub-sub and other within a broader ecosystem of OSS projects that depend on it, which forms the valkey extended OSS community. Many of these projects such as SpringAI and Mem0 embed Valkey as a core component in their application stack. This repository aims to capture some of the ways that Valkey supports the broader OSS ecosystem. This respository will help motivate and reach new contributors to work on the integrations with valkey and encourage them to get involved in expanding Valkey capabilities and support to broader OSS ecosystem.

Valkey is expanding to support new and rapidly emerging uses-cases across the AI stack: from semantic caching and agent memory to prompt routing and KV caching. Valkey and Valkey-Search provide critical functionality at multiple layers of modern AI applications. Unlike core Valkey use-cases for caching which are decades old and have well documented implementation guidance, these new AI and Search use-cases need to establish guidance and implementation material to enable developers to discover, understand and implement these emerging use-cases. For example, Valkey is well suited for the new AI agent memory use-case. However, since this is so nascent, we are seeing developers seek guidance on how to build memory layers to enable coordination between agents.

Valkey users need working, runnable examples that demonstrate how to use Valkey for specific use cases, design patterns, and integrations. Today, no official repository exists that meets this need with consistent quality, vendor neutrality, and community governance.

Why existing functionality is not enough

  • The Valkey documentation site covers reference material (commands, configuration) but not tutorial-style walkthroughs or runnable integration examples.
  • Individual contributor repositories lack official endorsement, discoverability, and consistent quality standards.
  • Blog posts and external tutorials are short-lived point in time snapshots, are not tested in CI, and cannot be community-maintained.
  • Individual upstream project documentation does not addresses internal architectural choices and thus don’t capture how Valkey can be used to solve key use cases or provide guidance on which datastore to pick.

A dedicated, governed samples repository under valkey-io fills the gap between reference documentation and real-world application code.

Design Considerations

Principles

  1. Community-first governance — The Valkey project earned community trust through transparent governance, inclusive decision-making, and rigorous quality. A samples repository under valkey-io carries the project's name and must reflect the same values.
  2. Vendor neutrality — Valkey exists because a community rejected vendor lock-in. All contributions should be vendor-neutral where possible.
  3. Quality over speed — It is better to launch with three excellent, runnable samples than thirty that are inconsistent, broken, or misleading. Getting this right matters more than getting it done fast.
  4. No gatekeeping by complexity — Samples must be accessible. Requiring early-access JDKs, unreleased library branches, or custom build tooling excludes the community members this repository is supposed to serve.
  5. Open design — This design document is an RFC that community members can comment on before implementation begins. The contribution path must be equally open.

Comparison to similar projects

Project Approach Lessons for Valkey
redis/redis-om-spring-demo Per-language demo repos with README and Docker Compose Good self-containment; weak discoverability across languages
apache/kafka/examples Examples directory within main repo Tight coupling to release; heavy contribution barrier
aws-samples Examples directory within main repo Good isolation; poor cross-sample consistency
kubernetes/examples Single curated repo with categories Good discoverability; inconsistent maintenance over time

The proposed approach combines a single curated repository (discoverability) with self-contained directories (isolation) and mandatory CI validation (consistency).

Specification

1. Target Audience

Define the audience explicitly:

Priority Audience Need
Primary Developers already building applications on Valkey Reference patterns for new use cases and open-source integrations that they can leverage
Primary Developers evaluating Valkey for the first time on new-use cases Working examples they can run in under 5 minutes to get started
Secondary Operators and SREs Configuration examples, deployment patterns, migration guides
Secondary Contributors Examples that demonstrate Valkey features they are building or extending, visibility into broader ecosystem where they can contribute

Explicitly out of scope:

  • Internal tooling experiments
  • Content requiring proprietary or unreleased dependencies
  • Marketing or sales collateral

2. Acceptance Criteria for Content

Every sample or cookbook in this repository must meet all of the following criteria:

  1. Buildable from a clean clone — All dependencies must be publicly available and pinned to specific versions. Running the sample requires only documented, publicly available tools.
  2. Runs against standard Valkey — Must work with the current stable Valkey release. No unreleased branches, no unstable Docker tags, no feature flags that aren't in a GA release.
  3. Focused on demonstrating Valkey — The sample demonstrates Valkey features, commands, or patterns. Application scaffolding is minimal and serves to contextualize the Valkey usage.
  4. Uses current stable client libraries — Must use the current stable release of a Valkey client library for its language. Client library choice should be documented with rationale.
  5. Vendor-neutral by default — Examples use generic or widely accessible tools. For LLM examples, use OpenAI or another broadly accessible provider as the default. Vendor-specific deployment variants (AWS ElastiCache, GCP Memorystore, Aiven, etc.) are permitted only as clearly labeled optional sections that cover at least two providers equally, or link out to provider-specific documentation.
  6. Self-documented — Each sample includes a README that explains:
  • What Valkey concept or use case it demonstrates
  • Prerequisites (with versions)
  • Step-by-step instructions to run
  • Expected output
  • Links to relevant Valkey documentation
  1. Tested in CI — The sample is validated by CI on every PR. At minimum: dependencies install, code compiles/lints, and the sample runs to completion against a Valkey instance.

3. Content That Does NOT Belong

The following content types are explicitly excluded:

  • Curated link lists — These belong on the Valkey website or documentation wiki where they can be maintained as living content.
  • Unreproducible builds — If it depends on unreleased software, private artifacts, or early-access tooling, it is not ready.
  • Marketing content — Uncited performance claims, cost comparisons, and promotional language are rejected in review.
  • Single-vendor tutorials — A tutorial that can only be completed with credentials from one specific cloud provider does not belong as the primary path.

4. Contribution Types

The repository organizes content into three categories based on scope and complexity:

Cookbooks are tutorials that combine narrative documentation with runnable code. They walk a reader through a concept step by step, explaining what is happening and why. Cookbooks may document a Valkey use case (e.g., semantic caching, session management) or an integration configuration (e.g., connecting a framework's document store or vector backend to Valkey). Jupyter notebooks are a valid cookbook format, as are standalone scripts paired with a narrative README.

Demos are focused, lightweight applications that demonstrate a single Valkey use case. They are not complete apps — they include only the code necessary to illustrate the use case without unrelated application concerns like authentication, admin panels, or complex UI. A developer should be able to clone a demo, run it, and immediately see the Valkey feature in action.

Sample apps are more complete applications that show how multiple Valkey use cases work together in a single codebase. They may include data loading utilities, administrative functionality, and enough surrounding application code to demonstrate features at scale or across different user scenarios — closer to a production-style integration. Because Valkey-specific code is more isolated within a larger codebase, sample apps must include documentation that highlights where the Valkey-relevant code lives and how to navigate to it. Without this guidance, the educational value of the sample is lost in the surrounding application scaffolding.

4. Repository Structure

valkey-samples/
├── README.md                  # Repository purpose, how to contribute, index of all samples
├── CONTRIBUTING.md            # Quality bar, review process, structure requirements
├── LICENSE                    # Repository license (BSD-3-Clause or Apache-2.0)
├── MAINTAINERS.md             # Current maintainers and areas of responsibility
├── cookbooks/
│   ├── semantic-caching/
│   │   ├── README.md          # What it demonstrates, prerequisites, how to run
│   │   ├── requirements.txt   # Pinned dependencies
│   │   ├── main.py
│   │   └── docker-compose.yml # Valkey instance for local dev
│   ├── session-store/
│   │   ├── README.md
│   │   ├── package.json
│   │   └── index.js
│   ├── haystack-document-store/
│   │   ├── README.md
│   │   ├── requirements.txt
│   │   └── haystack_document_store.ipynb
│   └── ...
├── demos/
│   ├── vector-similarity-search/
│   │   ├── README.md
│   │   ├── requirements.txt
│   │   ├── main.py
│   │   └── docker-compose.yml
│   └── ...
├── samples/
│   ├── ecommerce-catalog/
│   │   ├── README.md
│   │   ├── requirements.txt
│   │   ├── docker-compose.yml
│   │   └── src/
│   └── ...
└── .github/
    ├── ISSUE_TEMPLATE/
    │   ├── new-sample.md
    │   └── bug-report.md
    ├── PULL_REQUEST_TEMPLATE.md
    └── workflows/
        ├── validate-samples.yml    # Build + run every sample
        ├── lint-markdown.yml       # Markdown linting, link checking
        └── label-sync.yml

Key structural decisions:

  • Each directory is self-contained — A sample can be cloned in isolation, its dependencies installed, and it runs independently of other samples.
  • Categorization by content type — Three contribution types as defined in Section 4: cookbooks/, demos/, and samples/.
  • No nested language directories — Language is part of the sample directory name (e.g., cache-aside-python/, cache-aside-java/) to keep the tree flat and discoverable.

5. Governance Model

Maintainers

  • The repository has its own MAINTAINERS.md following the same model as other valkey-io repositories.
  • Initial maintainers are appointed by the TSC. Additional maintainers are nominated through the standard process.
  • Maintainers are responsible for reviewing PRs, enforcing quality standards, and ensuring vendor neutrality.

Contribution workflow

  1. Proposal — For new samples, contributors open an issue using the new-sample template describing what Valkey concept the sample demonstrates, target language, and expected scope.
  2. Approval — A maintainer approves the proposal (or requests changes) before implementation begins. This prevents wasted effort on content that doesn't fit.
  3. Implementation — The contributor submits a PR following CONTRIBUTING.md guidelines.
  4. Review — At least one maintainer reviews for:
  • Adherence to acceptance criteria (Section 2)
  • Vendor neutrality
  • Code quality and documentation completeness
  • CI passing
  1. Merge — Once approved and CI green, the maintainer merges.

Review standards

Every PR review checks for:

  • Builds and runs from clean clone
  • Runs against current stable Valkey Bundle (Valkey-JSON, Valkey-Search and Valkey-Bloom content friendly)
  • No private links, internal references, or local paths
  • No marketing language or uncited claims
  • Vendor-neutral by default
  • README explains concept, prerequisites, and how to run
  • Dependencies pinned to specific versions
  • CI validates the sample

6. CI/CD Requirements

The repository CI must validate:

Check Scope Tooling
Markdown linting All .md files markdownlint
Link checking All URLs in documentation lychee or markdown-link-check
Dependency installation Each sample independently Language-specific (pip, npm, gradle, etc.)
Code linting Each sample Language-specific linters
Sample execution Each sample Run against Valkey Docker container
No broken builds Entire repo GitHub Actions matrix across samples

CI runs on every PR and on a weekly schedule (to catch external dependency breakage).

7. Vendor Neutrality Policy

This section codifies the expectation that content under valkey-io must not favor any single vendor:

  1. Default examples use generic infrastructure — Connection strings use localhost:6379 or environment variables. LLM calls use OpenAI or a provider-agnostic interface.
  2. Cloud provider sections are optional addenda — If a cookbook includes production deployment guidance, it either:
  • Covers at least two cloud providers equally (e.g., ElastiCache AND Memorystore AND self-hosted), or
  • Remains generic and links to provider-specific documentation externally.
  1. SDK choices are community defaults — Use the community Valkey client (valkey-py, valkey-java, etc.) or GLIDE. Do not use vendor-specific SDK wrappers as the primary import.
  2. Disclosure of affiliation — If a sample integrates a product from a specific company, that relationship is disclosed in the README (e.g., "Strands Agents is an Amazon open-source project").
  3. Curated links are balanced — Resource lists include offerings from multiple providers or focus on vendor-neutral resources.

8. Migration Plan for Existing Content

The repository starts from a clean slate — an empty repository with only the foundational governance files (README, CONTRIBUTING, MAINTAINERS, LICENSE, CI workflows). No existing content is grandfathered in.

All content must be submitted as new contributions through the standard contribution workflow defined in Section 5. This ensures:

  • Every piece of content passes through PR review against the acceptance criteria in Section 2
  • Vendor neutrality is enforced from the first line of code
  • No internal references, private links, or unreleased dependencies survive the transition
  • CI validates every sample before it merges
  • The community has visibility into what enters the repository and why

9. Initial Launch Plan

Phase 1: Foundation

  1. Merge this RFC after community discussion
  2. Revert all existing repository content to a clean slate
  3. Create repository structure: CONTRIBUTING.md, MAINTAINERS.md, LICENSE, CI workflows, issue/PR templates

Phase 2: Initial Samples

  1. Submit 3-5 samples through the defined contribution workflow, demonstrating the process works:
  2. Each sample goes through proposal → approval → implementation → review → merge
  3. These initial contributions serve as reference examples for future contributors
  4. Validate that CI infrastructure works end-to-end (Valkey Docker container, linting, sample execution)

Phase 3: Community Growth

  1. Announce the repository and contribution guidelines to the community
  2. Accept community contributions through the defined workflow
  3. Expand coverage based on community demand and Valkey release features

Appendix

References

Activity

  1. added
    enhancement
    on Jul 28, 2026
  2. rlunar commented on Aug 10, 2026

    @rlunar
    Member

    Repeat of issue 2272

    The decision was we don't want a single repo. I disagree with this proposed structure.

  3. madolson commented on Aug 10, 2026

    @madolson
    Member

    Ok, for now, we will allow the creation of this repository. We will re-evaluate it in 6 months, if it isn't working we will archive and fine another location for these samples.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    enhancement

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions