Skip to content

feat(cognee): add Cognee + Valkey cookbook and sample code - #75

Closed
atao2004 wants to merge 1 commit into
mainfrom
cookbook-cognee-revamp
Closed

atao2004 wants to merge 1 commit into
mainfrom
cookbook-cognee-revamp

Conversation

@atao2004

@atao2004 atao2004 commented Aug 4, 2026

Copy link
Copy Markdown

Summary

Migrates the archived Cognee + Valkey cookbook (PR #15, archive/main-pre-reorg branch) to the current CONTRIBUTING.md cookbook structure.

Upstream integration: topoteretes/cognee-community#46 (merged, released on PyPI as cognee-community-vector-adapter-valkey==0.1.3).

Changes from the archived version

  • Vendor neutrality: default LLM/embedding provider flipped from AWS Bedrock to Ollama (local, free, no account needed). OpenAI and Bedrock are now clearly labeled, collapsed <details> alternatives with AWS affiliation disclosed.
  • Pinned valkey/valkey-bundle:latest → 9.1.0.
  • 03-production.md reworked from an ElastiCache-only deployment guide into generic production patterns (TLS, HNSW tuning, monitoring, error handling), with both AWS (ElastiCache/MemoryDB) and Google Cloud (Memorystore for Valkey) named as examples alongside generic managed-provider guidance.
  • Added sample/docker-compose.yml and a CI-friendly test suite (test_valkey_adapter.py) — neither existed in the archive. The test suite exercises the Valkey vector adapter directly with a deterministic stub embedder, so it needs no LLM or Ollama to run in CI.
  • Added sample/common.py to share the Ollama/Cognee bootstrap config across the three sample scripts (previously would have been triplicated).
  • Dropped meta.json — not part of the current cookbook structure.

Validation

  • Full add → cognify → search pipeline run end-to-end against valkey-bundle:9.1.0 + local Ollama (qwen2.5:7b + nomic-embed-text) — smaller models (llama3.2:1b/3b) were tried first and found unreliable for Cognee's structured-output requirements; documented in the cookbook.
  • test_valkey_adapter.py (6 tests) passing in a clean-room venv against requirements.txt exactly as written, plus the actual docker-compose.yml.
  • markdownlint-cli2: 0 errors. ruff check: clean.
  • Went through a full internal QA review pass (spec-compliance, DRY, security, anti-pattern, link-integrity) — findings fixed: missing ## Step N headings in 02, missing How It Works/Configuration Reference tables in 01, single-vendor cloud guidance in 03, duplicated config extracted to common.py, and an incorrect safe_search return type annotation.

Pre-Submit Checklist

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

Known follow-up (not addressed in this PR)

cookbook-python.yml's dorny/paths-filter filter list doesn't include the workflow file path itself, even though the top-level trigger does — meaning a PR that only edits this CI file wouldn't exercise the jobs it configures. Left as-is since this file is the documented temporary-copy pattern pending PR #45's shared Python workflow, which is expected to supersede it.

Migrate the archived Cognee + Valkey cookbook (PR #15) to the current
CONTRIBUTING.md structure: Ollama as the vendor-neutral default LLM and
embedding provider (OpenAI/Bedrock as labeled alternatives), Valkey
Bundle pinned to 9.1.0, generic multi-cloud production guidance, and a
CI-friendly test suite that exercises the Valkey vector adapter directly
with a deterministic stub embedder (no LLM required).

Co-Authored-By: Claude Sonnet 5 <noreply@anthropic.com>
Signed-off-by: Anna Tao <annatao2004@gmail.com>
@jbrinkman jbrinkman added the Cookbook Cookbooks are tutorials with runnable code that highlights how to use Valkey in specific scenarios label Aug 12, 2026
@jbrinkman

Copy link
Copy Markdown
Collaborator

Closing this draft PR as part of a cookbook program cleanup.

@jbrinkman jbrinkman closed this Aug 17, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

Cookbook Cookbooks are tutorials with runnable code that highlights how to use Valkey in specific scenarios

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants