python -m pip install --upgrade pip
pip install redis-context-retriever
Add C:\Users\<user>\AppData\Roaming\Python\Python<version>\Scripts to the PATH variable
ctxctl auth login <keyname> --type admin
Then enter your admin key retrieved from Redis Cloud
cat <<'PY' > models.py
from context_surfaces.context_model import ContextField, ContextModel
class Item(ContextModel):
__redis_key_template__ = "item:{id}"
id: int = ContextField(description="Item ID", is_key_component=True)
title: str = ContextField(description="Title", index="text")
price: float = ContextField(description="Price", index="numeric", sortable=True)
PY
ctxctl surface create --name "My Surface" --models ./models.py --redis-addr "redis.example.com:6379" --redis-password "$REDIS_PASSWORD"
ctxctl agent create --surface-id "<SURFACE_ID>" --name "My Agent"
ctxctl tools list --agent-key "<AGENT_KEY>"
ctxctl tools call search_item_by_text --agent-key "<AGENT_KEY>" --query "coffee"