fractafrag/services/api
John Lightner dc27435ca1 M2 complete: Recommendation engine + similar shaders + tag affinities
Feed ranking (anonymous users):
- score * 0.6 + recency * 0.3 + random * 0.1
- Recency uses 72-hour half-life decay
- 10% randomness prevents filter bubbles

Feed ranking (authenticated users):
- score * 0.5 + recency * 0.2 + tag_affinity * 0.2 + random * 0.1
- Tag affinity built from engagement history:
  - Upvoted shader tags: +1.0 per tag
  - Downvoted: -0.5 per tag
  - Dwell >10s: +0.3, >30s: +0.6
- Over-fetches 3x candidates, re-ranks with affinity, returns top N

Similar shaders endpoint:
- GET /api/v1/feed/similar/{shader_id}
- Finds shaders with overlapping tags
- Ranks by tag overlap count, breaks ties by score
- MCP tool: get_similar_shaders

Fix: PostgreSQL text[] && varchar[] type mismatch
- Used type_coerce() instead of cast() for ARRAY overlap operator
- Affects both shaders search-by-tags and similar-by-tags queries
2026-03-24 23:25:45 -05:00
..
app M2 complete: Recommendation engine + similar shaders + tag affinities 2026-03-24 23:25:45 -05:00
migrations M0: Foundation scaffold — Docker Compose, DB schema, FastAPI app, all service stubs 2026-03-24 20:45:08 -05:00
alembic.ini M0: Foundation scaffold — Docker Compose, DB schema, FastAPI app, all service stubs 2026-03-24 20:45:08 -05:00
Dockerfile Fix Docker Compose startup issues 2026-03-24 21:06:01 -05:00
pyproject.toml Fix Docker Compose startup issues 2026-03-24 21:06:01 -05:00