HomeArtificial IntelligenceDEV's Smarter Feed Uses Gemini Embeddings in Surprising New Way

DEV’s Smarter Feed Uses Gemini Embeddings in Surprising New Way

DEV, the developer community platform built on the open-source Forem codebase, is overhauling the way its feed works — and it’s leaning on Gemini Embeddings to do it. The team has published a detailed look at how they’re combining Google’s latest embedding model with pgvector inside PostgreSQL to build a feed that actually surfaces content worth reading, rather than just whatever got the most clicks in the last hour.

  • DEV is integrating Gemini Embeddings with pgvector to score articles by semantic relevance alongside traditional social signals.
  • Gemini Embeddings 2 produces 3,072-dimensional vectors, future-proofing DEV’s feed for multimodal content like video and audio.
  • A background clustering service runs every six hours to detect trending topics and label them automatically using the Gemini API.
  • Human curation and community voting remain central — the AI amplifies existing signals rather than replacing editorial judgment.

The Feed Algorithm Problem Nobody Has Fully Solved

Every content platform eventually hits the same wall. Optimise purely for engagement and you end up rewarding outrage and clickbait. Sort by recency and genuinely great posts vanish before anyone sees them. DEV has been wrestling with this tension for years, and it’s not alone — Twitter, Reddit, LinkedIn, and virtually every platform with a feed has iterated endlessly on this exact problem with mixed results.

What makes DEV’s challenge slightly different is the nature of its audience. Software developers are an unusually critical group of readers. They notice when a feed feels gamed, and they’ll disengage fast if they sense the algorithm is prioritising noise. That creates pressure to get this right in a way that, say, a lifestyle content platform might not feel as acutely.

The solution DEV is building mixes two things that have historically been kept separate: traditional community signals — who you follow, what you react to, post quality scores — and semantic similarity powered by Gemini Embeddings. The idea is that the numbers should reflect what you actually care about intellectually, not just who you happened to follow three years ago.

How Gemini Embeddings Fit Into the Feed

If you’re not deep in ML infrastructure, the concept of an embedding is worth understanding quickly. Take any piece of text — an article, a comment, a description — and an embedding model converts it into a long list of numbers called a vector. These numbers position the content in a high-dimensional semantic space. Two articles that discuss the same underlying concepts will end up with vectors that are mathematically close together, even if they use completely different words. That’s the core insight that makes this useful for recommendations.

DEV has upgraded its pipeline to use Google’s Gemini Embeddings 2 model specifically, which generates 3,072-dimensional vectors — substantially richer than what most standard text embedding models produce. As users interact with the platform, DEV compiles a personal interest_embedding that captures their demonstrated interests. That vector then gets injected directly into the SQL query powering the feed via the pgvector extension in PostgreSQL:

The relevant query fragment uses cosine similarity — 1 – (articles.semantic_embedding <=> :interest_embedding) — to produce a score between 0 and 1 for how closely a given article matches what a user has historically engaged with. That score is then blended with conventional signals like author relationships, post quality, and time decay. A highly relevant article from someone you’ve never followed can still surface if it maps closely enough to your interests. Equally, a popular post from a community member you love won’t get buried just because it doesn’t match your typical content profile.

The architecture behind this is deliberately clean. Rather than scattering API calls across the codebase, DEV built wrapper classes — primarily Ai::Base and Ai::Embedding — that centralise all AI interactions. Every time a vector is generated or a trend analysed, an AiAudit model automatically logs the model used, the calling class, payload data, latency, and token counts. That’s a practical engineering decision that anyone managing AI costs at scale will appreciate — keeping full visibility on what’s being called, when, and at what expense, without tangling that logic into core business code.

Gemini Embeddings 2 and the Multimodal Bet

The more forward-looking part of DEV’s technical stack is why they chose Gemini Embeddings 2 specifically rather than a well-established alternative like OpenAI’s text-embedding-3-large. The answer comes down to modality. Standard text embedding models handle text. That’s it. Gemini Embeddings 2 natively accepts text, code, images, audio, and video — and critically, it maps all of them into the same unified vector space.

