bx-ai-memory — independently scanned and version-tracked by SaferSkills.
SaferSkills independently audited bx-ai-memory (Agent Skill) and scored it 100/100 (green). The audit ran 55 deterministic rules across Security, Supply Chain, Maintenance, Transparency, and Community; it found 0 high-severity and 0 lower-severity findings. The full rule-by-rule trace and per-finding evidence are below. Free, methodology-open.
Findings & checks · 0 flagged
Every scanned point with the score it earned and what moved between them.
First recorded scan — no prior version to compare against.
The primary manifest — the file an agent reads to learn what this artifact does.
aiMemory() BIF// Signature
aiMemory( type, key="", userId="", conversationId="", config={} )type — memory type name (see table below)key — unique identifier for this memory instanceuserId — tenant user identifier (multi-tenant isolation)conversationId — isolate separate conversations for the same userconfig — type-specific configuration struct| Type | Best For | Persistence |
|---|---|---|
windowed | Last N messages | In-memory |
summary | Long conversations (auto-summarizes) | In-memory |
session | Single request/session | In-memory |
file | Simple persistence across restarts | File system |
cache | Fast shared memory | CacheBox |
jdbc | Multi-server production use | Database |
chroma | Semantic search (vector) | ChromaDB |
pinecone | Semantic search (vector) | Pinecone |
weaviate | Semantic search (vector) | Weaviate |
in-memory-vector | Dev/test semantic search | In-memory |
// Windowed: keeps last N messages
memory = aiMemory( "windowed", config: { maxMessages: 20 } )
// Summary: automatically compresses old messages into a summary
memory = aiMemory( "summary", config: {
maxMessages : 10, // keep last 10 messages before summarizing
summaryProvider: "openai" // which provider does the summarization
})
// Session: lives for the duration of the current request
memory = aiMemory( "session" )
// File: persists conversations to disk
memory = aiMemory( "file", config: {
filePath: expandPath( "./data/conversations" )
})
// JDBC: stored in a database table (production-ready)
memory = aiMemory( "jdbc", config: {
datasource: "myApp",
table : "ai_conversations"
})
// Cache: uses CacheBox for shared, fast access
memory = aiMemory( "cache", config: {
cacheName: "default"
})All memory types support isolation via userId and conversationId:
// Isolate per user
memory = aiMemory( "windowed",
key : createUUID(),
userId: "user-alice",
config: { maxMessages: 10 }
)
// Isolate per conversation (same user, different chats)
supportMemory = aiMemory( "windowed",
key : createUUID(),
userId : "user-alice",
conversationId: "support-ticket-456",
config : { maxMessages: 20 }
)
salesMemory = aiMemory( "windowed",
key : createUUID(),
userId : "user-alice",
conversationId: "sales-inquiry-789",
config : { maxMessages: 20 }
)// Create a persistent memory instance
memory = aiMemory( "windowed",
key : "chat-#session.sessionId#",
userId: auth.getCurrentUserId(),
config: { maxMessages: 30 }
)
agent = aiAgent(
name : "SupportBot",
instructions: "You are a helpful support agent. Remember the user's context.",
memory : memory
)
// Each run() call uses and updates the memory
agent.run( "I'm having trouble with my subscription." )
agent.run( "It's been broken for 3 days." )
agent.run( "Can you summarize my issue?" )
// → Agent remembers both earlier messages// Direct memory manipulation
memory.add( "user", "My name is Alice" )
memory.add( "assistant", "Hello Alice, how can I help?" )
// Get all messages
messages = memory.getMessages()
// Get recent N messages
recent = memory.getMessages( 5 )
// Clear memory
memory.clear()
// Get memory size
count = memory.size()For RAG and semantic retrieval, see the RAG skill. Quick reference:
// In-memory vector store (dev/testing)
vectorMem = aiMemory( "in-memory-vector", config: {
embeddingProvider: "openai",
embeddingModel : "text-embedding-3-small"
})
// ChromaDB (production)
vectorMem = aiMemory( "chroma", config: {
collection : "knowledge_base",
embeddingProvider: "openai",
serverUrl : "http://localhost:8000"
})
// Multi-tenant vector memory
aliceMem = aiMemory( "chroma",
key : createUUID(),
userId: "alice",
config: { collection: "user_notes", embeddingProvider: "openai" }
)
// Add documents
vectorMem.add( "BoxLang is a modern JVM language" )
// Retrieve semantically similar content
results = vectorMem.getRelevant( "What language runs on the JVM?", 5 )windowed or in-memory-vectorfile or cachejdbcchroma, pinecone, or weaviatesummary to avoid context overflowuserId + conversationIdsession memory for multi-turn conversations across requestsuserId in multi-user applications to prevent data leakagesummary memory for customer support bots with long conversationsagent.run() calls for continuity~30 seconds. Free. No account. Every finding cites a rule and a line of evidence.