docs: add AI Chat Agent documentation and update README

- doc/28-AI-CHAT-AGENT.md: comprehensive technical documentation covering
  architecture, agent design, query_cv tool, HTMX integration, graceful
  degradation, security, and example conversations
- README.md: add AI Chat Agent section with examples, ADK Go badge,
  updated tech stack and documentation index
- doc/00-GO-DOCUMENTATION-INDEX.md: add chat agent to doc index
This commit is contained in:
juanatsap
2026-04-08 00:30:01 +01:00
parent f5276431ea
commit f67126e8c3
3 changed files with 292 additions and 4 deletions
+55 -4
View File
@@ -1,7 +1,9 @@
# CV Site - Go + HTMX
[![Go Version](https://img.shields.io/badge/Go-1.21%2B-00ADD8?logo=go)](https://go.dev/)
[![HTMX](https://img.shields.io/badge/HTMX-1.9.10-3366CC)](https://htmx.org/)
[![Go Version](https://img.shields.io/badge/Go-1.25%2B-00ADD8?logo=go)](https://go.dev/)
[![HTMX](https://img.shields.io/badge/HTMX-2.0-3366CC)](https://htmx.org/)
[![ADK Go](https://img.shields.io/badge/ADK_Go-1.0-4285F4?logo=google)](https://github.com/google/adk-go)
[![Gemini](https://img.shields.io/badge/Gemini_2.5_Flash-AI_Chat-8E75B2?logo=google)](https://aistudio.google.com/)
[![License](https://img.shields.io/badge/License-MIT-green.svg)](LICENSE)
**Modern, minimal curriculum vitae website** for Juan Andrés Moreno Rubio built with **Go** and **HTMX**.
@@ -19,6 +21,7 @@ A professional, bilingual CV site with server-side PDF generation, HTMX interact
## 📑 Table of Contents
- [Features](#-features)
- [AI Chat Agent](#-ai-chat-agent)
- [Demo](#-demo)
- [Security](#-security)
- [Quick Start](#-quick-start)
@@ -43,6 +46,7 @@ A professional, bilingual CV site with server-side PDF generation, HTMX interact
-**Zoom Control** - Adjustable zoom (25%-300%) with persistence across sessions
-**Responsive** - Mobile, tablet, and desktop friendly
-**JSON-Based Content** - Easy to update without touching code
-**AI Chat Agent** - Ask questions about the CV in natural language (powered by ADK Go + Gemini)
-**AI Development Section** - Showcases modern AI-assisted development skills
-**Fast & Lightweight** - Go backend with chromedp for PDF generation
-**Privacy-Friendly Analytics** - Self-hosted analytics (no third-party data sharing)
@@ -50,6 +54,50 @@ A professional, bilingual CV site with server-side PDF generation, HTMX interact
-**Production Ready** - Systemd service, CI/CD workflows, deployment guides
-**Developer Friendly** - Hot reload, clear code structure, comprehensive Makefile
## 🤖 AI Chat Agent
Visitors can ask questions about the CV through a floating chat widget — powered by [Google ADK Go 1.0](https://github.com/google/adk-go) and Gemini 2.5 Flash.
### How It Works
```
Visitor types question → HTMX POST /api/chat → ADK Agent runs query_cv tool
→ Tool searches cached CV JSON data → Agent formulates answer → HTML response
```
### Example Questions & Answers
| Question | Answer |
|----------|--------|
| *"How many Go projects has Juan built?"* | Lists 2 Go projects with descriptions |
| *"What companies has he worked at?"* | Lists all 11 companies |
| *"Does he have React experience?"* | Shows companies where React was used |
| *"¿Qué certificaciones tiene?"* | Lists certifications — answers in Spanish automatically |
### Key Design Decisions
- **Single agent, single tool** — the CV data is bounded; multi-agent orchestration would be over-engineering
- **Reads from the same data cache** the site uses — zero data duplication, always in sync
- **Graceful degradation** — no API key? Chat icon simply doesn't appear. Zero impact on the site
- **HTMX-native** — `hx-post` sends messages, responses are HTML fragments, no WebSocket needed
- **Language-aware** — the agent responds in whatever language the visitor writes in
### Setup
```bash
# Get a free API key from https://aistudio.google.com/apikey
echo "GOOGLE_API_KEY=your-key" >> .env
# Chat icon appears automatically on next server start
go run .
```
**Free tier:** 15 requests/minute — more than enough for a personal CV site.
**Full technical documentation:** [doc/28-AI-CHAT-AGENT.md](doc/28-AI-CHAT-AGENT.md)
---
## 📸 Demo
🔗 **Live Demo:** [https://juan.andres.morenorub.io/](https://juan.andres.morenorub.io/)
@@ -187,9 +235,10 @@ No code changes needed - just refresh browser!
## 🎯 Key Technologies
- **Backend:** Go 1.21+ (stdlib `net/http`, graceful shutdown)
- **Backend:** Go 1.25+ (stdlib `net/http`, graceful shutdown)
- **AI Agent:** Google ADK Go 1.0 + Gemini 2.5 Flash (conversational CV navigator)
- **PDF Generation:** chromedp (headless Chrome automation)
- **Frontend:** HTMX 1.9.10 (hypermedia-driven interactions)
- **Frontend:** HTMX 2.0 + Hyperscript (hypermedia-driven interactions)
- **Styling:** Custom CSS with Quicksand font from Google Fonts
- **Data:** JSON files for easy content management
- **Deployment:** Systemd service, manual binary, GitHub Actions CI/CD
@@ -206,6 +255,7 @@ This project includes comprehensive documentation organized by purpose:
### 🔧 Technical Reference
- **[ARCHITECTURE.md](doc/ARCHITECTURE.md)** - System design, patterns, and technical decisions
- **[API.md](doc/API.md)** - Complete HTTP API reference and HTMX integration
- **[AI-CHAT-AGENT.md](doc/28-AI-CHAT-AGENT.md)** - ADK Go agent architecture, tool design, and integration details
### 📋 Policies & Standards
- **[SECURITY.md](doc/9-SECURITY.md)** - Complete security architecture, implementation, and testing guide
@@ -323,6 +373,7 @@ This project is licensed under the **MIT License** - see the [LICENSE](LICENSE)
## 🙏 Acknowledgments
- **HTMX** - For making hypermedia-driven applications enjoyable
- **Google ADK Go** - For the production-grade agent framework
- **chromedp** - For reliable headless Chrome automation
- **Go Community** - For excellent standard library and tooling
- **AI Assistance** - For accelerating development and documentation