Arkhe AI Assistant
Designed and implemented a production ready AI assistant that combines retrieval augmented generation, streaming responses, a consistent assistant persona, graceful fallback from vector search to static knowledge, and multiple layers of request validation and abuse protection while preserving Astro's mostly static architecture.
Arkhe is the AI assistant built into my portfolio. Visitors can ask about my experience, projects, technical decisions, and background in natural language instead of browsing every page manually. Every response is grounded in my documented work and follows the voice of the ARKÆS brand.
I designed and developed Arkhe end to end as a dedicated package inside the Arkaes monorepo. The goal was to explore retrieval augmented generation in a real product rather than a throwaway demo while keeping the experience consistent with the rest of the design system. The widget is implemented as a Lit custom element themed entirely with the same design tokens as the rest of the site, making it feel like a native part of the portfolio. It streams responses token by token, renders Markdown, offers starter prompts, preserves conversation state across page navigation, and is designed with accessibility and reduced motion in mind.
To preserve Astro's static architecture, the chatbot runs as the site's only server rendered route. This keeps the OpenAI API key securely on the server while every other page remains statically generated. The package is split into a client and server layer, where the client provides the chat interface and the server exposes a framework agnostic request handler that grounds the model in a portfolio knowledge base before streaming plain text responses back to the browser.
Grounding the model was the core of the project. Knowledge is retrieved from a Supabase pgvector store where portfolio content is chunked, embedded using OpenAI embeddings, and matched against each visitor question so responses stay rooted in real projects and case studies. If vector search is unavailable, the system gracefully falls back to a static knowledge base generated from the site's content collections, ensuring the assistant continues to function.
A significant part of the work focused on behavior rather than infrastructure. Arkhe follows a carefully designed persona that speaks about me in the third person, never impersonates me, stays within the scope of my documented work, and respects strict privacy boundaries around personal and confidential topics. The request handler also includes production focused safeguards such as rate limiting, origin validation, request size limits, message length limits, and HTTP method validation before the model is invoked.
This project brings together the areas I enjoy most: frontend architecture, thoughtful user experience, and practical AI integration. More than demonstrating retrieval augmented generation, it shows my approach to shipping production ready AI features with maintainable architecture, sensible safety boundaries, and a consistent brand experience.