✅ CURRENT: Phase 14 Complete - Web Interface & Mission Control Version: 0.14.1 | Crates: 22 | Tools: 40+ | Templates: 10 | Examples: 60+
Build experimental AI components with production-quality patterns for painless extraction
🔗 Navigation: ← Docs Hub | Project Home | User Guide | Technical Docs
📚 NOTICE: This guide is for developers working on or extending rs-llmspell itself. For using rs-llmspell in your applications, see the User Guide.
New contributor? Start here in 30 minutes:
- Read: 01-getting-started.md - Clone, build, verify (5 min)
⚠️ IMPORTANT: 07-feature-flags.md - Build system (Phase 10.17.5+)- Study: One of the 60+ examples in
examples/ - Test: Run
./scripts/quality/quality-check-fast.sh - Build: Follow patterns in 03-extending-components.md
📚 Scripts Documentation: See Scripts Overview for all automation tools
Start at 01, progress through 08 - each builds on the previous
Setup, architecture, first contribution
- Clone, build options (minimal/common/full), verify setup
- Architecture overview (21 crates: Foundation + Memory + Application)
- Core concepts: BaseAgent, sync bridge, llmspell-utils, security
- First contribution paths (7 learning tracks)
- Essential patterns: parameter extraction, error building, response building
- Performance targets: <10ms tools, <2ms memory, <8ms vector search
Time: 15 minutes | Prerequisites: None
Testing, quality gates, git workflow, CI/CD
- Testing system: categorization (unit/integration/external + component)
- Test patterns: tool, agent, RAG, memory, storage backend examples
- Quality gates: minimal/fast/full checks (./scripts/quality/)
- Git workflow: branch strategy, commit format, PR checklist
- CI/CD integration: GitHub Actions, Docker multi-stage builds
- Performance validation: profiling tools, benchmarks
Time: 30 minutes | Prerequisites: 01
Tools, agents, hooks, workflows, templates, RAG, storage backends
- Part 1: Tool Development (37+ patterns, BaseAgent + Tool trait)
- Part 2: Agent Development (LLM integration, provider abstraction)
- Part 3: Hook Development (security, caching, cross-cutting concerns)
- Part 4: Workflow Development (4 types: sequential, parallel, conditional, multi-agent)
- Part 5: RAG Extension (pipeline builder, custom embeddings, HNSW tuning)
- Part 6: Storage Backend Extension (StorageBackend trait, Redis/PostgreSQL)
- Part 7: Template Creation (AI workflow templates, proven patterns)
Time: 2-6 hours (depending on component) | Prerequisites: 01, 02
Typed Rust structs for script-to-Rust configuration
- Core principles: typed structs, parser separation, zero serialization overhead
- Anti-patterns eliminated (JSON → HashMap chains)
- Implementation checklist with step-by-step guidance
- Common reusable parsers (ContextScope, InheritancePolicy, ModelConfig)
- Complete examples from real implementations (6 tasks)
- Testing requirements and troubleshooting guide
Time: 2-3 hours | Prerequisites: 01, 03
Security, performance, scaling, monitoring
- Part 1: Security & Multi-Tenancy (3-level model, tenant isolation)
- Part 2: Performance & Scaling (HNSW tuning, connection pooling)
- Part 3: Deployment & Operations (Docker, Kubernetes, state persistence)
- Part 4: Monitoring & Observability (Prometheus, Grafana, tracing, health checks)
- Part 5: Performance Tuning (Tokio config, system tuning, profiling, optimization)
Targets: <10ms tools, <50ms agents, <8ms vector search, 99.9% uptime
Time: 4-8 hours | Prerequisites: 01, 02, 03
Comprehensive instrumentation guide
- Structured tracing patterns across all components
- Session correlation and context propagation
- Performance optimization (<2% overhead at INFO level)
- Component-specific guidelines (tools, agents, workflows)
- Testing and environment configuration
Time: 1-2 hours | Prerequisites: 01, 02
Build system and feature flags (Phase 10.17.5+)
- Modular build system (minimal/common/full)
- Binary size reduction (19MB minimal, 25MB common, 35MB full)
- Optional tool dependencies (templates, PDF, CSV, Excel, archives, email, DB)
- CI/CD and Docker migration steps
- Feature mapping and troubleshooting
BREAKING CHANGE: Feature flags required for builds since Phase 10.17.5
Time: 15 minutes | Prerequisites: None (read first if building)
Operational guide for performance, security, and deployment
- Performance overview and benchmarks (Phases 0-13)
- Security implementation (3-level model, multi-tenant isolation)
- Performance tuning (HNSW, state persistence, memory backends)
- Security operations (STRIDE mitigations, audit logging)
- Monitoring & observability (metrics, regression detection)
- Operational checklists (deployment, production config, incident response)
Time: 2-4 hours (reference) | Prerequisites: 01, 02, 05
Architecture of the unified web interface
- Unified architecture (Rust backend + Embedded React)
- API design (axum handlers, WebSocket EventBus integration)
- Frontend architecture (Vite, React, Monaco Editor integration, graph visualization)
- Asset embedding strategy (rust-embed)
- Security model (CORS, API keys, session validation)
- Extension patterns (adding endpoints, UI pages)
Time: 1-2 hours | Prerequisites: 01, 02
Complete Rust API documentation for extending llmspell
Consolidated guides covering multiple crates by topic:
- Core Traits & Foundation - BaseAgent, ExecutionContext, testing framework
- Storage Backends - Vector storage, HNSW, backends, export/import API (Phase 13c.3.2)
- RAG Pipeline & Context Engineering - Document ingestion, retrieval, knowledge graph
- Memory Backends - Episodic, semantic, procedural memory systems
- Security & Multi-Tenancy - Access control, sandboxing, tenant isolation
- Crate Index - Quick reference to all 21 crates
# Generate complete workspace documentation
cargo doc --workspace --all-features --no-deps --open
# Generate for specific crate
cargo doc --package llmspell-core --all-features --open- Unified Crate:
llmspell-web(Axum + Tokio + RustEmbed) - Mission Control UI: Dashboard, Editor, Sessions, Memory, Agents
- Embedded Frontend: React + Vite + Monaco Editor, single binary deployment
- Real-Time API: REST + WebSocket streaming for events and console
- Visualizations: Interactive memory graph, session timeline, activity metrics
- 3-Tier Memory System: Episodic (HNSW), Semantic (SQLite/PostgreSQL graph), Procedural (patterns)
- Hot-Swappable Backends: InMemory (dev), HNSW (8.47x speedup), SQLite/PostgreSQL (bi-temporal graph)
- Context Engineering: 4 strategies (episodic, semantic, hybrid, RAG) with parallel retrieval
- <2ms Memory Overhead: 50x faster than target, production-quality validation at scale
- 149 Tests: 100% pass rate, zero warnings, comprehensive validation
- Zero Breaking Changes: Fully backward compatible, opt-in features
- 10 Experimental Templates: 6 base + 4 advanced workflows for rapid concept exploration
- Template System: llmspell-templates crate (2,651 LOC, 149 tests)
- Template CLI: 5 subcommands (list, info, exec, search, schema) for instant productivity
- Template Global: 16th of 18 Lua globals with 6 methods
- 20-50x Performance: <2ms init, <1ms lookup, <0.1ms validation
| Metric | Phase 12 | Phase 13 | Change |
|---|---|---|---|
| Crates | 18 | 21 | +3 memory crates |
| Lua Globals | 18 | 18 | Memory + Context globals |
| Templates | 0 | 10 | NEW |
| Tests | 486 | 635 | +149 tests |
| Tool Init | <10ms | <10ms | Maintained |
| Memory Ops | N/A | <2ms | NEW (50x target) |
📖 Complete documentation: See Scripts README for all available scripts
⚠️ BREAKING CHANGE (Phase 10.17.5+): Feature flags required for builds. See 07-feature-flags.md
# Build commands (Phase 10.17.5+)
cargo build --release --features common # Recommended (25MB, templates+PDF)
cargo build --release --features full # All tools (35MB)
cargo build --release # Minimal (19MB, core only)
# Quick checks (use frequently)
./scripts/quality/quality-check-minimal.sh # <5 seconds - format, clippy
./scripts/quality/quality-check-fast.sh # ~1 minute - adds unit tests
# Before PR (mandatory)
./scripts/quality/quality-check.sh # 5+ minutes - full validation
# Component testing
./scripts/testing/test-by-tag.sh unit # Unit tests only
./scripts/testing/test-by-tag.sh rag # RAG tests
./scripts/testing/test-by-tag.sh memory # Memory tests
./scripts/testing/test-by-tag.sh tool # Tool testsScript Categories:
- Quality & CI - Code quality, CI/CD pipelines
- Testing - Test execution, coverage
- Utilities - Helper tools, easy launcher
- Fleet - Kernel orchestration, monitoring
| Component | Target | Status | Measure |
|---|---|---|---|
| Tool init | <10ms | ✅ | cargo bench -p llmspell-tools |
| Agent creation | <50ms | ✅ | cargo bench -p llmspell-agents |
| Hook overhead | <2% | ✅ | Performance tests |
| Vector search | <8ms @ 100K | ✅ | cargo bench -p llmspell-storage |
| Multi-tenant | 3% overhead | ✅ | Integration tests |
| Template init | <2ms | ✅ | cargo bench -p llmspell-templates |
| Memory ops | <2ms overhead | ✅ | cargo bench -p llmspell-memory |
1. 01-getting-started.md → Core Patterns
2. 03-extending-components.md → Part 1 (Tools)
3. examples/rust-developers/custom-tool-example/
4. Implement your tool
1. 01-getting-started.md → Architecture
2. 03-extending-components.md → Part 5 (RAG)
3. examples/script-users/getting-started/05-memory-rag-advanced.lua
4. examples/script-users/cookbook/rag-multi-tenant.lua
5. Build RAG features
1. 01-getting-started.md → Overview
2. 05-production-deployment.md → All sections
3. examples/script-users/applications/
4. Deploy with monitoring
1. 01-getting-started.md → Core Patterns
2. 04-bridge-patterns.md → All sections
3. Review completed examples (Tasks 11a.8.1-11a.8.6)
4. Implement typed bridge method
1. 01-getting-started.md → Architecture
2. 03-extending-components.md → Part 7 (Templates)
3. Review 10 built-in templates in llmspell-templates/src/builtin/
4. Implement custom template following patterns
Foundation Layer (8 crates):
├── llmspell-core - BaseAgent trait, types
├── llmspell-utils - Parameters, errors, responses
├── llmspell-storage - HNSW vectors (Phase 8)
├── llmspell-security - 3-level model
├── llmspell-config - Configuration
├── llmspell-rag - RAG pipeline (Phase 8)
├── llmspell-tenancy - Multi-tenant (Phase 8)
└── llmspell-testing - Test utilities
Memory Layer (3 crates - Phase 13):
├── llmspell-memory - 3-tier memory system
├── llmspell-graph - Temporal knowledge graph
└── llmspell-context - Context engineering
Application Layer (10 crates):
├── llmspell-kernel - Daemon, signals, Jupyter, DAP (Phase 10)
├── llmspell-tools - 40+ built-in tools (feature flags)
├── llmspell-templates - 10 built-in workflow templates (Phase 12) ⭐
├── llmspell-agents - Agent infrastructure
├── llmspell-workflows - 4 workflow types
├── llmspell-bridge - Script integration (18 globals)
├── llmspell-hooks - 40+ hook points
├── llmspell-events - Event bus
├── llmspell-providers - LLM providers
└── llmspell-cli - CLI interface + tool/template commands
use llmspell_utils::params::{extract_parameters, extract_required_string};
use llmspell_utils::error_builders::llmspell::{component_error, validation_error};
use llmspell_utils::response::ResponseBuilder;impl BaseAgent for YourComponent {
fn metadata(&self) -> &ComponentMetadata { ... }
async fn execute(&self, input: AgentInput, ctx: ExecutionContext) -> Result<AgentOutput> { ... }
}use llmspell_bridge::sync_utils::block_on_async;
let result = block_on_async::<_, T, E>("operation", async move { ... }, timeout)?;- Study Examples: 60+ production examples in
examples/ - Use llmspell-utils: Never duplicate parameter/error/response handling
- Follow Patterns: Use existing patterns from 40+ tools, 10 templates
- ✅ All tests categorized:
#[cfg_attr(test_category = "unit")] - ✅ Use llmspell-testing helpers (no duplicates)
- ✅ Run quality checks before commit
- ✅ Zero warnings policy
- ✅ >90% test coverage, >95% doc coverage
- Write failing test first
- Implement with existing patterns
- Run
./scripts/quality/quality-check-fast.sh - Update documentation if needed
- Submit PR with description
- 3-Tier Memory System (Episodic, Semantic, Procedural)
- Hot-Swappable Backends (InMemory, HNSW via vectorlite-rs, SQLite/PostgreSQL graph)
- Context Engineering (4 strategies with parallel retrieval)
- <2ms Memory Overhead (50x faster than target)
- Experimental AI Workflow Templates
- 10 built-in templates (6 base + 4 advanced)
- Template CLI with 5 subcommands
- Template Lua API (Template global, 16th of 18)
- 20-50x performance vs targets
- Local LLM Integration (Ollama + Candle)
- Bridge Consolidation (87% compile speedup)
- API Standardization (Tool.execute consistency)
- Web Interface: Unified "Mission Control" UI
- Single Binary: Embedded React frontend
- Real-Time API: HTTP + WebSocket streaming
- Interactive Tools: Memory graph, script editor, session replay
- Model Context Protocol (MCP): System tool integration
- Language Server Protocol (LSP)
- Agent-to-Agent (A2A) communication
- Plugin marketplace
- Examples: 60+ in
examples/directory - Questions: GitHub Discussions
- Bugs: GitHub Issues
- Quick search:
rg "pattern" --type rust
Phase 14 Complete with consolidated developer documentation:
✅ 8 Numbered Guides from setup to production (linear learning path) ✅ 21 Crates with Memory, Graph, Context, Templates, Kernel, RAG, and multi-tenancy ✅ 40+ Tools with feature flag modularity (19-35MB builds) ✅ 10 Built-in Templates solving real AI workflow problems ✅ 60+ Examples with learning paths ✅ All Performance Targets Exceeded (20-50x faster for templates/memory)
Start with 01-getting-started.md for complete onboarding.
Happy contributing to rs-llmspell! 🚀
For architecture details: Technical Docs For usage: User Guide