ElijahOS
A portfolio that proves the pitch: a browser OS, an inspectable AI assistant, and a WebMCP tool surface for the agents visitors bring with them — built around evidence instead of slideware.
By Elijah Leung · Updated
Why it exists
A normal portfolio asks visitors to believe the claims on the page. ElijahOS makes them use the claims: apps open, windows move, tools run, traces explain themselves, and the assistant cites the same source material the visitor is reading.
Elijah comes from finance and operations, where useful systems expose evidence, reduce ambiguity, and make the next decision easier. ElijahOS applies that standard to a personal site: if the promise is product judgment, AI systems, and shipping discipline, the proof should be interactive.
The result is part portfolio, part operating environment, part systems demo — the shell, content model, AI assistant, observability, and fallback paths shown working together instead of hidden behind a marketing page.
What shipped
The desktop shell has a topbar, dock, launchpad, widget panel, and draggable windows with focus stacking, snapping, tiling, and deep links — it behaves like a small OS because the interactions are the work sample. The mobile shell is not a squeezed desktop: it gets its own widget console, dock, app drawer, and routing so the same portfolio feels intentional on a phone.
- Product apps — About, Projects, this case study, Resume, Contact, Ask Elijah, and Lab.
- OS toys — a zsh-style terminal, a puzzle-gated root window, calculator, clock, and Snake.
- Widgets — weather, music, Wobbles media, and system pulse.
- Lab experiments — registered from source and surfaced through Lab instead of being one-off pages.
The production layer keeps the demo honest: optimized media, generated icons, manifest, sitemap, Open Graph image, rate limits, prompt-injection guards, optional persistence, and graceful disabled modes. Not glamorous — but they are what let the demo stay usable, and safe, outside a local happy path.
Ask Elijah
Ask what you can try and the portfolio can give you a first move in Sketch Island and the Lab directly from their records. Ask why Elijah made an engineering decision and the path changes. The assistant finds evidence, gives the model the relevant passages, and streams an answer with links you can open.
- Hybrid retrieval — Named projects can take a fast keyword path. Broader searches combine BM25 with embedding similarity using Reciprocal Rank Fusion. The trace shows the rank contributed by each channel. The vectors can live in pgvector or in the app process.
- Model-agnostic generation — The default chat model is OpenAI’s gpt-6.2-sol. A deployment can enable a second pass with Anthropic’s claude-sonnet-5-5 when a draft grades poorly. Each trace names the model that actually answered.
- A deliberate tool boundary — server tools search and fetch knowledge, then feed it back into the continuation turn; client tools operate the OS — opening apps, arranging windows, copying contact fields, highlighting citations. The assistant is allowed to act, but the action is visible.
Click a citation to see exactly what the assistant had in front of it for that answer. Trace shows the sources, tools, first-text time, tokens, and estimated cost. Evals runs the same turn logic on a recorded set of questions and reports misses alongside passes.
The agent door — WebMCP
Ask Elijah answers for the site; WebMCP hands the reasoning to the visitor. ElijahOS registers ten typed, page-scoped tools through the browser's ModelContext API — navigator.modelContext first, document.modelContext as the documented fallback. Six are read-only; the four that change anything change only visible, labeled page state.
- The journey — state a visit intent, search the evidence, inspect any record in full, compose real OS windows around what was found, and read the workspace back.
- The extras — read-only lookups for profile, resume, and contact, plus open_app and play_music — an OS should let an agent open the snake game the way a human would.
Underneath is an evidence layer derived from the same typed sources the human interface renders: every record carries a claim, its provenance, Elijah's documented contribution scope, and at least one limitation. 'No documented evidence on this site' is a typed, first-class result, not a blank for the agent to fill in — and nothing returns a suitability score or hiring verdict; that judgment stays with the visitor and the agent they already trust.
Everything an agent does is visible. The visit intent it sets gets a 'set by your agent' badge with edit and clear controls and never leaves the browser session, and every registered tool call lands in an on-page activity log. Tool schemas are closed with additionalProperties: false, outputs carrying visitor-supplied text are marked untrusted, and the whole surface is client-side progressive enhancement — no new server route, no model, no key.
A visitor can rearrange a workspace their agent composed, and the agent can read back what changed. The public WebMCP challenge repository contains the standalone tool implementation. Unit tests, Playwright with an injected ModelContext host, and human-authored acceptance fixtures exercise the tools. Whether a native browser agent independently chooses the right tool is a separate question those tests leave open.
Where it's heading
The next version is not about making the interface busier. It is about making the proof deeper.
- Deeper observability — persistent traces beyond the current in-memory buffer, an optional reranker, an LLM judge beyond deterministic grading, and multimodal chunks.
- A closed agent loop — a reverse channel where client tool results feed back into the agent loop.
- Native agent proof — the WebMCP surface is verified today with unit coverage, an injected fake host, and executable fixtures; the next proof is a native supported-browser agent choosing these tools on its own.
- More flagships — more projects earn this case-study treatment once they have enough real product behavior, decisions, and results to be worth inspecting.
Architecture
The architecture is built around a simple loop: source-of-truth portfolio data becomes apps, retrieval chunks, embeddings, traces, and eval cases. The visitor sees the polished shell, but the case study exposes the system underneath it.
Browser shell
what visitors operate
- Desktop shell — topbar · dock · launchpad (Status: live)
- Mobile shell — dial · index · reading view (Status: live)
- Window system — Zustand · drag · resize · snap (Status: live)
- Widgets — weather · music · media · pulse (Status: live)
- Particle field — R3F · Three.js · GLSL (Status: live)
Product apps
the portfolio as software
- Ask Elijah — chat · trace · spec · evals (Status: live)
- Portfolio apps — about · projects · resume · contact (Status: live)
- Lab experiments — generated registry · deep links (Status: live)
- Terminal + root puzzle — virtual FS · encrypted pitch (Status: live)
- Mini apps — snake · clock · calculator (Status: live)
/api/ask/stream
agent loop
- 1 - Gate + validate request — rate limits · injection refusals (Status: live)
- 2 - Hybrid retrieve evidence — BM25 + dense + RRF (Status: live)
- 3 - Compose grounded prompt — server-only system prompt (Status: live)
- 4 - Stream + resolve tools — one continuation turn (Status: live)
- 5 - Grade, escalate, trace — deterministic judge (Status: live)
WebMCP surface
the visitor's agent
- ModelContext adapter — navigator · document fallback (Status: live)
- Ten typed tools — 6 read-only · 4 visibly mutate (Status: live)
- Evidence layer — provenance · scope · limitations (Status: live)
- Agent workspace — visit intent · honest gaps (Status: live)
- Agent activity log — every registered tool call visible (Status: live)
Retrieval & data
facts before fluency
- Typed source content — bio · projects · case study (Status: live)
- Manual KB chunks — positioning · philosophy · roadmap (Status: live)
- BM25 retriever — inspectable sparse baseline (Status: live)
- Embeddings — OpenAI text embeddings (Status: live)
- Vector stores — pgvector + in-process fallback (Status: live)
Generation & providers
model-agnostic by design
- Provider adapters — OpenAI + Anthropic SDKs (Status: live)
- Default model — OpenAI gpt-6.2-sol (Status: live)
- Optional graded retry — one retry · configurable model (Status: live)
- Swappable by env — generator · retrieval backend (Status: live)
Observability
proof surfaces
- Trace UI — chunks · tools · cost · source links (Status: live)
- Eval report UI — golden cases (Status: live)
- Test suite — node:test · Playwright · UI contract (Status: live)
- Next roadmap — reranker · LLM judge · persistent traces (Status: planned)
The important pattern is degradation. The best path uses dense search, pgvector, and citation/format-gated model escalation. Local or partially configured paths still answer with BM25, in-process vectors, and a single default model. Optional infrastructure and extra providers improve the product without making the demo brittle.
Decisions
- Desktop OS metaphor — The OS metaphor costs more to build, so it has to carry real weight. Here it turns navigation into evidence: visitors can inspect apps, move through tools, open traces, and see how the system behaves instead of only reading claims about it.
- Inspectable agent surface — Ask Elijah needed to prove judgment, not just produce fluent answers. Citations, tool traces, rejected chunks, source links, cost, and evals make the assistant reviewable by the same visitor it is trying to help.
- BM25 baseline then hybrid retrieval — BM25 made the first system deterministic and easy to inspect. Once the corpus, embeddings, and eval cases were in place, hybrid retrieval added semantic recall without throwing away the sparse channel that makes failures understandable.
- Model-agnostic provider layer — Generation, grading, and embeddings each sit behind a small adapter chosen by environment. OpenAI answers by default, a weak grade can escalate the same turn to a stronger Anthropic model, and changing providers is a config edit instead of a refactor. The trace records which model actually answered, so the abstraction stays honest rather than decorative.
- Graceful optional infrastructure — The portfolio has to survive previews, local development, and missing secrets. Postgres, embeddings, leaderboards, and experiment persistence can improve the experience, but disabled modes and fallbacks keep the core product intact.
- Typed source content reused across surfaces — The same facts power project cards, app content, retrieval chunks, citations, and the case study. Keeping that content in typed source files makes it versioned, testable, diffable, and harder for the assistant to contradict.
- In-app traces and evals — For this product, observability is part of the user experience. The trace and eval tabs make the AI system's behavior visible where the claim is being made, which is more persuasive than a private dashboard nobody can inspect.
- Typed WebMCP tools over page state — However well Ask Elijah cited, a visitor was still talking to the candidate's own model. WebMCP inverts that: the visitor's agent does the reasoning through ten small typed tools over the same live workspace — six read-only, every mutation visible. DOM automation lost because an OS metaphor is exactly where scraping is most brittle.
Stack
- Next.js 16 App Router — App shell, metadata, and route handlers: Keeps the portfolio shell, APIs, streaming routes, and production metadata in one deployable app.
- React 19 — Interactive app runtime: The OS metaphor depends on stateful, composable UI surfaces rather than static pages.
- React Three Fiber + Three.js + GLSL — WebGL particle field: Adds a GPU-backed ambient layer while keeping the scene integrated with the React component model.
- Zustand — Window, widget, and Ask state: Small client stores handle focus, drag, resize, app launch, widgets, traces, and chat state without heavier app framework machinery.
- Tailwind 4 + CSS tokens — Visual system: The UI needs shared tokens plus plain CSS control for windows, apps, widgets, mobile, and case-study surfaces.
- OpenAI + Anthropic SDKs — Model-agnostic generation: The default chat model is OpenAI’s gpt-6.2-sol. The shared interface also supports Anthropic. The trace records which model answered, including when an optional second pass replaces the first.
- BM25 + Hybrid RRF retrieval — Sparse and dense evidence retrieval: BM25 keeps matching inspectable; dense embeddings improve semantic recall; RRF fuses both without hiding the individual signals.
- OpenAI embeddings — Dense query and chunk vectors: The semantic channel gives Ask Elijah a better shot at paraphrased questions that do not share exact keywords with the source.
- Vercel Postgres pgvector — Optional managed vector store: Production can serve vector search from Postgres when configured, while local and preview paths retain fallbacks.
- SSE streaming — Chat response transport: Visitors see the answer stream while traces, tool events, and completion metadata stay attached to the same turn.
- Per-IP + global rate limits — Abuse and cost guardrails: A sliding per-IP window plus a per-instance circuit breaker keep the public assistant from being trivially drained, and deterministic refusals reject prompt-injection before the model is ever called.
- WebMCP (ModelContext API) — Page-scoped agent tool surface: Ten typed tools registered through navigator.modelContext (document fallback) let a visitor's agent search evidence and compose the live workspace — client-side only, while the normal interface remains usable when no host exists.
- node:test + Playwright + evals — Verification suite: Unit tests cover the runtime, Playwright checks responsive behavior and drives the WebMCP tools through an injected fake ModelContext host, and executable acceptance fixtures replay planned agent journeys through the real dispatcher.