Functions
ns
Alias of ::ai/
AI types and utilities for Hot. Dependency-free building blocks for AI agents.
Namespaces
Foundations
::ai::session—SessionandIdentityhandle types + scope-key helpers. Sessions are conversation containers (Slack channel, Telegram group, DM thread). Identities are participants within them.::ai::message— Normalized message formats:Roleenum (User/Assistant/System)ChatMessage— simple role+content pair for AI API callsMessage— inbound user messages withsender+sessionAgentMessage— inter-agent envelopes withto-agent/from-agent
AI Dispatch
::ai::chat— Provider-agnostic model dispatch:Providerenum (Anthropic, OpenAi, XAi, Gemini)detect-provider(model)— map a model name to its providerChatOptions— carrieschat-fn,model, andsystem; pass this to::ai::ragfunctions so the library never depends on AI packages.
Memory
::ai::memory— Three-level scoped memory:- Session — shared conversation history (embedded for semantic search)
- User — per-identity persistent data (profile, preferences)
- KB — shared knowledge base (embedded)
Plus per-user
Threadfor multi-turn conversation state.
Retrieval
::ai::rag— Retrieve-Augment-Generate helpers that compose memory search with a caller-providedchat-fn:build-context,ask,ask-with-thread,summarize- Pure helpers (testable):
format-session-results,format-kb-results,format-thread-lines,build-rag-prompt
Context Management
::ai::context— Token budgeting and message sampling:estimate-tokens,sample,fit,truncate
Inter-Agent Communication
::ai::bus— Typed event-bus patterns for agent-to-agent messaging:tell,broadcast,collaborate,respondBroadcastMessage,CollaborationRequest
Media
::ai::media— Media-handling utilities for multi-modal agents.