How an AI Engineer Built a Personal Video Site in Two Hours: Architecture, Curation, and AI Coding
This article examines how an AI engineer built a personal video site in about two hours using an AI coding assistant. It focuses on a curation-driven approach to reduce the homogenization of platform recommendation feeds, and explains a four-layer architecture, a minimal PostgreSQL data model, filtering and scoring rules, personalized ranking, explainable recommendations, AI-assisted development, and compliance checks. It includes runnable SQL and Python examples.
How an AI Engineer Built a Personal Video Site in Two Hours: Architecture, Curation, and AI Coding
Late Friday night, an AI engineer opened a major video platform, looking for something worth watching. The homepage covers looked exaggerated, the topics repeated, and the recommendation stream became more and more similar the longer he scrolled. He quickly lost interest.
The next day, with help from an AI coding assistant, he built a personal video site for himself. The whole task took about two hours, and he still used the assistant’s medium reasoning setting.
The site does not aim to be “big and complete.” Instead, it emphasizes control: the left side provides navigation such as liked videos, watch history, and watch later, while the right side shows a recommendation feed. Page elements such as cover images, duration, publish time, and view count are all included.
The key difference is that videos are not randomly crawled. They come from public platforms and are content repeatedly discussed and recommended by technical communities. Individual developers can now rebuild their information entry point using their own rules.
Why Recommendation Feeds Become Homogeneous
Mainstream content platforms usually optimize recommendation systems for engagement metrics such as click-through rate, watch time, and interaction rate. This approach is efficient, but it also creates several structural problems.
First, titles and covers more directly influence clicks, while content value often can only be judged after watching. Second, popular content is repeatedly amplified: more exposure leads to more clicks, while long-tail content becomes harder to surface. Third, heavy users are more likely to be recommended similar content, which gradually narrows their information exposure.
These problems are not necessarily caused by malicious platform design. They are predictable outcomes of the objective function. The value of a personal video site is that it returns control to the user: content is not “recommended to me by an algorithm,” but “selected and presented by me and the groups I trust.”
A curation-driven information feed has several key characteristics:
- Explainable selection criteria: Each video can explain why it entered the recommendation feed.
- Adjustable rules: Users can modify sources, thresholds, and blacklists themselves.
- Short feedback loop: If recommendations are unsatisfactory, users can change the filtering rules instead of waiting for the platform to adjust its model.
Four-Layer Architecture for a Personal Content Entry Point
A personal video site can be divided into four layers. All content comes from public data sources, but raw data does not directly enter the user’s view. It must pass through a complete processing pipeline.
- Collection layer: Collect video metadata and community discussion information from public video platforms and technical communities. Deduplicate and normalize the data.
- Filtering layer: Use rules such as community recommendation count, time window, and source weight to select “worth watching” content from items that have been discussed. Apply topic tags.
- Recommendation layer: Within the filtered high-quality pool, perform personalized ranking based on user history. Reserve a small number of exploration slots to avoid narrowing the feed too much.
- Presentation layer: Provide a browsing experience similar to mainstream video platforms, including navigation, category channels, search, a recommendation feed, and detail pages.
These four layers can be replaced independently. Changing the data source, adjusting filtering rules, upgrading the recommendation algorithm, or moving to a mobile interface does not require rewriting the entire system.
Prerequisites and Data Model
1. Prerequisites
To follow the example in this article, the following environment is recommended:
- PostgreSQL 14 or later.
- Python 3.10 or later, used to run the scoring and ranking examples.
- Database permissions on a local machine or server, with the ability to create tables and indexes.
- If using Python to connect to PostgreSQL, install
psycopg:
python -m pip install "psycopg[binary]>=3.1"
Example database initialization:
createdb video_sitepsql -d video_site -f schema.sql
2. Core Table Structure
A minimal usable model should include at least a candidate pool, curation records, a curated library, and user behavior.
-- Candidate pool: videos mentioned in community posts, one row per video after deduplicationCREATE TABLE candidate (id BIGSERIAL PRIMARY KEY,video_id TEXT NOT NULL,url TEXT NOT NULL,title TEXT,duration_sec INTEGER,published_at TIMESTAMPTZ,cover_url TEXT,tags TEXT[] DEFAULT '{}',total_points INTEGER NOT NULL DEFAULT 0,mention_count INTEGER NOT NULL DEFAULT 0,first_seen_at TIMESTAMPTZ NOT NULL DEFAULT now(),last_seen_at TIMESTAMPTZ NOT NULL DEFAULT now(),UNIQUE (video_id));-- Curation records: keep the details of each community post for scoring and traceabilityCREATE TABLE curation_record (id BIGSERIAL PRIMARY KEY,candidate_id BIGINT NOT NULL REFERENCES candidate(id) ON DELETE CASCADE,discussion_id TEXT NOT NULL,points INTEGER NOT NULL DEFAULT 0,num_comments INTEGER NOT NULL DEFAULT 0,created_at TIMESTAMPTZ NOT NULL,UNIQUE (candidate_id, discussion_id));-- Curated library: content that passes filteringCREATE TABLE curated_item (id BIGSERIAL PRIMARY KEY,candidate_id BIGINT NOT NULL UNIQUE REFERENCES candidate(id),score NUMERIC(6,3) NOT NULL,added_at TIMESTAMPTZ NOT NULL DEFAULT now(),status TEXT NOT NULL DEFAULT 'published'CHECK (status IN ('published', 'hidden')));-- User behavior: used for local personalization onlyCREATE TABLE user_event (id BIGSERIAL PRIMARY KEY,user_key TEXT NOT NULL,item_id BIGINT NOT NULL REFERENCES curated_item(id),event_type TEXT NOT NULL CHECK (event_type IN('play', 'like', 'watch_later', 'history', 'finish')),tag TEXT,created_at TIMESTAMPTZ NOT NULL DEFAULT now());CREATE INDEX idx_user_event_user_time ON user_event (user_key, created_at DESC);CREATE INDEX idx_candidate_last_seen ON candidate (last_seen_at DESC);CREATE INDEX idx_curated_score ON curated_item (score DESC);
The key point is not how many tables exist, but whether the data pipeline is clear: community posts first enter the candidate pool, then enter the curated library after filtering, and user behavior only serves local personalization without spreading externally.
Filtering Strategy: From Threshold Stacking to Credibility-Weighted Scoring
Filtering is the soul of a personal video site. It is best built in this order: basic filtering → scoring and ranking → tag system → blacklist.
1. Basic Filtering
First, remove obvious noise:
- Keep only videos in the candidate pool. Exclude ordinary web pages, official documentation, and external links.
- Exclude entries that are too short or abnormally long.
- Set a lookback time window for candidates to prevent old content from accumulating indefinitely.
- Perform representative deduplication for videos from the same series, author, or channel.
- For reposted videos whose titles differ by only a few characters, merge them using edit distance or title hashing.
- Maintain a manual blacklist to block accounts identified as clickbait producers. The rules should be transparent and auditable.
2. Scoring Function: Time Decay and Credibility Weighting
A simple and practical scoring approach is: each curation record contributes to the candidate score by multiplying the community post score by an age decay weight and a source credibility coefficient.
import mathfrom datetime import datetime, timedelta, timezoneMIN_POINTS = 5HALF_LIFE_DAYS = 365.0SOURCE_WEIGHT = {"front_page": 1.0,"discussion": 0.7,"comment": 0.4,}def record_contribution(record: dict, now: datetime) -> float:if record["points"] < MIN_POINTS:return 0.0age_days = max((now - record["created_at"]).total_seconds() / 86400, 0)decay = 0.5 ** (age_days / HALF_LIFE_DAYS)base = record["points"] + 0.5 * record["num_comments"]return base * decay * SOURCE_WEIGHT.get(record["source"], 0.5)def score_candidate(records: list[dict], now: datetime) -> float:total = sum(record_contribution(r, now) for r in records)if total <= 0:return 0.0return math.log1p(total)now = datetime(2026, 1, 1, tzinfo=timezone.utc)sample = [{"points": 800,"num_comments": 200,"source": "front_page","created_at": now - timedelta(days=730),}]print(score_candidate(sample, now))# Calculation: base = 800 + 0.5 * 200 = 900;# age_days = 730, decay = 0.25, contribution total = 900 * 0.25 = 225;# score_candidate outputs log1p(225) ≈ 5.42.# total is the weighted raw score, while log1p(total) is the final candidate score,# used to compress marginal gains.
Two concepts need to be distinguished here:
total: the weighted raw score of all curation records. It is suitable for ranking and auditing.log1p(total): the final score used for display or ranking. It prevents high scores from inflating too much.
If classic older videos should remain in the curated library for a long time, you can increase the half-life. Alternatively, you can separate the candidate pool from the curated library: the candidate pool can roll forward according to freshness, while the curated library is updated only when triggered manually or by rules.
3. Minimal Version: Simplified Scoring Without Decay
In the early stage of a personal site, there is no need to rush into complex decay logic. You can first use a simplified function to get the pipeline working:
def simple_score(records: list[dict]) -> float:return sum(r["points"] + 0.5 * r["num_comments"]for r in recordsif r["points"] >= 5)
Once the data pipeline is stable, you can introduce time decay, source weights, and diminishing returns.
4. Tags and Detail Pages: Making Curation Traceable
Topic classification should not be hard-coded. It should be maintained as an editable taxonomy dictionary. Each video can have multiple tags, such as software engineering, history, art, ideas, business, and games.
For tagging, you can first use keyword matching against titles and descriptions as a fallback. Then you can connect to a text vectorization model for semantic classification, improving tag accuracy from “keyword match” to “semantic similarity.”
A detail page should ideally answer three questions:
- Which community post mentioned this video?
- How many points did that post receive, and how much discussion did it generate?
- When was it most recently recommended?
When users open a detail page, besides the player, they can also see a summary of the community discussion and a link to the original post. This is what distinguishes curation from reposting: the recommendation evidence chain is visible to the user.
Recommendation and Search: Personalization Within a Curated Pool
1. Personalized Ranking Code
If the global highest-scoring list is used directly as the recommendation feed, all users will see exactly the same content. A more reasonable approach is to perform personalized reranking within the candidate set: videos matching interest tags receive a weight boost, low-exposure content enters exploration slots, and tag distribution receives diversity constraints.
from collections import Counterdef personalized_rank(items: list[dict], history: list[dict],top_k: int = 20, explore_ratio: float = 0.2) -> list[dict]:interest_weight = {}for h in history:watched = int(h.get("watched", 0))if watched > 0:interest_weight[h["tag"]] = min(1.0 + 0.2 * watched, 2.5)def rank_score(item: dict) -> float:weight = interest_weight.get(item["tag"], 1.0)return item["base_score"] * weightranked = sorted(items, key=rank_score, reverse=True)n_explore = min(top_k, max(1, int(len(ranked) * explore_ratio)))explore = [it for it in ranked if it.get("impressions", 0) < 3][:n_explore]main = [it for it in ranked if it not in explore][: top_k - len(explore)]result = []tag_count = Counter()for it in main:if tag_count[it["tag"]] * 2 < max(len(main), 1):result.append(it)tag_count[it["tag"]] += 1return result + explore
The logic here is:
- Tags that the user has watched in the past increase the ranking weight of related content.
- Low-exposure content enters exploration slots, preventing the feed from repeatedly showing only popular content.
- The proportion of the same tag in the main list is limited to improve diversity.
If you want to suppress repeated viewing, you can remove completed videos from candidates or apply frequency filtering on user_event. This example only demonstrates interest weighting, so the explanation stays aligned with the code.
2. Search and Explainable Recommendations
Search capability can be divided into three layers:
- Keyword retrieval: Use database full-text search or inverted indexes to rank by title, tags, and description.
- Semantic retrieval: Convert titles and descriptions into vectors and use approximate nearest neighbor search to find semantically similar videos.
- Explainable recommendation: Instead of writing “guess you like it,” write “because you recently watched 3 software engineering videos, and this topic was recommended 12 times in the community.”
A personal video site does not need to start with a large model. As long as the recommendation rationale is written out, it already has more informational value than a black-box recommendation feed.
AI-Assisted Development: Spending Two Hours on the Right Tasks
The engineer’s prompt was short, but it contained several key pieces of information: a clear goal, clear constraints, a reference page style, and enough context for the model to complete the design on its own.
For developers, prompts can be divided into three parts:
- Goal: What should be built?
- Constraints: What must not be done, and what must be done?
- Acceptance criteria: How can completion be verified?
A usable template is:
Goal: Build a personal content entry site. The content source is a technical community I trust, and it should only include videos repeatedly recommended there.Constraints:1. First output the data model and filtering rules, then implement pages. Every step must be runnable and verifiable.2. Reference public video URLs only. Do not download any media files.3. Rate-limit requests. Store crawl results in a local cache to avoid duplicate fetching.4. The page structure should follow mainstream video platforms: left navigation, right recommendation feed, and detail pages that show community discussion.Acceptance: Provide reproducible local startup commands and at least 3 test cases.
AI is best suited for scaffolding work: generating table structures, interface skeletons, basic pages, and test code. The parts that usually require human review include:
- Data sources and filtering rules: Which communities are trusted, and how thresholds are defined.
- Failure paths: Network exceptions, API changes, empty results, and concurrent writes.
- Testing and rollback: Every rule change should be verifiable.
- Evolution rhythm: First get collection and display working, then introduce search and personalization.
Generative AI may invent APIs or parameters that do not exist. Therefore, generated code must be reviewed and actually run. Critical modules should retain human review and rollback paths. One generation should not be treated as one final delivery.
Compliance Checks Before Crawling
Even though a personal video site is small, compliance issues should be considered in advance. Before launch, check the following item by item for each source:
- Terms of service: Does the source platform allow crawling public metadata? Are there restrictions on use?
- robots protocol: Is crawling allowed? Are there prohibited paths?
- Licenses: Can video metadata, cover image URLs, and community comments be referenced?
- Rate limits: Could the request frequency be treated as abnormal traffic?
- Stop conditions: If source terms change, crawling is explicitly prohibited, or copyright disputes arise, collection should stop and the matter should be reviewed by legal or compliance.
Engineering practices should also include:
- Reference only public links and metadata. Do not cache video content.
- Store only anonymous identifiers and local data for user behavior. Do not upload or sell it. Provide a feature for clearing history.
- Set request intervals, timeouts, and retry limits for crawlers. Respect the load of source sites.
- Add logging and failure alerts for collection and filtering tasks. This helps quickly identify causes when content suddenly drops.
- Estimate costs based on data scale. For a personal site with tens of thousands of candidates and hundreds of updates per day, a single deployment plus scheduled tasks is usually sufficient. If it reaches millions of items, then introduce task queues, caching, and monitoring alerts. On cloud platforms, you can use common capabilities such as object storage, containers, logging, and monitoring. Check the official documentation for specific availability and quotas.
Common Questions
How can I build a personal video site?
You can proceed in four layers: collect public metadata, build a candidate pool, design filtering rules, generate a curated library, and finally create a recommendation feed and detail pages. First get the minimal closed loop working, then gradually add search, tags, and personalization.
What are the minimum fields in the data model?
At minimum, you need a video identifier, title, cover URL, publish time, duration, community recommendation records, curated status, and user behavior. The core goal is to make every recommendation explainable.
How can recommendation homogenization be reduced?
Do not rank only by global popularity. Add interest weighting, low-exposure exploration slots, and tag diversity constraints. Keep recommendations explainable. Users should know why content appears and be able to modify filtering rules.
Conclusion
The most valuable lesson from this practice is not the number “two hours.” It is that the project returns ownership of the information entry point to the user: sources are controllable, rules are explainable, and results are adjustable.
When generative AI lowers the cost of building personal products, the scarce resource becomes judgment: knowing what is worth watching, and knowing whose claims are worth trusting.
