django-recommender-search-backend-patterns
Django backend patterns for recommendation services (AWS Personalize, Databricks Model Serving, internal microservices) and OpenSearch-backed search/feed…
от pproenca★ 231 звезда на GitHub
Установить django-recommender-search-backend-patterns в Claude Code и Claude Desktop
Зарегайся, чтобы установить скилл
Создай бесплатный аккаунт, чтобы открыть команду установки и сохранить скилл в библиотеку.
- Открой команду установки в одну строку
- Сохраняй скиллы в синхронизируемую библиотеку
- Уведомления, когда скиллы обновляются
Об этом скилле
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
Rule Categories by Priority
| # | Category | Impact | Prefix | Rules |
|---|---|---|---|---|
| 1 | Fan-out Orchestration | CRITICAL | orch- |
8 |
| 2 | External Service Protection | CRITICAL | protect- |
7 |
| 3 | OpenSearch Query Patterns | CRITICAL | search- |
8 |
| 4 | Result Blending & Personalization | HIGH | blend- |
5 |
| 5 | Caching Strategy | HIGH | cache- |
5 |
| 6 | Resilience & Partial Results | HIGH | resilience- |
5 |
| 7 | Async & Concurrency | MEDIUM-HIGH | async- |
5 |
| 8 | API Response Design | MEDIUM | api- |
5 |
Quick Reference
1. Fan-out Orchestration (CRITICAL)
orch-parallel-fanout-asyncio-gather— Useasyncio.gatherfor independent downstream calls; never await sequentiallyorch-return-exceptions-on-fanout—return_exceptions=Trueso one failure doesn't poison the whole gatherorch-propagate-request-deadline— Pass a deadline through every downstream call to bound whole-request latencyorch-reuse-async-clients— Onehttpx.AsyncClientper downstream at module scope; never per-requestorch-bounded-fanout-concurrency— Cap per-request fan-out withasyncio.Semaphoreto protect the poolorch-no-blocking-in-async-view— Never block the event loop with sync ORM/IO in async viewsorch-avoid-await-in-loop—for item in items: await ...is serial; useasyncio.gatherwith comprehensionorch-batch-with-bulk-endpoint— Bulk endpoint over N parallel calls; DataLoader pattern for batchers
2. External Service Protection (CRITICAL)
protect-per-downstream-timeout-budget— Different timeouts per service matched to each downstream's p99protect-circuit-breaker-per-downstream— One breaker per downstream so failures stay isolatedprotect-jittered-retry-backoff— Full-jitter exponential backoff to prevent thundering-herd recoveryprotect-no-retry-on-4xx— Skip retry on 4xx and non-idempotent failures; distinguish connect vs read errorsprotect-bulkhead-connection-pool— One connection pool per downstream so one slow service doesn't starve othersprotect-client-side-rate-limit— Token bucket toward each downstream to stay under their quotaprotect-honor-retry-after-header— ParseRetry-After(seconds or HTTP-date) on 429/503
3. OpenSearch Query Patterns (CRITICAL)
search-use-search-after-not-from—search_aftercursor instead offrom/sizefor any paginated endpointsearch-filter-source-fields— Restrict_sourceto fields you render; usedocvalue_fieldsfor sortablesearch-bool-filter-vs-must— Non-scoring clauses infilter(cacheable), scoring clauses inmustsearch-function-score-for-blending— Usefunction_scoreto blend personalization signals in-engine- [`search-stable-tiebr
Разрешённые инструменты
Инструменты, которые скиллу разрешено вызывать.
Без ограничений — скилл может использовать любой инструмент.
Вложенные файлы
- AGENTS.md
- assets/templates/_template.md
- assets/templates/degraded_response.py.template
- assets/templates/fanout_recommender_service.py.template
- assets/templates/opensearch_search_view.py.template
- assets/templates/redis_cache_with_stampede.py.template
- assets/templates/result_blender.py.template
- metadata.json
- references/_sections.md
- references/api-compression-and-payload-shaping.md
- references/api-cursor-pagination-in-drf.md
- references/api-etag-and-cache-control-headers.md
- references/api-serializer-perf-select-related.md
- references/api-throttle-per-user-and-endpoint.md
- references/async-cancel-on-client-disconnect.md
- references/async-context-vars-for-request-scope.md
- references/async-fire-and-forget-with-create-task.md
- references/async-sync-to-async-orm.md
- references/async-worker-model-uvicorn-vs-gunicorn.md
- references/blend-anonymous-vs-personalized-paths.md
- references/blend-cold-start-fallback.md
- references/blend-dedup-across-sources.md
- references/blend-mmr-for-diversity.md
- references/blend-normalize-scores-across-sources.md
- references/cache-negative-results.md
- references/cache-redis-with-stampede-protection.md
- references/cache-segment-keyed-isolation.md
- references/cache-two-tier-process-and-redis.md
- references/cache-version-on-model-deploy.md
- references/orch-avoid-await-in-loop.md
- references/orch-batch-with-bulk-endpoint.md
- references/orch-bounded-fanout-concurrency.md
- references/orch-no-blocking-in-async-view.md
- references/orch-parallel-fanout-asyncio-gather.md
- references/orch-propagate-request-deadline.md
- references/orch-return-exceptions-on-fanout.md
- references/orch-reuse-async-clients.md
- references/protect-bulkhead-connection-pool.md
- references/protect-circuit-breaker-per-downstream.md
- references/protect-client-side-rate-limit.md
FAQ
Что делает скилл 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.
Как установить скилл django-recommender-search-backend-patterns?
Скопируй папку скилла в ~/.claude/skills (вкладка Claude Code выше делает это одной командой), либо поставь как плагин.
Скилл django-recommender-search-backend-patterns запускает скрипты?
Нет, скилл состоит только из инструкций (SKILL.md), без исполняемых скриптов.
Похожие скиллы
agent-skill-stack
GitHubFind, evaluate, and assemble the smallest compatible set of AI Agent Skills for an end-to-end natural-language goal. Use when a user wants Skills for a…
build-evidence-map
GitHubBuild an auditable evidence map for a contested technical choice, research synthesis, proposal review, or consequential decision. Use when Copilot must…
pinecone-rag
GitHubBuild production RAG pipelines and persistent agent memory using Pinecone as the vector database backend. ALWAYS USE THIS SKILL when the user mentions…
qdrant-monitoring-debugging
GitHubDiagnoses Qdrant production issues using metrics and observability tools. Use when someone reports 'optimizer stuck', 'indexing too slow', 'memory too high'…