Individual skill
django-recommender-search-backend-patterns
Django backend patterns for recommendation services (AWS Personalize, Databricks Model Serving, internal microservices) and OpenSearch-backed search/feed endpoints. Covers fan-out orchestration (asyncio.gather, deadline propagation, partial results, async client reuse), external service protection (timeouts, circuit breakers, jittered retry, bulkheads, rate limits), OpenSearch query patterns (search_after, _source filtering, function_score, aliases, routing, bool.filter), result blending (score normalization, MMR, dedup, cold-start), Redis caching (stampede protection, model-versioned keys, two-tier, negative), resilience (partial-response envelope, stale-on-error, graceful degradation), async (sync_to_async, async ORM, uvicorn, contextvars, disconnect cancellation), and DRF response shape (cursor pagination, ETag, throttling). Use when building, reviewing, or refactoring such a Django backend. Triggers even without explicit "scale" cues. Includes 5 scaffolding templates.
skills/.experimental/django-recommender-search-backend-patterns/SKILL.md
Source commit cf93c57cac89d6fc3e4194686000411567f5caf3
What was checked
- Matches the observed repository HEAD
- Yes
- Scanner rules are current
- Yes
- Repository scan complete
- No
- Skill scan complete
- No
- Observed behavior
- Network or broad shell
- Last checked
- Nov 11, 2026
These are observations at the recorded commit, not a guarantee of safety. Review the source before running it.
Install this skill
Choose an agent in your Stack or copy a command below. Commands fetch the pinned commit and copy only this skill directory. Existing destinations are refused. Copying a command does not install anything.
An install command is unavailable: current rules, complete repository and skill scans, an eligible behavior level and a permitted license are required.
Repository context
- Repository stars (not skill ratings)
- 224
- Repository last updated
- Aug 15, 2026
- License
- MIT
Observed agent integration: codex
- engineering Derived category
- engineering-web Derived category
Files and excerpt
File metadata and permitted, redacted excerpts come from the recorded scan. Source links are pinned to that commit.
Browse files
AGENTS.mddoc · 13,175 bytesSKILL.mdcore · 12,628 bytesSKILL.mdcore · 12,628 bytesSKILL.mdcore · 12,628 bytesassets/templates/_template.mddoc · 2,185 bytesassets/templates/degraded_response.py.templateasset · 6,673 bytesassets/templates/fanout_recommender_service.py.templateasset · 12,081 bytesassets/templates/opensearch_search_view.py.templateasset · 9,896 bytesassets/templates/redis_cache_with_stampede.py.templateasset · 8,295 bytesassets/templates/result_blender.py.templateasset · 9,644 bytesmetadata.jsonasset · 3,026 bytesreferences/_sections.mddoc · 5,040 bytesreferences/api-compression-and-payload-shaping.mddoc · 6,933 bytesreferences/api-cursor-pagination-in-drf.mddoc · 7,137 bytesreferences/api-etag-and-cache-control-headers.mddoc · 6,688 bytesreferences/api-serializer-perf-select-related.mddoc · 6,345 bytesreferences/api-throttle-per-user-and-endpoint.mddoc · 7,070 bytesreferences/async-cancel-on-client-disconnect.mddoc · 6,756 bytesreferences/async-context-vars-for-request-scope.mddoc · 6,408 bytesreferences/async-fire-and-forget-with-create-task.mddoc · 6,446 bytesreferences/async-sync-to-async-orm.mddoc · 6,209 bytesreferences/async-worker-model-uvicorn-vs-gunicorn.mddoc · 5,926 bytesreferences/blend-anonymous-vs-personalized-paths.mddoc · 5,856 bytesreferences/blend-cold-start-fallback.mddoc · 6,352 bytesreferences/blend-dedup-across-sources.mddoc · 5,421 bytesreferences/blend-mmr-for-diversity.mddoc · 5,641 bytesreferences/blend-normalize-scores-across-sources.mddoc · 5,298 bytesreferences/cache-negative-results.mddoc · 6,014 bytesreferences/cache-redis-with-stampede-protection.mddoc · 6,078 bytesreferences/cache-segment-keyed-isolation.mddoc · 5,649 bytesreferences/cache-two-tier-process-and-redis.mddoc · 6,348 bytesreferences/cache-version-on-model-deploy.mddoc · 6,045 bytesreferences/orch-avoid-await-in-loop.mddoc · 3,459 bytesreferences/orch-batch-with-bulk-endpoint.mddoc · 4,630 bytesreferences/orch-bounded-fanout-concurrency.mddoc · 3,870 bytesreferences/orch-no-blocking-in-async-view.mddoc · 3,753 bytesreferences/orch-parallel-fanout-asyncio-gather.mddoc · 3,452 bytesreferences/orch-propagate-request-deadline.mddoc · 4,345 bytesreferences/orch-return-exceptions-on-fanout.mddoc · 3,869 bytesreferences/orch-reuse-async-clients.mddoc · 4,479 bytesreferences/protect-bulkhead-connection-pool.mddoc · 4,675 bytesreferences/protect-circuit-breaker-per-downstream.mddoc · 4,871 bytesreferences/protect-client-side-rate-limit.mddoc · 5,212 bytesreferences/protect-honor-retry-after-header.mddoc · 5,611 bytesreferences/protect-jittered-retry-backoff.mddoc · 4,629 bytesreferences/protect-no-retry-on-4xx.mddoc · 4,789 bytesreferences/protect-per-downstream-timeout-budget.mddoc · 4,335 bytesreferences/resilience-default-ranking-fallback.mddoc · 6,991 bytesreferences/resilience-degrade-search-gracefully.mddoc · 7,496 bytesreferences/resilience-partial-response-envelope.mddoc · 5,987 bytesreferences/resilience-per-source-observability.mddoc · 6,951 bytesreferences/resilience-serve-stale-from-redis.mddoc · 5,866 bytesreferences/search-alias-for-blue-green-reindex.mddoc · 5,591 bytesreferences/search-bool-filter-vs-must.mddoc · 5,567 bytesreferences/search-enable-request-cache.mddoc · 5,466 bytesreferences/search-filter-source-fields.mddoc · 4,845 bytesreferences/search-function-score-for-blending.mddoc · 6,538 bytesreferences/search-shard-aware-routing.mddoc · 4,940 bytesreferences/search-stable-tiebreaker-sort.mddoc · 3,934 bytesreferences/search-use-search-after-not-from.mddoc · 5,397 bytes
Read excerpt
# Experimental Django Recommender + Search Backend Best Practices
Implementation patterns for a Django backend serving mixed-results recommendations (Personalize / Databricks / microservice fan-out) and OpenSearch-backed search/feeds. **48 rules across 8 categories**, ordered by execution lifecycle impact — earlier categories cascade through everything downstream.
This is the *backend* peer of the `react-fetch-cache-patterns` skill. React handles client-side waterfalls and caching; this skill handles server-side fan-out, downstream protection, OpenSearch query design, and ML-blend orchestration.
## When to Apply
- Building or reviewing Django views that fan out to AWS Personalize, Databricks Model Serving, internal microservices, or any ML inference downstream
- Designing OpenSearch query endpoints (search results, infinite feeds, faceted search)
- Implementing a recommendations endpoint that blends multiple ranker outputs
- Investigating "Django backend slow when downstream is degraded" or "Personalize quota exhausted"
- Adding caching, retry, circuit breakers, or rate limiting to outbound calls
- Choosing between sync and async Django views, configuring uvicorn vs gunicorn
- Designing DRF response shapes for paginated feeds, partial results, or degraded paths