chore:split documents

This commit is contained in:
Victor Hugo Vargas Servin 2026-06-28 23:24:22 -07:00
parent 86fb6a7630
commit a7a545d09f
5 changed files with 35 additions and 35 deletions

View file

@ -1,8 +1,8 @@
# Chat-Bot — Portfolio Bot HTTP # Rony Chat Bot — Portfolio Bot HTTP
> 🤖 **Chatbot HTTP que presenta tu portfolio y responde preguntas sobre tus proyectos.** > 🤖 **Chatbot HTTP que presenta tu portfolio y responde preguntas sobre tus proyectos.**
Este es un chatbot basado en [`go-llm-agent`](https://github.com/VictorVargas/go-llm-agent) que se integra con un sitio Astro/React para responder preguntas sobre Victor Hugo Vargas y sus proyectos, usando **RAG sobre archivos markdown**. **Rony Chat Bot** es un chatbot basado en [`rony-llm-agent`](https://github.com/VictorVargas/rony-llm-agent) que se integra con un sitio Astro/React para responder preguntas sobre Victor Hugo Vargas y sus proyectos, usando **RAG sobre archivos markdown**.
## ✨ Features ## ✨ Features
@ -18,7 +18,7 @@ Este es un chatbot basado en [`go-llm-agent`](https://github.com/VictorVargas/go
```bash ```bash
# 1. Instalar # 1. Instalar
git clone https://github.com/VictorVargas/chat-bot.git git clone https://github.com/VictorVargas/rony-chat-bot.git
cd chat-bot cd chat-bot
# 2. Resolver dependencias (crea go.sum con hashes) # 2. Resolver dependencias (crea go.sum con hashes)
@ -43,7 +43,7 @@ go build -o bin/chat-bot ./cmd/chat-bot
``` ```
chat-bot/ chat-bot/
├── cmd/chat-bot/ # Entry point (CLI) ├── cm./rony-chat-bot/ # Entry point (CLI)
├── internal/ ├── internal/
│ ├── server/ # HTTP handlers + SSE │ ├── server/ # HTTP handlers + SSE
│ ├── portfolio/ # Data loader (markdown → RAG) │ ├── portfolio/ # Data loader (markdown → RAG)
@ -51,13 +51,13 @@ chat-bot/
│ └── streaming/ # SSE helpers │ └── streaming/ # SSE helpers
├── data/projects/ # ← TUS PROYECTOS EN MARKDOWN ├── data/projects/ # ← TUS PROYECTOS EN MARKDOWN
│ ├── rony-tui.md │ ├── rony-tui.md
│ ├── go-llm-agent.md │ ├── rony-llm-agent.md
│ └── ... │ └── ...
├── configs/ ├── configs/
│ └── portfolio-bot.yaml # Provider config │ └── portfolio-bot.yaml # Provider config
├── docs/ ├── docs/
│ └── architecture.md # ← Especificación técnica completa │ └── architecture.md # ← Especificación técnica completa
└── go.mod # require go-llm-agent └── go.mod # require rony-llm-agent
``` ```
## 🎯 Uso desde Astro ## 🎯 Uso desde Astro
@ -87,13 +87,13 @@ Este bot está diseñado para ser **atómico** y reusable. Para adaptarlo (ej. c
3. Actualiza `configs/portfolio-bot.yaml` con la nueva persona 3. Actualiza `configs/portfolio-bot.yaml` con la nueva persona
4. Deploy 4. Deploy
La librería `go-llm-agent` no cambia. La librería `rony-llm-agent` no cambia.
## 📚 Documentación ## 📚 Documentación
- [**Architecture doc**](./docs/architecture.md) — Especificación técnica completa - [**Architecture doc**](./docs/architecture.md) — Especificación técnica completa
- [Library: `go-llm-agent`](https://github.com/VictorVargas/go-llm-agent) — Core reutilizable - [Library: `rony-llm-agent`](https://github.com/VictorVargas/rony-llm-agent) — Core reutilizable
- [Harness](https://github.com/VictorVargas/harness) — El otro proyecto que usa la misma librería - [Harness](https://github.com/VictorVargas/rony-harness) — El otro proyecto que usa la misma librería
## 📄 Licencia ## 📄 Licencia
@ -101,6 +101,6 @@ MIT — ver [`LICENSE`](./LICENSE).
## 🔗 Proyectos del workspace ## 🔗 Proyectos del workspace
- [`go-llm-agent`](https://github.com/VictorVargas/go-llm-agent) — Librería core - [`rony-llm-agent`](https://github.com/VictorVargas/rony-llm-agent) — Librería core
- [`harness`](https://github.com/VictorVargas/harness) — AI agent harness (TUI) - [`harness`](https://github.com/VictorVargas/rony-harness) — AI agent harness (TUI)
- [`portfolio`](https://github.com/VictorVargas/portfolio) — Astro + React site (integra este bot) - [`portfolio`](https://github.com/VictorVargas/portfolio) — Astro + React site (integra este bot)

View file

@ -1,5 +1,5 @@
# Configuración del Portfolio Bot # Configuración del Portfolio Bot
# Documentación: https://github.com/VictorVargas/go-llm-agent/pkg/llm # Documentación: https://github.com/VictorVargas/rony-llm-agent/pkg/llm
server: server:
host: "0.0.0.0" host: "0.0.0.0"
@ -48,7 +48,7 @@ rag:
# Persona: quién es el bot # Persona: quién es el bot
persona: persona:
name: "Asistente de Victor Hugo Vargas" name: "Rony Chat Bot"
tone: "Profesional, conocedor, amable" tone: "Profesional, conocedor, amable"
language: "Español" language: "Español"
constraints: constraints:
@ -56,11 +56,11 @@ persona:
- "Si no sabes, decir 'No tengo esa información'" - "Si no sabes, decir 'No tengo esa información'"
- "Ser conciso pero informativo" - "Ser conciso pero informativo"
- "Usar formato markdown para listas y código" - "Usar formato markdown para listas y código"
intro: "¡Hola! Soy el asistente virtual de Victor Hugo Vargas. Pregúntame sobre sus proyectos, skills o experiencia." intro: "¡Hola! Soy Rony, el asistente virtual de Victor Hugo Vargas. Pregúntame sobre sus proyectos, skills o experiencia."
# System prompt base (concatenado con el contenido RAG) # System prompt base (concatenado con el contenido RAG)
system_prompt: | system_prompt: |
Eres el asistente virtual de Victor Hugo Vargas, un ingeniero de software mexicano. Eres Rony Chat Bot, el asistente virtual de Victor Hugo Vargas, un ingeniero de software mexicano.
Tu trabajo es responder preguntas sobre: Tu trabajo es responder preguntas sobre:
- Los proyectos de Victor (ver archivos en data/projects/) - Los proyectos de Victor (ver archivos en data/projects/)

View file

@ -6,7 +6,7 @@ Coloca aquí un archivo `.md` por cada proyecto que quieras que el bot pueda res
- Un archivo por proyecto: `nombre-del-proyecto.md` - Un archivo por proyecto: `nombre-del-proyecto.md`
- Nombre en kebab-case (minúsculas con guiones) - Nombre en kebab-case (minúsculas con guiones)
- Ejemplo: `rony-tui.md`, `go-llm-agent.md`, `portfolio-astro.md` - Ejemplo: `rony-tui.md`, `rony-llm-agent.md`, `portfolio-astro.md`
## Frontmatter (opcional pero recomendado) ## Frontmatter (opcional pero recomendado)
@ -16,7 +16,7 @@ title: "Rony TUI"
date: 2026-06 date: 2026-06
status: "active" # active | archived | wip status: "active" # active | archived | wip
tags: ["go", "ai", "cli"] tags: ["go", "ai", "cli"]
repo: "https://github.com/VictorVargas/harness" repo: "https://github.com/VictorVargas/rony-harness"
demo: "https://..." # opcional demo: "https://..." # opcional
--- ---

View file

@ -4,11 +4,11 @@
**Autor:** Victor Hugo Vargas **Autor:** Victor Hugo Vargas
**Fecha:** 2026-06-28 **Fecha:** 2026-06-28
**Estado:** Especificación completa para implementación **Estado:** Especificación completa para implementación
**Path:** `chat-bot/docs/architecture.md` **Path:** `rony-chat-bot/docs/architecture.md`
> 📚 **Workspace:** Este proyecto es parte del workspace `Rony/`. Ver [`../README.md`](../../README.md). > 📚 **Workspace:** Este proyecto es parte del workspace `Rony/`. Ver [`../README.md`](../../README.md).
> >
> 🔑 **Depende de:** [`go-llm-agent`](https://github.com/VictorVargas/go-llm-agent) — librería core que provee agent loop, LLM clients, RAG, persona system. > 🔑 **Depende de:** [`rony-llm-agent`](https://github.com/VictorVargas/rony-llm-agent) — librería core que provee agent loop, LLM clients, RAG, persona system.
--- ---
@ -40,7 +40,7 @@ El bot responde con información precisa extraída de los archivos markdown de p
- **Cloud opcional** — si se necesita más calidad, swap a Anthropic API - **Cloud opcional** — si se necesita más calidad, swap a Anthropic API
- **Portable** — fácil de fork/customizar para otros contextos - **Portable** — fácil de fork/customizar para otros contextos
- **Streaming** — respuestas token-por-token con SSE (no espera a respuesta completa) - **Streaming** — respuestas token-por-token con SSE (no espera a respuesta completa)
- **Reutiliza `go-llm-agent`** — no reinventar el agent loop - **Reutiliza `rony-llm-agent`** — no reinventar el agent loop
--- ---
@ -56,7 +56,7 @@ El bot responde con información precisa extraída de los archivos markdown de p
│ ↓ HTTP POST /api/chat │ │ ↓ HTTP POST /api/chat │
│ Chat-Bot HTTP server (:7331) │ │ Chat-Bot HTTP server (:7331) │
│ ↓ │ │ ↓ │
│ Agent loop (go-llm-agent) │ │ Agent loop (rony-llm-agent) │
│ ↓ │ │ ↓ │
│ RAG retrieval → ChromaDB sobre data/projects/*.md │ │ RAG retrieval → ChromaDB sobre data/projects/*.md │
│ ↓ │ │ ↓ │
@ -69,10 +69,10 @@ El bot responde con información precisa extraída de los archivos markdown de p
| Componente | Path | Responsabilidad | | Componente | Path | Responsabilidad |
|---|---|---| |---|---|---|
| **HTTP server** | `internal/server/` | Gin/chi handlers, SSE streaming | | **HTTP server** | `internal/server/` | Gin/chi handlers, SSE streaming |
| **Agent runner** | `internal/agent/` | Wrapper sobre `go-llm-agent` con config específica | | **Agent runner** | `internal/agent/` | Wrapper sobre `rony-llm-agent` con config específica |
| **Portfolio loader** | `internal/portfolio/` | Lee `data/projects/*.md`, indexa en ChromaDB | | **Portfolio loader** | `internal/portfolio/` | Lee `data/projects/*.md`, indexa en ChromaDB |
| **Persona** | `internal/persona/` | Carga persona desde `configs/portfolio-bot.yaml` | | **Persona** | `internal/persona/` | Carga persona desde `configs/portfolio-bot.yaml` |
| **CLI** | `cmd/chat-bot/` | Comandos: `serve`, `reindex`, `ask`, `version` | | **CLI** | `cm./rony-chat-bot/` | Comandos: `serve`, `reindex`, `ask`, `version` |
### 2.3 Stack tecnológico ### 2.3 Stack tecnológico
@ -114,7 +114,7 @@ data: {"type":"chunk","content":" tiene"}
data: {"type":"chunk","content":" varios"} data: {"type":"chunk","content":" varios"}
data: {"type":"chunk","content":" proyectos"} data: {"type":"chunk","content":" proyectos"}
data: {"type":"sources","documents":["rony-tui.md","go-llm-agent.md"]} data: {"type":"sources","documents":["rony-tui.md","rony-llm-agent.md"]}
data: {"type":"done","usage":{"input_tokens":245,"output_tokens":38}} data: {"type":"done","usage":{"input_tokens":245,"output_tokens":38}}
``` ```
@ -123,7 +123,7 @@ data: {"type":"done","usage":{"input_tokens":245,"output_tokens":38}}
```json ```json
{ {
"content": "Victor tiene varios proyectos...", "content": "Victor tiene varios proyectos...",
"sources": ["rony-tui.md", "go-llm-agent.md"], "sources": ["rony-tui.md", "rony-llm-agent.md"],
"usage": {"input_tokens": 245, "output_tokens": 38} "usage": {"input_tokens": 245, "output_tokens": 38}
} }
``` ```
@ -178,7 +178,7 @@ import (
"encoding/json" "encoding/json"
"fmt" "fmt"
"net/http" "net/http"
"github.com/VictorVargas/go-llm-agent/pkg/agent" "github.com/VictorVargas/rony-llm-agent/pkg/agent"
) )
func (s *Server) handleChat(w http.ResponseWriter, r *http.Request) { func (s *Server) handleChat(w http.ResponseWriter, r *http.Request) {
@ -337,7 +337,7 @@ import (
"os" "os"
"path/filepath" "path/filepath"
"strings" "strings"
"github.com/VictorVargas/go-llm-agent/pkg/rag" "github.com/VictorVargas/rony-llm-agent/pkg/rag"
) )
type Indexer struct { type Indexer struct {
@ -669,7 +669,7 @@ providers:
default: true default: true
``` ```
El adapter `llamacpp` se importa desde `go-llm-agent/pkg/llm/providers/llamacpp` y se compila contra `llama.cpp` vía CGO o binario externo. El adapter `llamacpp` se importa desde `rony-llm-agent/pkg/llm/providers/llamacpp` y se compila contra `llama.cpp` vía CGO o binario externo.
--- ---
@ -700,7 +700,7 @@ chat-bot version
### 7.2 Implementación con Cobra ### 7.2 Implementación con Cobra
```go ```go
// cmd/chat-bot/main.go // cm./rony-chat-bot/main.go
package main package main
import ( import (
@ -860,7 +860,7 @@ func TestRunner_RAGContextIsInjected(t *testing.T) {
memory := newMockMemoryWithDocs(t, []rag.Fragment{ memory := newMockMemoryWithDocs(t, []rag.Fragment{
{Content: "Rony TUI: AI agent harness...", ProjectID: "rony-tui"}, {Content: "Rony TUI: AI agent harness...", ProjectID: "rony-tui"},
{Content: "go-llm-agent: librería Go...", ProjectID: "go-llm-agent"}, {Content: "rony-llm-agent: librería Go...", ProjectID: "rony-llm-agent"},
}) })
runner := agent.NewRunner(agent.Config{ runner := agent.NewRunner(agent.Config{
@ -876,7 +876,7 @@ func TestRunner_RAGContextIsInjected(t *testing.T) {
// Verify LLM received context chunks in system prompt // Verify LLM received context chunks in system prompt
lastReq := mockLLM.LastRequest() lastReq := mockLLM.LastRequest()
assert.Contains(t, lastReq.Messages[0].Content, "Rony TUI") assert.Contains(t, lastReq.Messages[0].Content, "Rony TUI")
assert.Contains(t, lastReq.Messages[0].Content, "go-llm-agent") assert.Contains(t, lastReq.Messages[0].Content, "rony-llm-agent")
} }
``` ```
@ -916,7 +916,7 @@ chat-bot/
│ │ ├── middleware.go # logging, CORS, rate limit │ │ ├── middleware.go # logging, CORS, rate limit
│ │ └── sse.go # SSE helpers │ │ └── sse.go # SSE helpers
│ │ │ │
│ ├── agent/ # Wrapper sobre go-llm-agent │ ├── agent/ # Wrapper sobre rony-llm-agent
│ │ ├── runner.go # RunStream con RAG injection │ │ ├── runner.go # RunStream con RAG injection
│ │ └── prompts.go # System prompt builder │ │ └── prompts.go # System prompt builder
│ │ │ │
@ -931,7 +931,7 @@ chat-bot/
├── data/ ├── data/
│ └── projects/ # ← Markdown por proyecto │ └── projects/ # ← Markdown por proyecto
│ ├── rony-tui.md │ ├── rony-tui.md
│ ├── go-llm-agent.md │ ├── rony-llm-agent.md
│ └── example-project.md │ └── example-project.md
├── configs/ ├── configs/
@ -1032,7 +1032,7 @@ chat-bot/
- **nomic-embed-text:** https://huggingface.co/nomic-ai/nomic-embed-text-v1.5 - **nomic-embed-text:** https://huggingface.co/nomic-ai/nomic-embed-text-v1.5
- **qwen2.5:** https://huggingface.co/Qwen/Qwen2.5-1.5B-Instruct - **qwen2.5:** https://huggingface.co/Qwen/Qwen2.5-1.5B-Instruct
- **Astro API routes:** https://docs.astro.build/en/guides/endpoints/ - **Astro API routes:** https://docs.astro.build/en/guides/endpoints/
- **go-llm-agent:** https://github.com/VictorVargas/go-llm-agent - **rony-llm-agent:** https://github.com/VictorVargas/rony-llm-agent
--- ---

2
go.mod
View file

@ -1,3 +1,3 @@
module github.com/VictorVargas/chat-bot module github.com/VictorVargas/rony-chat-bot
go 1.26 go 1.26