AI Decision System
Replayable, offline-verifiable records for AI-assisted go/no-go decisions: experiment promotions, typed model answers and human-approved actions.
Build multi-tenant AI applications with one fluent API for providers, agents, RAG, MCP, memory, and production controls.
Developer toolsGitHub @ortus-boxlangOnlineOwner unconfirmed
Have you tried it? One tap is enough. No sign-in needed.
No updates detected yet. GitHub releases will appear here.
Owners of public repositories under a personal GitHub account can sign in to verify ownership and manage the introduction themselves. No administrator approval is needed.
Sign in, generate a verification file, and commit it to this repository’s default branch within 30 minutes. Files on other branches or forks do not count. Then check the file below to manage the project without administrator approval. Keep the file to retain your access.
If needed, you will go to sign-in. After signing in, return here and press your chosen verification button again.
Run /nomorevibe verify in your project folder to verify ownership and manage the introduction yourself.
Verify in one minuteAsk about other verification options
🧠 BoxLang AI Examples for our Intro to BoxLang AI Presentations
Translation pending
Taken from the repository README
Loading the full README. The saved excerpt is shown below.
Comprehensive Examples for the bx-ai Module – A progressive tutorial workspace showcasing everything from basic chat to advanced streaming, multimodal content, tool integration, and structured outputs.
Copyright Since 2023 by Ortus Solutions, Corp
This repository provides progressive, hands-on examples for learning the bx-ai module — an enterprise-grade AI integration framework for BoxLang. Each example builds on previous concepts, from basic chat requests to advanced features like streaming, tool usage, and structured outputs.Read the full README ↗Comprehensive Examples for the bx-ai Module – A progressive tutorial workspace showcasing everything from basic chat to advanced streaming, multimodal content, tool integration, and structured outputs.
This repository provides progressive, hands-on examples for learning the bx-ai module — an enterprise-grade AI integration framework for BoxLang. Each example builds on previous concepts, from basic chat requests to advanced features like streaming, tool usage, and structured outputs.
Perfect for:
.env file (Make to create it from .env.example)# 1. Clone and enter the repo
git clone https://github.com/ortus-boxlang/bx-ai-intro.git
cd bx-ai-intro
#2a. Install BoxLang AI locally
install-bx-module bx-ai --local
#2b. Install BoxLang OS globally
install-bx-modules bx-ai
# 3. Create .env file with your API keys
cp .env.example .env
# Edit .env and add your API keys (e.g., OPENROUTER_API_KEY=sk-or-...)
# 4. Run any example
boxlang examples/01-basic-chat.bxs
Each example demonstrates specific features. Run them in order to build understanding:
| # | Example | Topics |
|---|---|---|
| 01 | Basic Chat | Simple text prompts to AI |
| 02 | Custom Provider | Override default provider/model |
| 03 | Options & Formats | Logging, return formats, debugging |
| 04 | Structured Output | Typed responses with classes |
| # | Example | Topics |
|---|---|---|
| 05 | Message Objects | Messages with metadata & roles |
| 06 | Multimodal Content | Images, audio, and mixed content |
| 07 | Multi-Turn Conversations | Context-aware conversation loops |
| 08 | Tool Usage | Function calling and tools |
| # | Example | Topics |
|---|---|---|
| 09 | Basic Streaming | Real-time response streaming |
| 10 | Stream with UX | Streaming with formatted output |
| 11 | Reasoning Models | Advanced reasoning with streaming |
| 12 | Message Context | Managing complex conversation history |
| # | Example | Topics |
|---|---|---|
| 13 | Basic Pipeline | Sequential AI operations (Intro) |
| 14 | Pipeline Streaming | Pipelines with real-time output |
| 15 | Pipeline Transformers | Custom and built-in transformers |
| 16 | Pipeline Structured Output | Typed responses in pipelines |
| 17 | Pipeline Tools | Function calling in pipelines |
| 18 | Multi-Model Pipeline | Chain multiple AI models together |
| # | Example | Topics |
|---|---|---|
| 19 | Basic Agent | Creating autonomous AI agents |
| 20 | Agent Memories | Persistent memory and context recall |
| 21 | Agent Tools | Tool-enabled agents and function execution |
| 22 | Agent Subagents | Delegation and multi-agent collaboration |
| 23 | Agent Skills | Reusable domain knowledge injection |
| 24 | Agent Middleware | Logging, auditing, and guardrail hooks |
| 25 | Agent Middleware (Human-in-the-Loop) | Human approval middleware |
| 26 | Agent MCP Servers | Auto-discover tools from MCP servers |
| 27 | Agent Scheduler | Scheduled and recurring agent tasks |
| # | Example | Topics |
|---|---|---|
| 28 | Text-to-Speech | Synthesize speech with aiSpeak(), voices, HD models, fluent builder API |
| 29 | Speech-to-Text | Transcribe audio with aiTranscribe(), language hints, TTS→STT round-trip, fluent builder API |
| 30 | Audio Translation | Translate spoken audio to English with aiTranslate(), fluent builder API |
| 41 | Streaming Speech | Stream audio as it is generated with aiSpeakStream(): time to first audio, stopping early (barge-in), word timestamps, mp3 vs pcm vs mulaw |
| 42 | Cartesia Voices | provider: "cartesia" for TTS and STT: voices, emotion and speed, output formats, TTS→STT round-trip |
| Web demo | Streaming Speech over HTTP | A runnable browser demo: raw mp3 into an <audio> tag, plus a voice-agent view with PCM, Web Audio and word highlighting |
| # | Example | Topics |
|---|---|---|
| 31 | Image Generation | Generate images with aiImage(), AiImageResponse, the generateImage@bxai tool |
| 32 | Web Search | aiWebSearch() / aiWebSearchAsync(), the webSearch@bxai tool |
| 33 | Agent Registry | aiAgentRegistry() — register, list, resolve, and discover agents |
| 34 | Security Guardrails | InputSanitizerMiddleware, aiFence()/addUntrusted(), OutputGuardMiddleware, LLMGuardMiddleware |
| 35 | Gateways | aiGateway(), scripted approvals with the mock gateway, register:/module: auto-registration |
| 36 | HITL Batching & Durable Grants | Batched tool-call approvals, approve_always durable grants, aiDecisionStore() |
| 37 | Gateway Sessions | aiGatewaySession() — reject/queue/steer/interrupt policies, maxQueueDepth, lifecycle |
agents/)Each subfolder under agents/ is a small, self-contained application built with bx-ai — deeper and more realistic than the numbered examples/.
| Folder | Topics |
|---|---|
| 01-web-search | Search-native provider (Perplexity sonar) — no custom tools needed |
| 02-research | Explicit HTTP search/fetch/summarize tools, provider-agnostic |
| 03-tools | Production-style agent with calculator, unit conversion, timezone, currency, weather tools |
| 04-memory | Persistent memory across runs with FileMemory + SummaryMemory |
| 05-subagents | Multi-agent orchestration — sub-agents as callable tools |
| 06-skills | Domain skills injection — always-on vs. lazy-loaded |
| 07-rag-basic | Retrieval-augmented generation with pure-BoxLang TF-IDF, no external services |
| 08-rag-vector | Production RAG with OpenAI embeddings + ChromaDB vector search |
| 09-local-llm | Fully local agents via Ollama — no API keys, no internet |
| 10-enterprise | Capstone: combines every capability from 01-09 into one workflow system |
config/boxlang.json){
"modules": {
"bxai": {
"settings": {
"provider": "openrouter",
"defaultParams": {
"model": "openrouter/free"
},
// Omitted on purpose — inherits the module's own 90s default.
// "timeout": 90,
"logRequestToConsole": false,
"returnFormat": "single"
// ...plus providers (openai/claude/bedrock), security, gateways, and hitl —
// see the full, commented config/boxlang.json for all of it.
}
}
}
}
.env)All providers use the pattern <PROVIDER>_API_KEY:
OPENAI_API_KEY=sk-...
CLAUDE_API_KEY=sk-ant-...
OPENROUTER_API_KEY=sk-or-...
GEMINI_API_KEY=...
See .env.example for all supported providers.
Enable request logging in config/boxlang.json:
"logRequestToConsole": true
See the raw provider response:
aiChat( "prompt", {}, { returnFormat: "raw" } )
Check your API keys - verify .env file has correct provider:
# Common mistake: wrong provider name
OPENROUTER_API_KEY=sk-or-... # Exact case and spelling matters
Use different return formats for debugging:
{ returnFormat: "all" } // All messages
{ returnFormat: "json" } // Parse as JSON
Copyright Since 2023 by Ortus Solutions, Corp
| 38 |
| Agent Run Control |
agent.cancelRun() / agent.steerRun(), onAIAgentRunCancel/onAIAgentRunSteer |
| 39 | Reasoning | Enabling reasoning (Claude thinking, OpenAI reasoning_effort), reading message.reasoning sync & streaming |
| 40 | AWS Bedrock | provider: "bedrock", bearer-token auth, default AWS credential chain, Claude tool-use on Bedrock |
| 11-mcp-server | Building an MCP server: tools, resources, prompts, pause/resume, IP allowlisting, observability |