Right now, DEV is feeding it written articles. But because everything ends up in the same mathematical space, the infrastructure they’re building today will handle video tutorials, podcast episodes, and image-heavy posts without requiring a fundamental rewrite of the feed logic. A user’s interest_embedding — built from the written articles they’ve engaged with — could eventually surface a video walkthrough on a conceptually related topic, because both would map to similar regions in that shared semantic space.

This is a meaningful technical choice. Building multimodal capability into foundational infrastructure now, rather than bolting it on later, is exactly the kind of decision that pays dividends as platforms expand their content formats. DEV hasn’t announced plans for video or audio content specifically, but the plumbing is being laid for it.

Trend Detection: Finding What’s Actually Hot Right Now

Tags have always been a blunt instrument. A #ruby tag tells you an article is about Ruby. It doesn’t tell you whether it’s a beginner tutorial, a performance deep-dive, or a heated debate about a new language feature that dropped last week. DEV is trying to address this with a clustering service called TrendDetector.

Every six hours, a background job runs a Leader Clustering algorithm written in pure Ruby. The process works in stages. First, it filters for quality — only articles that score at least 15 points above the homepage minimum are considered, which immediately removes low-effort content from the clustering pool. Then it measures cosine distance between article vectors. If a post sits within 0.15 of an existing cluster’s centroid, it joins that cluster. If it’s further away, it seeds a new one. Once a cluster accumulates 10 or more articles, the Gemini API is called to label the emerging trend and summarise the core debate.

The results get stored in a TrendMembership model, which allows the UI to sort and surface articles not just by tag or recency, but by proximity to an actively developing conversation. It’s the difference between “here are some Ruby articles” and “here’s where the Ruby community is arguing right now.” That’s a meaningful upgrade in signal quality, especially on a platform where the most valuable discussions can be time-sensitive and highly specific.

The Human Element Stays Central

One thing DEV is careful to clarify — and it’s worth taking seriously — is that Gemini Embeddings aren’t replacing human curation. The DEV team describes the AI layer as amplifying what the community is already doing, not overriding it. Developer-voted scores, editorial picks, and social relationships remain the backbone of the ranking system. The semantic layer adds sensitivity, not control.

That framing matters. There’s a version of this story where an engineering team uses AI to quietly sideline human moderation and editorial judgment in favour of pure algorithmic optimisation. DEV’s approach seems genuinely more careful than that — the embeddings are one input among several, weighted alongside signals that reflect actual community behaviour. Whether that balance holds as the system matures is a fair question, but the architecture as described keeps humans in the loop rather than treating them as a bottleneck to be bypassed.

For the broader developer community, it’s also worth noting that all of this is happening in the open. Forem is open-source, meaning anyone can inspect how these systems are being built, fork the approach for their own community platform, or contribute directly. That transparency is increasingly rare as AI gets stitched into core product infrastructure.

What This Signals for Developer Platforms

DEV isn’t the first platform to experiment with embedding-based recommendations — Spotify, Pinterest, and Airbnb have published detailed work on similar systems for years. But seeing this approach applied to a developer-focused content platform, built openly on Forem, using a newly released model like Gemini Embeddings 2, is a useful signal about where the bar is moving.

The cost of building semantic search and recommendation infrastructure has dropped dramatically. pgvector, available as a PostgreSQL extension, means teams don’t need a dedicated vector database to get started. Models like Gemini Embeddings 2 are accessible via API. What used to require a dedicated ML team and significant infrastructure investment can now be assembled with a few well-chosen tools and a clear architectural approach.

For smaller developer communities and platforms built on Forem, the fact that this work is happening in an open codebase means these capabilities could trickle down fast. The real test will be whether DEV’s feed actually feels different to the people using it every day — and whether the balance between algorithmic relevance and human community spirit holds up when the system scales.

Source: https://dev.to/devteam/how-were-using-gemini-embeddings-to-build-a-smarter-community-driven-feed-on-dev-1b9f

Wasiq Tariq
Wasiq Tariq
Wasiq Tariq, a passionate tech enthusiast and avid gamer, immerses himself in the world of technology. With a vast collection of gadgets at his disposal, he explores the latest innovations and shares his insights with the world, driven by a mission to democratize knowledge and empower others in their technological endeavors.
RELATED ARTICLES

LEAVE A REPLY

Please enter your comment!
Please enter your name here

Most Popular