HTTP chatbot for Q&A
Find a file
Victor Hugo Vargas 550ba526c4 feat(sse): emit compaction event after start, before sources/chunk
streaming.WriteCompaction packages a 'compaction' event with the
kept/older turn counts, summary tokens and provider-reported
window/used tokens so the client can hint 'context optimized' to the
user without parsing the stream body.

streamChat runs Compact before BuildMessages and writes the event
right after start, ensuring the client sees it before any chunk is
emitted. Add a runner test that exercises limitRAGContext to keep
the system prompt + RAG block under the configured window.
2026-07-18 00:08:22 -07:00
bench feat: bootstrap rony-chat-bot Go module 2026-07-17 00:56:06 -07:00
cmd/chat-bot feat(config): add auto-compaction block and CLI wiring 2026-07-18 00:07:41 -07:00
configs feat(config): add auto-compaction block and CLI wiring 2026-07-18 00:07:41 -07:00
data/projects feat: bootstrap rony-chat-bot Go module 2026-07-17 00:56:06 -07:00
docs feat: persistent conversation storage (Phase 4) 2026-07-17 00:56:35 -07:00
internal feat(sse): emit compaction event after start, before sources/chunk 2026-07-18 00:08:22 -07:00
web feat: persistent conversation storage (Phase 4) 2026-07-17 00:56:35 -07:00
.gitignore chore: ignore compiled binaries in /bin/ 2026-07-17 00:56:51 -07:00
go.mod feat: bootstrap rony-chat-bot Go module 2026-07-17 00:56:06 -07:00
go.sum feat: bootstrap rony-chat-bot Go module 2026-07-17 00:56:06 -07:00
LICENSE chore: initial scaffold with design docs 2026-06-28 16:13:21 -07:00
README.es.md feat: bootstrap rony-chat-bot Go module 2026-07-17 00:56:06 -07:00
README.md feat: bootstrap rony-chat-bot Go module 2026-07-17 00:56:06 -07:00

Rony Chat Bot — HTTP Portfolio Bot

🌐 Language: English | Español

🤖 HTTP chatbot that presents your portfolio and answers questions about your projects.

Rony Chat Bot is a chatbot based on rony-llm-agent that integrates with an Astro/React site to answer questions about Victor Hugo Vargas and his projects, using RAG over markdown files.

Features

  • 🌐 HTTP server with SSE (Server-Sent Events) streaming
  • 🧠 RAG over markdown — automatically indexes .md in data/projects/ (SQLite FTS5, no embeddings)
  • 🎭 Customizable persona — responds as "Victor's assistant"
  • Self-hosted with llama.cpp (default) or Ollama (no cloud API key required)
  • 💬 Drop-in chat widget — vanilla JS, no build step, works in any site
  • 🛡️ Rate limiting and structured logging
  • 📦 Portable — adaptable to other contexts (clients, products, etc.)

🚀 Quick start

# 1. Install
git clone https://github.com/VictorVargas/rony-chat-bot.git
cd rony-chat-bot

# 2. Resolve dependencies (creates go.sum with hashes)
go mod tidy

# 3. Configure provider (llama.cpp by default)
# Download a GGUF model, e.g.:
#   https://huggingface.co/Qwen/Qwen2.5-1.5B-Instruct-GGUF
export RONY_MODELS_PATH=/path/to/models

# 4. Load your projects in data/projects/
echo "# My Cool Project\nDescription..." > data/projects/my-project.md

# 5. Build
go build -o bin/chat-bot ./cmd/chat-bot

# 6. Run
./bin/chat-bot serve
# → Serves on http://localhost:7331

📁 Structure

rony-chat-bot/
├── cmd/chat-bot/             # Entry point (CLI)
├── internal/
│   ├── server/               # HTTP handlers + SSE
│   ├── agent/                # LLM client + RAG + persona runner
│   ├── portfolio/            # Data loader (markdown → RAG)
│   ├── persona/              # Persona override
│   ├── streaming/            # SSE helpers
│   └── i18n/                 # Language detection (EN/ES)
├── web/                      # ← DROP-IN CHAT WIDGET
│   ├── chat-widget.js
│   ├── chat-widget.css
│   └── example.html
├── data/projects/            # ← YOUR PROJECTS IN MARKDOWN
│   ├── rony-harness.md
│   ├── rony-llm-agent.md
│   └── ...
├── configs/
│   └── portfolio-bot.yaml    # Provider + RAG + persona config
├── docs/
│   └── architecture.md        # ← Complete technical specification
└── go.mod                     # require rony-llm-agent

🎯 Embed in any site

The bot ships with a drop-in chat widget. Add two files and a <script> tag:

<link rel="stylesheet" href="/chat-widget.css">
<script src="/chat-widget.js"
        data-api-url="https://chat.example.com"
        data-title="Ask me anything"
        data-position="bottom-right"
        data-theme="auto"
        defer></script>

See web/README.md for the full configuration reference and Astro/Next.js integration snippets. Full architecture in docs/architecture.md §5.

🔄 Adapt to another client

This bot is designed to be atomic and reusable. To adapt it (e.g., chatbot for a car dealership):

  1. Fork/clone this repo
  2. Replace data/projects/ with data/inventory/ (or another domain)
  3. Update configs/portfolio-bot.yaml with the new persona
  4. Deploy

The rony-llm-agent library doesn't change.

📚 Documentation

📄 License

MIT — see LICENSE.

🔗 Workspace projects