How muazz7/muaz-ai-portfolio works
Muaz AI Portfolio is a conversational portfolio: visitors ask about Mohammad Muaz, and the site streams grounded answers and interactive portfolio cards. The main path runs from the landing/chat interface through a validated, rate-limited API to either a configured model agent or local retrieval fallback, then returns text and tool events for browser rendering. README documents BM25 retrieval, persona prompting, provider options, and eight generative-UI capabilities. Sampled source confirms the route, stream client, and rendering boundary; some internal agent wiring is based on README documentation rather than inspected implementation.
Main entry points: route.ts Chat endpoint · agent.ts Tool-calling agent · page.tsx Landing page · use-portfolio-chat.ts Chat client
Components 24
Visitor experience
- Landing page
src/app/page.tsx - Chat route
src/app/chat/page.tsx - Chat view
src/components/chat/chat-view.tsx - Chat client
src/hooks/use-portfolio-chat.ts - Message display
src/components/chat/message-list.tsx - Tool renderer
src/components/chat/tool-renderer.tsx - Fluid background
src/lib/fluid-simulation.ts - Generative UI cards
src/components/tools
Chat service
- Chat endpoint
src/app/api/chat/route.ts - Stream protocol
src/lib/ai/protocol.ts - Rate limiter
src/lib/ai/rate-limit.ts
Answer engines
- Tool-calling agent
src/lib/ai/agent.ts - Local fallback
src/lib/ai/fallback.ts - BM25 retrieval
src/lib/ai/retrieval.ts - Persona prompt
src/lib/ai/system-prompt.ts - Provider adapter
src/lib/ai/provider.ts - Tool definitions
src/lib/ai/tools.ts
Portfolio content
- Knowledge corpus
src/lib/data/knowledge.ts - Profile data
src/lib/data/profile.ts - Project data
src/lib/data/projects.ts - Skills data
src/lib/data/skills.ts - Suggested questions
src/lib/data/questions.ts
Other components
- Visitor
- AI provider
Connections 26
- Visitor → Landing page: asks from
- Landing page → Chat route: opens chat
- Chat route → Chat view: renders
- Visitor → Chat view: chats in
- Chat view → Chat client: sends messages
- Chat client → Chat endpoint: POSTs messages
- Chat endpoint → Rate limiter: checks quota
- Chat endpoint → Tool-calling agent: dispatches when configured
- Chat endpoint → Local fallback: dispatches otherwise
- Chat endpoint → Stream protocol: encodes events
- Chat client → Stream protocol: decodes events
- Tool-calling agent → BM25 retrieval: retrieves notes
- BM25 retrieval → Knowledge corpus: scores corpus
- Tool-calling agent → Persona prompt: uses persona
- Tool-calling agent → Provider adapter: requests completion
- Provider adapter → AI provider: calls configured model
- Tool-calling agent → Tool definitions: executes selected tools
- Local fallback → BM25 retrieval: answers from notes
- Tool definitions → Profile data: reads profile
- Tool definitions → Project data: reads projects
- Tool definitions → Skills data: reads skills
- Chat client → Message display: updates conversation
- Message display → Tool renderer: renders invocations
- Tool renderer → Generative UI cards: mounts matching card
- Landing page → Suggested questions: shows suggestions
- Landing page → Fluid background: mounts background