MCPcopy Create free account
hub / github.com/astercloud/aster / main

Function main

examples/memory-working/main.go:19–37  ·  view source on GitHub ↗
()

Source from the content-addressed store, hash-verified

17)
18
19func main() {
20 ctx := context.Background()
21
22 // 1. 创建存储后端
23 backend := backends.NewStateBackend()
24
25 // 2. 示例 1: Thread Scope(会话级)
26 fmt.Println("=== 示例 1: Thread Scope Working Memory ===")
27 demonstrateThreadScope(ctx, backend)
28
29 fmt.Println("\n=== 示例 2: Resource Scope Working Memory ===")
30 demonstrateResourceScope(ctx, backend)
31
32 fmt.Println("\n=== 示例 3: 带 Schema 的 Working Memory ===")
33 demonstrateWithSchema(ctx, backend)
34
35 fmt.Println("\n=== 示例 4: Find and Replace(实验性)===")
36 demonstrateFindAndReplace(ctx, backend)
37}
38
39func demonstrateThreadScope(ctx context.Context, backend backends.BackendProtocol) {
40 // 创建 thread scope 的 Working Memory 管理器

Callers

nothing calls this directly

Calls 5

NewStateBackendFunction · 0.92
demonstrateThreadScopeFunction · 0.85
demonstrateResourceScopeFunction · 0.85
demonstrateWithSchemaFunction · 0.85

Tested by

no test coverage detected