A personal intelligence engine that turns your portfolio and experience into an interactive, context-aware conversational agent. It uses first-person perspective to answer questions about your background, projects, and experience as if it were you.
- Framework: Next.js 16 (App Router)
- Language: TypeScript
- Styling: Tailwind CSS v4
- AI Models:
- LLM: Groq (Llama-3.3-70b-versatile)
- Embeddings: Google Generative AI (
gemini-embedding-001)
- Vector Database: DataStax Astra DB
- State Management: Vercel AI SDK
The application follows a RAG (Retrieval-Augmented Generation) pipeline:
-
Ingestion (
scripts/loadYaml.ts):- Recursively walks
career_brain/directory. - Parses YAML files (facts, projects, roles).
- Generates embeddings using Google's
gemini-embedding-001. - Stores text chunks + vectors in Astra DB.
- Recursively walks
-
Retrieval (
lib/astra.ts):- On user query, generates a query embedding.
- Performs a cosine similarity search in Astra DB.
- Retrieves the top 5 most relevant context chunks.
-
Generation (
app/api/chat/route.ts):- Constructs a strict system prompt defining the "Islam Hafez" persona.
- Injects the retrieved context.
- Streams the response from Groq's
llama-3.3-70b-versatilemodel.