How the Feed Works
Mirage’s algorithm creates a personalized feed by intelligently mixing different types of content.Feed Composition
Your For You Page combines three content sources:
- Recent posts from followed users (up to 20 posts)
- Global posts from users you don’t follow (up to 20 posts)
- Older/random posts for discovery (up to 100 posts)
Feed Algorithm
app/routes/feed.py:11-118
Collect Followed Content
Fetch the 20 most recent posts from users you follow, ordered by creation date
Add Global Discovery
Include 20 recent posts from users you don’t follow to help you discover new creators
Content Types
- Followed Users
- Global Posts
- Random Discovery
Posts from people you follow get priority in your feed:
app/routes/feed.py:36-57
Feed Personalization
Content Mixing
Content Mixing
The algorithm combines all three content sources and shuffles them:
app/routes/feed.py:96-101
Follow-Based Filtering
Follow-Based Filtering
Your feed is directly influenced by who you follow:
- Follow more users = more personalized content
- Follow fewer users = more discovery content
- No follows = empty feed (encourages network building)
Fresh Content Each Visit
Fresh Content Each Visit
Random shuffling ensures your feed looks different every time you refresh, keeping the experience fresh and engaging.
Trending Topics
Discover what’s hot on Mirage with real-time trending hashtags.Trending Algorithm
Mirage analyzes hashtags from recent global posts to identify the top 3 trending topics on the platform.
Hashtag Extraction
app/routes/feed.py:103-118
Regex Pattern: The pattern
r'#(\w+)' matches hashtags starting with # followed by word characters (letters, numbers, underscores).Post Interactions
Engage with feed content through various interaction types.Upvotes & Downvotes
Vote on posts to show support or disagreement. Each post displays vote counts:
Replies
Comment on posts to start conversations. Replies are accessible from the feed.
User Profiles
Click any username to view their full profile with all posts and stats
Follow Users
Follow interesting creators directly from their feed posts to see more of their content
First-Time User Experience
app/routes/feed.py:31-33
Post Structure
Each post in the feed includes comprehensive metadata:- Post Data
- Post Limits
- Post Sorting
Feed Response Format
The FYP endpoint returns both posts and trending topics:Building Your Network
Related Features
Creating Posts
Learn how to publish your own content
Following Users
Build your network by following creators
Post Voting
Engage with content through voting
Algorithm Benefits
Personalization
Personalization
Content from followed users ensures your feed reflects your interests and connections
Discovery
Discovery
Global posts and random content help you find new creators and diverse perspectives
Variety
Variety
Random shuffling and mixed content sources prevent feed staleness
Performance
Performance
Smart limits (20/20/100 → shuffle → 30) balance content diversity with load times
The For You Page requires authentication. All feed requests must include a valid session token in the Authorization header.