chore:split documents
This commit is contained in:
parent
86fb6a7630
commit
a7a545d09f
5 changed files with 35 additions and 35 deletions
22
README.md
22
README.md
|
|
@ -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.**
|
||||
|
||||
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
|
||||
|
||||
|
|
@ -18,7 +18,7 @@ Este es un chatbot basado en [`go-llm-agent`](https://github.com/VictorVargas/go
|
|||
|
||||
```bash
|
||||
# 1. Instalar
|
||||
git clone https://github.com/VictorVargas/chat-bot.git
|
||||
git clone https://github.com/VictorVargas/rony-chat-bot.git
|
||||
cd chat-bot
|
||||
|
||||
# 2. Resolver dependencias (crea go.sum con hashes)
|
||||
|
|
@ -43,7 +43,7 @@ go build -o bin/chat-bot ./cmd/chat-bot
|
|||
|
||||
```
|
||||
chat-bot/
|
||||
├── cmd/chat-bot/ # Entry point (CLI)
|
||||
├── cm./rony-chat-bot/ # Entry point (CLI)
|
||||
├── internal/
|
||||
│ ├── server/ # HTTP handlers + SSE
|
||||
│ ├── portfolio/ # Data loader (markdown → RAG)
|
||||
|
|
@ -51,13 +51,13 @@ chat-bot/
|
|||
│ └── streaming/ # SSE helpers
|
||||
├── data/projects/ # ← TUS PROYECTOS EN MARKDOWN
|
||||
│ ├── rony-tui.md
|
||||
│ ├── go-llm-agent.md
|
||||
│ ├── rony-llm-agent.md
|
||||
│ └── ...
|
||||
├── configs/
|
||||
│ └── portfolio-bot.yaml # Provider config
|
||||
├── docs/
|
||||
│ └── architecture.md # ← Especificación técnica completa
|
||||
└── go.mod # require go-llm-agent
|
||||
└── go.mod # require rony-llm-agent
|
||||
```
|
||||
|
||||
## 🎯 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
|
||||
4. Deploy
|
||||
|
||||
La librería `go-llm-agent` no cambia.
|
||||
La librería `rony-llm-agent` no cambia.
|
||||
|
||||
## 📚 Documentación
|
||||
|
||||
- [**Architecture doc**](./docs/architecture.md) — Especificación técnica completa
|
||||
- [Library: `go-llm-agent`](https://github.com/VictorVargas/go-llm-agent) — Core reutilizable
|
||||
- [Harness](https://github.com/VictorVargas/harness) — El otro proyecto que usa la misma librería
|
||||
- [Library: `rony-llm-agent`](https://github.com/VictorVargas/rony-llm-agent) — Core reutilizable
|
||||
- [Harness](https://github.com/VictorVargas/rony-harness) — El otro proyecto que usa la misma librería
|
||||
|
||||
## 📄 Licencia
|
||||
|
||||
|
|
@ -101,6 +101,6 @@ MIT — ver [`LICENSE`](./LICENSE).
|
|||
|
||||
## 🔗 Proyectos del workspace
|
||||
|
||||
- [`go-llm-agent`](https://github.com/VictorVargas/go-llm-agent) — Librería core
|
||||
- [`harness`](https://github.com/VictorVargas/harness) — AI agent harness (TUI)
|
||||
- [`rony-llm-agent`](https://github.com/VictorVargas/rony-llm-agent) — Librería core
|
||||
- [`harness`](https://github.com/VictorVargas/rony-harness) — AI agent harness (TUI)
|
||||
- [`portfolio`](https://github.com/VictorVargas/portfolio) — Astro + React site (integra este bot)
|
||||
|
|
@ -1,5 +1,5 @@
|
|||
# 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:
|
||||
host: "0.0.0.0"
|
||||
|
|
@ -48,7 +48,7 @@ rag:
|
|||
|
||||
# Persona: quién es el bot
|
||||
persona:
|
||||
name: "Asistente de Victor Hugo Vargas"
|
||||
name: "Rony Chat Bot"
|
||||
tone: "Profesional, conocedor, amable"
|
||||
language: "Español"
|
||||
constraints:
|
||||
|
|
@ -56,11 +56,11 @@ persona:
|
|||
- "Si no sabes, decir 'No tengo esa información'"
|
||||
- "Ser conciso pero informativo"
|
||||
- "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: |
|
||||
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:
|
||||
- Los proyectos de Victor (ver archivos en data/projects/)
|
||||
|
|
|
|||
|
|
@ -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`
|
||||
- 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)
|
||||
|
||||
|
|
@ -16,7 +16,7 @@ title: "Rony TUI"
|
|||
date: 2026-06
|
||||
status: "active" # active | archived | wip
|
||||
tags: ["go", "ai", "cli"]
|
||||
repo: "https://github.com/VictorVargas/harness"
|
||||
repo: "https://github.com/VictorVargas/rony-harness"
|
||||
demo: "https://..." # opcional
|
||||
---
|
||||
|
||||
|
|
|
|||
|
|
@ -4,11 +4,11 @@
|
|||
**Autor:** Victor Hugo Vargas
|
||||
**Fecha:** 2026-06-28
|
||||
**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).
|
||||
>
|
||||
> 🔑 **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
|
||||
- **Portable** — fácil de fork/customizar para otros contextos
|
||||
- **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 │
|
||||
│ Chat-Bot HTTP server (:7331) │
|
||||
│ ↓ │
|
||||
│ Agent loop (go-llm-agent) │
|
||||
│ Agent loop (rony-llm-agent) │
|
||||
│ ↓ │
|
||||
│ 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 |
|
||||
|---|---|---|
|
||||
| **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 |
|
||||
| **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
|
||||
|
||||
|
|
@ -114,7 +114,7 @@ data: {"type":"chunk","content":" tiene"}
|
|||
data: {"type":"chunk","content":" varios"}
|
||||
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}}
|
||||
```
|
||||
|
|
@ -123,7 +123,7 @@ data: {"type":"done","usage":{"input_tokens":245,"output_tokens":38}}
|
|||
```json
|
||||
{
|
||||
"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}
|
||||
}
|
||||
```
|
||||
|
|
@ -178,7 +178,7 @@ import (
|
|||
"encoding/json"
|
||||
"fmt"
|
||||
"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) {
|
||||
|
|
@ -337,7 +337,7 @@ import (
|
|||
"os"
|
||||
"path/filepath"
|
||||
"strings"
|
||||
"github.com/VictorVargas/go-llm-agent/pkg/rag"
|
||||
"github.com/VictorVargas/rony-llm-agent/pkg/rag"
|
||||
)
|
||||
|
||||
type Indexer struct {
|
||||
|
|
@ -669,7 +669,7 @@ providers:
|
|||
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
|
||||
|
||||
```go
|
||||
// cmd/chat-bot/main.go
|
||||
// cm./rony-chat-bot/main.go
|
||||
package main
|
||||
|
||||
import (
|
||||
|
|
@ -860,7 +860,7 @@ func TestRunner_RAGContextIsInjected(t *testing.T) {
|
|||
|
||||
memory := newMockMemoryWithDocs(t, []rag.Fragment{
|
||||
{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{
|
||||
|
|
@ -876,7 +876,7 @@ func TestRunner_RAGContextIsInjected(t *testing.T) {
|
|||
// Verify LLM received context chunks in system prompt
|
||||
lastReq := mockLLM.LastRequest()
|
||||
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
|
||||
│ │ └── sse.go # SSE helpers
|
||||
│ │
|
||||
│ ├── agent/ # Wrapper sobre go-llm-agent
|
||||
│ ├── agent/ # Wrapper sobre rony-llm-agent
|
||||
│ │ ├── runner.go # RunStream con RAG injection
|
||||
│ │ └── prompts.go # System prompt builder
|
||||
│ │
|
||||
|
|
@ -931,7 +931,7 @@ chat-bot/
|
|||
├── data/
|
||||
│ └── projects/ # ← Markdown por proyecto
|
||||
│ ├── rony-tui.md
|
||||
│ ├── go-llm-agent.md
|
||||
│ ├── rony-llm-agent.md
|
||||
│ └── example-project.md
|
||||
│
|
||||
├── configs/
|
||||
|
|
@ -1032,7 +1032,7 @@ chat-bot/
|
|||
- **nomic-embed-text:** https://huggingface.co/nomic-ai/nomic-embed-text-v1.5
|
||||
- **qwen2.5:** https://huggingface.co/Qwen/Qwen2.5-1.5B-Instruct
|
||||
- **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
2
go.mod
|
|
@ -1,3 +1,3 @@
|
|||
module github.com/VictorVargas/chat-bot
|
||||
module github.com/VictorVargas/rony-chat-bot
|
||||
|
||||
go 1.26
|
||||
Loading…
Reference in a new issue