Skip to content

Feat/add valkey search#5005

Closed
MutshidziPhaswana wants to merge 7 commits into
agno-agi:mainfrom
MutshidziPhaswana:feat/Add-Valkey-Search
Closed

Feat/add valkey search#5005
MutshidziPhaswana wants to merge 7 commits into
agno-agi:mainfrom
MutshidziPhaswana:feat/Add-Valkey-Search

Conversation

@MutshidziPhaswana

Copy link
Copy Markdown

Summary

Describe key changes, mention related issues or motivation for the changes.

Type of change

This pull request introduces comprehensive support for Valkey Search, a Redis-compatible vector search engine, to the Agno framework. It adds new documentation, example code, and setup scripts to make it easy for developers to use Valkey Search as a vector database backend for knowledge-powered AI agents. The changes include updates to the README, a new example in the cookbook, Docker Compose configuration for Valkey, and integration of Valkey Search into the development setup and Python package imports.

Valkey Search Integration

  • Added a new example directory cookbook/knowledge/vector_db/valkey_db/ with a detailed README.md, example code (valkey_db.py), and Docker Compose configuration to demonstrate Valkey Search integration with Agno, including PDF content loading, vector search, and agent-based querying.

Development Environment & Package Integration

  • Updated scripts/dev_setup.sh to install the valkey Python package as part of the development setup, ensuring all dependencies for Valkey Search are included.
  • Added import stubs for Valkey Search in both the cookbook (cookbook/knowledge/vector_db/valkey_db/__init__.py) and the main library (libs/agno/agno/vectordb/valkey/__init__.py) for cleaner imports and module exposure.
  • Bug fix
  • New feature
  • Breaking change
  • Improvement
  • Model update
  • Other:

Checklist

  • Code complies with style guidelines
  • Ran format/validation scripts (./scripts/format.sh and ./scripts/validate.sh)
  • Self-review completed
  • Documentation updated (comments, docstrings)
  • Examples and guides: Relevant cookbook examples have been included or updated (if applicable)
  • Tested in clean environment
  • Tests added/updated (if applicable)

Additional Notes

Add any important context (deployment instructions, screenshots, security considerations, etc.)

- Implemented Valkey Search as a vector database example in Agno.
- Created Docker Compose configuration for Valkey service.
- Developed core functionality for document insertion, searching, and metadata management.
- Included examples demonstrating basic usage, async operations, knowledge system integration, and advanced search features.
- Established JSON structure for knowledge contents and integrated with the Valkey database.
@MutshidziPhaswana
MutshidziPhaswana requested a review from a team as a code owner October 12, 2025 08:34

def _bytes_to_vector(self, data: bytes) -> List[float]:
"""Convert bytes back to vector."""
import struct

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

question: why do we need to import this thing on every function call?

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

It will only be imported once in reality, at runtime.

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Sorry, my bad - yes, import will be only once. Any reason not to do this import at module level?

@stockholmux

Copy link
Copy Markdown

Really great to see this. Once merged, it would make a good blog post on Valkey.io where we can explain how to use it with Agno, etc.

https://github.com/valkey-io/valkey-io.github.io/issues/new?template=blog_post_template.md

@harshsinha03

Copy link
Copy Markdown
Contributor

Thanks for this, @MutshidziPhaswana really appreciate the contribution. This overlaps with #8141, which adds Valkey vector search support. We're consolidating there and closing this to avoid duplication.

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

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

5 participants