AfterTrace 如何結合 Gemma 4 挖掘被遺忘的網絡歷史
AfterTrace: Excavating Forgotten Internet History with Gemma 4
AfterTrace 結合 Internet Archive 和 GitHub 的歷史資料,以及 Google 開放權重模型 Gemma 4,重建網站與開源軟件的演變歷史,並生成有證據支持的研究報告。平台可比較網站歷史快照,並以確定性證據帳簿將資料標記為已核實、AI 推斷或未知,避免把模型生成的推斷當作歷史事實。
What if we could travel back through the internet's history and discover what happened to the websites and software projects we left behind?
The internet is constantly evolving. Websites disappear, communities become inactive, and open-source repositories stop receiving updates. But their digital footprints often remain scattered across archived pages, repository histories, and forgotten documentation.
I wanted to build something that could explore these forgotten traces.
That idea became AfterTrace — The Digital Archaeology Lab.
What I Built
AfterTrace is an AI-powered digital archaeology platform that investigates the historical evolution of websites and open-source software.
It uses real historical data from the Internet Archive and GitHub, combined with Google's open-weight Gemma 4 model, to reconstruct digital histories and generate evidence-backed research reports.
The application has two main modes.
- Website Archaeology
Enter a public website URL, and AfterTrace retrieves available historical captures from the Internet Archive Wayback Machine.
Features include:
Historical website snapshots and timestamps.
Extracted content from archived pages.
Historical evolution timelines.
Comparisons between two historical snapshots.
AI-generated historical narratives.
- GitHub Archaeology
Enter a public GitHub repository URL to investigate its development history.
AfterTrace retrieves:
Repository metadata and statistics.
README documentation.
Recent commit history.
Development and maintenance signals.
Potential preservation and modernization opportunities.
How I Interpreted Digital Archaeology
I see forgotten websites and inactive repositories as digital memories.
A website created in the 1990s might contain traces of an online community that no longer exists. An old repository might preserve engineering decisions that are still useful today.
AfterTrace attempts to bring these fragments together.
The goal is not simply to retrieve old data. It is to make that data understandable, searchable, comparable, and useful.
The Moment It Came Together
One of the most interesting moments during development was testing AfterTrace against GeoCities.
The application successfully retrieved historical captures from:
October 22, 1996
July 3, 1998
January 25, 1999
Seeing actual historical website content from different years was fascinating.
The Snapshot Comparator also revealed measurable textual differences between the 1996 and 1999 captures:
37 lines added.
5 lines removed.
It turned a forgotten website address into something we could actually investigate.
Gemma 4: The Intelligence Engine
Gemma 4 is a central part of AfterTrace.
I integrated Google's official @google/genai SDK to use the gemma-4-26b-a4b-it model for historical analysis.
Gemma receives bounded historical evidence and generates structured interpretations, including:
Historical identity and evolution.
Notable changes and decay signals.
Repository development insights.
Preservation recommendations.
Digital Resurrection Blueprints.
However, AI-generated information should not automatically be treated as historical fact.
That brings me to one of the project's most important engineering components.
Deterministic Evidence Ledger
One of my main objectives was to make AfterTrace evidence-driven rather than just another AI chatbot.
I implemented a Deterministic Evidence Ledger that validates AI-generated claims against actual source records.
The system separates information into three categories:
VERIFIED: Claims supported by available primary evidence.
AI_INFERRED: Reasonable interpretations generated by the model but not independently established as facts.
UNKNOWN: Information that cannot be established from the available evidence.
If a generated claim references an invalid or nonexistent source, the application downgrades it instead of presenting it as verified.
My core engineering principle is:
AI interprets evidence; deterministic code establishes facts.
Historical Snapshot Comparator
AfterTrace also includes an interactive comparison engine.
Users can select two historical website captures and compare their extracted textual content.
The system identifies:
Added content.
Removed content.
Changes between historical versions.
The comparison works on extracted textual data without executing archived website scripts.
Why Open Innovation Matters
I believe digital preservation should be accessible to developers, researchers, students, and independent communities.
Open innovation makes it possible to build on publicly accessible archives, inspect source code, experiment with open-weight AI models, and improve existing tools collaboratively.
AfterTrace combines:
The Internet Archive's historical web data.
GitHub's public repository information.
Gemma 4's open-weight AI capabilities.
An independently developed evidence-validation system.
The combination demonstrates how existing open technologies can be integrated to address a real problem.
I also want other developers to be able to explore the source code, understand the architecture, and contribute improvements.
Technology Stack
Component
Technology
Frontend
Next.js 15
Language
TypeScript
Styling
Tailwind CSS
AI Model
Google Gemma 4
AI SDK
@google/genai
Historical Data
Internet Archive Wayback CDX API
Repository Data
GitHub REST API
HTML Extraction
Cheerio
Validation
Zod
Testing
Vitest
Deployment
Vercel
Security and Engineering Challenges
Building AfterTrace involved several engineering challenges.
- SSRF Protection
Since users can submit website URLs, I implemented URL validation and server-side protections against requests to private networks, localhost, and cloud metadata endpoints.
- Structured AI Responses
Gemma responses are validated against structured schemas. Malformed responses are handled rather than silently accepted.
- Evidence Validation
The Evidence Ledger ensures that AI-generated claims cannot introduce fabricated source identifiers and file references.
- API Rate Limits
GitHub API requests are bounded and handled with appropriate error states.
- Inference Latency
Large historical HTML payloads can make AI analysis slow. I introduced bounded evidence extraction and prompt optimization to reduce unnecessary input.
Testing and Verification
After implementing the application, I ran an automated and live verification process.
Test
Result
Automated test suite
30/30 passed
TypeScript typecheck
0 errors
Production build
Passed
Live Wayback integration
Passed
Live GitHub integration
Passed
Gemma 4 inference
Passed
SSRF security tests
Passed
Snapshot comparison
Passed
The application is deployed and publicly accessible.
What's Next?
AfterTrace is an evolving project. Some areas I would like to explore further include:
More historical archive providers.
Better website reconstruction.
Deeper repository evolution analysis.
Improved preservation workflows.
More advanced historical visualization.
Explore AfterTrace
Live Application:
https://after-trace-delta.vercel.app
GitHub Repository:
https://github.com/rudraarcadeskills-art/AfterTrace
I built AfterTrace with one simple idea in mind:
The internet has a memory. Even when websites disappear, their stories deserve to be explored.
來源:DEV Community · dev.to
