Platform
ScaiWave ScaiGrid ScaiCore ScaiBot ScaiDrive ScaiKey Models Tools & Services
Solutions
Organisations Developers Internet Service Providers Managed Service Providers AI-in-a-Box
Resources
Support Documentation Blog Downloads
Company
About Research Careers Investment Opportunities Contact
Log in

Memory and reference APIs

9. Memory API#

Memory is instance-partitioned. Each instance exclusively owns its memory. No other instance can read or write to it. For :stateless Cores, the memory backend handles concurrent access via atomic operations.

scaicore
 1
 2
 3
 4
 5
 6
 7
 8
 9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
// Key-based access
value = memory.vendor_aliases.get(vendor_name)
memory.vendor_aliases.set(vendor_name, vendor_id)
memory.vendor_aliases.update(vendor_name, new_id)
memory.vendor_aliases.delete(vendor_name)

// Collection operations
memory.patterns.add(new_pattern)

// Key-prefix listing
results = memory.interactions.list(
    prefix = "2026-02:",
    limit = 100,
    order = "desc"
)

// Semantic search
similar = memory.interaction_history.search(
    query = "billing dispute refund request",
    limit = 5,
    min_similarity = 0.7
)

// Convenience: last N items from an array field
recent = memory.interaction_history.last(5)

9b. Reference API#

Reference data is read-only. Loaded at deployment, immutable at runtime. Available to all instances of a Core. Accessed via reference.*:

scaicore
 1
 2
 3
 4
 5
 6
 7
 8
 9
10
11
12
13
14
15
// Direct access
entry = reference.faq.get("billing-question-123")
all_rules = reference.escalation_rules
rate = reference.vat_rates.get("NL")

// Search (if the reference type supports it)
matches = reference.faq.search(
    query = "how do I reset my password",
    limit = 3
)

// Iteration
@foreach rule in reference.escalation_rules {
    // ...
}

Cannot write: reference.faq.set(...) → CompileError


Updated 2026-05-17 08:59:18 View source (.md) rev 1