Add related episode embeddings feature
Nobody has claimed this yet.
- Dominant language
- Svelte
- Stars
- 1.2k
- Forks
- 515
- Avg merge
- 23h
- Merged PRs (30d)
- 13
Description
Product Requirements Document (PRD)
Title:
Related Episodes, AI-Generated Tags & 2D Visualization for Syntax.fm
Overview:
We want to enhance the discoverability and exploration of episodes on syntax.fm by implementing:
- AI-powered related episode recommendations.
- Auto-generated episode tags.
- A tag-driven episode directory.
- A 2D graph visualization of episode clusters.
Goals:
- Improve episode discoverability.
- Increase user engagement and time on site.
- Provide visual insight into content clustering over time.
Features & Requirements:
1. Related Episodes
-
Description: Recommend similar episodes based on content.
-
Implementation:
- Use the OpenAI Embeddings API (e.g.,
text-embedding-3-small) on each episode’s title + show notes. - Store the resulting vector in the database alongside episode metadata.
- During request time or via batch jobs, calculate the cosine similarity between the current episode and all others.
- Return top 3-5 similar episodes.
- Use the OpenAI Embeddings API (e.g.,
-
Frontend:
- New Svelte component
<RelatedEpisodes>placed below the show notes. - Show thumbnail, title, and link to each related episode.
- New Svelte component
-
Backend:
- Add new column
embedding_vectorto episodes table. - Add endpoint:
GET /api/episodes/:id/related
- Add new column
2. AI-Generated Tags
-
Description: Create a set of tags for each episode using an AI summarization/tagging model.
-
Implementation:
- Use OpenAI GPT-4 or similar to analyze episode show notes + title.
- Return 3–10 concise tags per episode.
- Run via a weekly cron job to process new episodes or backfill.
- Store tags in DB in a
tagsfield (array of strings).
-
Infrastructure:
- Add cron job (e.g., GitHub Actions or Vercel Scheduled Functions).
- Optional admin override via CMS interface.
3. Tags Page
-
Description: Allow users to explore episodes by tag.
-
Implementation:
- Create
/tagsroute in SvelteKit. - Display all tags as clickable pills or a tag cloud.
- Clicking a tag leads to
/tags/[tag]showing all episodes with that tag. - Sort by most recent or relevance.
- Create
4. 2D Graph Visualization
-
Description: Visualize all episodes on a 2D plane to reflect tag or content similarity.
-
Implementation:
- Use dimensionality reduction on embeddings (e.g., t-SNE, UMAP).
- Preprocess offline and store
x,ycoordinates per episode. - Update weekly alongside tag generation.
- Use canvas/SVG/WebGL to render the graph (e.g., D3, Plotly, or custom SvelteCanvas).
- Hover/Click reveals episode info or links.
-
Frontend:
- New
/visualizeroute. - Responsive layout with zoom/pan support.
- New
-
Backend:
- Store
xandyfloats in the episodes table or a newepisode_graphtable.
- Store
Technical Considerations:
-
Data Storage:
- Add
embedding_vector,tags, and optionalcoordinatesfields to episodes.
- Add
-
OpenAI API:
- Use secure server-side calls only.
- Rate limit embedding and tag generation to avoid exceeding token quota.
-
Performance:
- Cache related episodes for each episode ID.
- Use IndexedDB or localStorage if the 2D graph grows too large.
-
Design Consistency:
- New components should match current design system.
- Mobile support for graph is desirable but optional for v1.
Milestones:
| Milestone | Task | Owner | ETA |
|---|---|---|---|
| M1 | Setup embedding pipeline & DB fields | Dev | TBD |
| M2 | Related episodes component | Dev/Design | TBD |
| M3 | AI tagging cron job | Dev | TBD |
| M4 | Tag browser page | Dev | TBD |
| M5 | 2D graph pipeline + frontend | Dev | TBD |
Would you like this exported to a text doc or Notion-ready format?
Contributor guide
No contributing guide indexed for this repository
First steps
- Read the whole issue, then the project's contributing guide.
- Comment on the issue to say you are picking it up — it saves two people doing the same work.
- Fork the repository and make your change on a branch.
- Open a pull request that references the issue number.
Research direction
Start by reviewing the PRD's five milestones and the existing episode data flow before choosing a narrower first deliverable. The named entry points are the RelatedEpisodes component, GET /api/episodes/:id/related, /tags, /tags/[tag], and /visualize. Done would require a defined scope, implementation plan, and acceptance criteria for the selected milestone; the issue currently spans embeddings, tagging, storage, scheduled jobs, and visualization.
Written by the indexing model from the issue text.
Assessment
- Tech stack
- d3, github-actions
- Domain
- backend, data-visualization, database, frontend
- Issue type
- Feature
- Difficulty
- 5/5
- Estimated time
- Over a week
- Activity status
- Stale
- Clarity
- Needs clarification
- Newbie friendliness
- 15/100