# rony-llm-agent β€” Documentation > 🌐 **Language:** [English](./README.md) | [EspaΓ±ol](./README.es.md) Technical documentation for the library. ## πŸ“ Architecture ``` β”Œβ”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β” β”‚ rony-llm-agent (pkg/) β”‚ β”‚ β”‚ β”‚ β”Œβ”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β” β”Œβ”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β” β”Œβ”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β” β”‚ β”‚ β”‚ agent β”‚ β”‚ persona β”‚ β”‚ tools β”‚ β”‚ β”‚ β”‚ β”‚ β”‚ β”‚ β”‚ β”‚ β”‚ β”‚ β”‚ Agent loop │◄── Persona β”‚ β”‚ Tool registry β”‚ β”‚ β”‚ β”‚ with guard- β”‚ β”‚ + AGENTS.md β”‚ β”‚ + JSON Schema β”‚ β”‚ β”‚ β”‚ rails β”‚ β”‚ discovery β”‚ β”‚ + execution β”‚ β”‚ β”‚ β””β”€β”€β”€β”€β”€β”€β”¬β”€β”€β”€β”€β”€β”€β”€β”˜ β””β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”˜ β””β”€β”€β”€β”€β”€β”€β”€β”€β”¬β”€β”€β”€β”€β”€β”€β”€β”€β”€β”˜ β”‚ β”‚ β”‚ β”‚ β”‚ β”‚ β–Ό β–Ό β”‚ β”‚ β”Œβ”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β” β”Œβ”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β” β”‚ β”‚ β”‚ llm β”‚ β”‚ rag β”‚ β”‚ β”‚ β”‚ β”‚ β”‚ β”‚ β”‚ β”‚ β”‚ LLMClient β”‚ β”‚ Memory + β”‚ β”‚ β”‚ β”‚ interface + β”‚ β”‚ Embeddings β”‚ β”‚ β”‚ β”‚ providers β”‚ β”‚ + VectorDB β”‚ β”‚ β”‚ β””β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”˜ β””β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”˜ β”‚ β”‚ β”‚ β””β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”˜ ``` ## πŸ“¦ Packages | Package | Responsibility | Docs | |---|---|---| | `pkg/agent` | Iterative loop, termination conditions, approval gates | [View](../pkg/agent/README.md) | | `pkg/llm` | `LLMClient` interface, streaming, providers | [View](../pkg/llm/README.md) | | `pkg/rag` | Memory, embeddings, semantic search | [View](../pkg/rag/README.md) | | `pkg/persona` | System prompts, AGENTS.md, few-shot examples | [View](../pkg/persona/README.md) | | `pkg/tools` | Tool registry, JSON Schema, sandboxing | [View](../pkg/tools/README.md) | | `pkg/config` | YAML loading, precedence, env override | [View](../pkg/config/README.md) | ## 🎯 Design principles ### 1. Streaming-first Uses `iter.Seq2[T, error]` from Go 1.23+ for natural streaming: ```go for token, err := range llmClient.StreamTokens(ctx, req) { if err != nil { return err } fmt.Print(token) } ``` ### 2. Pure Hexagonal Each package exposes interfaces, concrete implementations are separated: ```go // pkg/rag/rag.go (port) type VectorDB interface { Search(ctx context.Context, embedding []float32, topK int) ([]Document, error) } // pkg/rag/backends/chroma/chroma.go (adapter) type ChromaDB struct { ... } func (c *ChromaDB) Search(...) { ... } ``` ### 3. Secure by default - `os.Root` for filesystem sandbox (Go 1.24+) - Approval gates before destructive tools - Bash sandbox with denylist + timeout - Optional network egress control ### 4. Zero magic No reflection, no code generation, no DSLs. Everything is idiomatic and explicit Go. ## πŸ”„ Versioning - **Strict semver** (`vMAJOR.MINOR.PATCH`) - **MAJOR**: breaking changes in `pkg/` (interfaces, signatures, public types) - **MINOR**: new features, new packages, new adapters - **PATCH**: bugfixes Private adapters (`pkg/llm/providers/openai/`) can change without a MAJOR bump if the `LLMClient` interface doesn't change. ## 🚧 Current status ⚠️ **This library is in active design.** The code is not implemented yet. The complete specification is in these docs (own of the library): - [`./architecture.md`](./architecture.md) β€” Core architecture (interfaces, agent loop, sandbox, security) - [`./components.md`](./components.md) β€” Reference per package - [`./phase2.md`](./phase2.md) β€” Advanced features (MCP, full RAG, Skills, Sub-agents, Observability) Once `rony-harness/` is implemented, this library will be extracted as real code, following these specs.