ultra-memory 3.0.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
@@ -0,0 +1,305 @@
1
+ openapi: 3.0.3
2
+ info:
3
+ title: ultra-memory REST API
4
+ description: |
5
+ Long-term memory system for LLMs. Provides a three-layer hierarchical memory architecture:
6
+ - Layer 1: Operation log (ops.jsonl) — append-only, fine-grained
7
+ - Layer 2: Session summary (summary.md) — compressed, milestone-oriented
8
+ - Layer 3: Semantic store (knowledge_base.jsonl, entities.jsonl) — cross-session, structured
9
+ version: 3.0.0
10
+ contact:
11
+ name: ultra-memory
12
+ servers:
13
+ - url: http://127.0.0.1:3200
14
+ description: Local server (default)
15
+
16
+ paths:
17
+ /health:
18
+ get:
19
+ summary: Health check
20
+ operationId: health
21
+ responses:
22
+ '200':
23
+ description: Server is healthy
24
+ content:
25
+ application/json:
26
+ schema:
27
+ type: object
28
+ properties:
29
+ status:
30
+ type: string
31
+ example: ok
32
+ storage:
33
+ type: string
34
+ example: /home/user/.ultra-memory
35
+
36
+ /tools:
37
+ get:
38
+ summary: List all available tools with schemas
39
+ operationId: listTools
40
+ responses:
41
+ '200':
42
+ description: Tool definitions
43
+ content:
44
+ application/json:
45
+ schema:
46
+ type: object
47
+ properties:
48
+ tools:
49
+ type: array
50
+ items:
51
+ $ref: '#/components/schemas/ToolDefinition'
52
+
53
+ /session/current:
54
+ get:
55
+ summary: Get the most recent session ID across all projects
56
+ operationId: getCurrentSession
57
+ responses:
58
+ '200':
59
+ description: Current session info
60
+ content:
61
+ application/json:
62
+ schema:
63
+ $ref: '#/components/schemas/ToolResponse'
64
+
65
+ /tools/memory_init:
66
+ post:
67
+ summary: Initialize a new memory session
68
+ operationId: memoryInit
69
+ requestBody:
70
+ content:
71
+ application/json:
72
+ schema:
73
+ type: object
74
+ properties:
75
+ project:
76
+ type: string
77
+ default: default
78
+ description: Project name
79
+ resume:
80
+ type: boolean
81
+ default: false
82
+ description: Try to resume the most recent session
83
+ responses:
84
+ '200':
85
+ $ref: '#/components/responses/ToolResponse'
86
+
87
+ /tools/memory_status:
88
+ post:
89
+ summary: Query current session status
90
+ operationId: memoryStatus
91
+ requestBody:
92
+ required: true
93
+ content:
94
+ application/json:
95
+ schema:
96
+ type: object
97
+ required: [session_id]
98
+ properties:
99
+ session_id:
100
+ type: string
101
+ description: Session ID
102
+ responses:
103
+ '200':
104
+ $ref: '#/components/responses/ToolResponse'
105
+
106
+ /tools/memory_log:
107
+ post:
108
+ summary: Record an operation to the session log
109
+ operationId: memoryLog
110
+ requestBody:
111
+ required: true
112
+ content:
113
+ application/json:
114
+ schema:
115
+ type: object
116
+ required: [session_id, op_type, summary]
117
+ properties:
118
+ session_id:
119
+ type: string
120
+ op_type:
121
+ type: string
122
+ enum:
123
+ - tool_call
124
+ - file_write
125
+ - file_read
126
+ - bash_exec
127
+ - reasoning
128
+ - user_instruction
129
+ - decision
130
+ - error
131
+ - milestone
132
+ summary:
133
+ type: string
134
+ maxLength: 200
135
+ detail:
136
+ type: object
137
+ additionalProperties: true
138
+ tags:
139
+ type: array
140
+ items:
141
+ type: string
142
+ responses:
143
+ '200':
144
+ $ref: '#/components/responses/ToolResponse'
145
+
146
+ /tools/memory_recall:
147
+ post:
148
+ summary: Retrieve relevant records from all memory layers
149
+ operationId: memoryRecall
150
+ requestBody:
151
+ required: true
152
+ content:
153
+ application/json:
154
+ schema:
155
+ type: object
156
+ required: [session_id, query]
157
+ properties:
158
+ session_id:
159
+ type: string
160
+ query:
161
+ type: string
162
+ description: Search keywords (Chinese or English)
163
+ top_k:
164
+ type: integer
165
+ default: 5
166
+ responses:
167
+ '200':
168
+ $ref: '#/components/responses/ToolResponse'
169
+
170
+ /tools/memory_summarize:
171
+ post:
172
+ summary: Trigger session summary compression
173
+ operationId: memorySummarize
174
+ requestBody:
175
+ required: true
176
+ content:
177
+ application/json:
178
+ schema:
179
+ type: object
180
+ required: [session_id]
181
+ properties:
182
+ session_id:
183
+ type: string
184
+ force:
185
+ type: boolean
186
+ default: false
187
+ description: Force compression even if operation count is low
188
+ responses:
189
+ '200':
190
+ $ref: '#/components/responses/ToolResponse'
191
+
192
+ /tools/memory_restore:
193
+ post:
194
+ summary: Restore the last session context for a project
195
+ operationId: memoryRestore
196
+ requestBody:
197
+ content:
198
+ application/json:
199
+ schema:
200
+ type: object
201
+ properties:
202
+ project:
203
+ type: string
204
+ default: default
205
+ verbose:
206
+ type: boolean
207
+ default: false
208
+ responses:
209
+ '200':
210
+ $ref: '#/components/responses/ToolResponse'
211
+
212
+ /tools/memory_profile:
213
+ post:
214
+ summary: Read or update user profile
215
+ operationId: memoryProfile
216
+ requestBody:
217
+ required: true
218
+ content:
219
+ application/json:
220
+ schema:
221
+ type: object
222
+ required: [action]
223
+ properties:
224
+ action:
225
+ type: string
226
+ enum: [read, update]
227
+ updates:
228
+ type: object
229
+ additionalProperties: true
230
+ description: Required when action=update
231
+ responses:
232
+ '200':
233
+ $ref: '#/components/responses/ToolResponse'
234
+
235
+ /tools/memory_entities:
236
+ post:
237
+ summary: Query structured entity index
238
+ operationId: memoryEntities
239
+ requestBody:
240
+ content:
241
+ application/json:
242
+ schema:
243
+ type: object
244
+ properties:
245
+ entity_type:
246
+ type: string
247
+ enum: [function, file, dependency, decision, error, class, all]
248
+ default: all
249
+ query:
250
+ type: string
251
+ default: ''
252
+ top_k:
253
+ type: integer
254
+ default: 10
255
+ responses:
256
+ '200':
257
+ $ref: '#/components/responses/ToolResponse'
258
+
259
+ /tools/memory_extract_entities:
260
+ post:
261
+ summary: Re-extract all entities from a session ops log
262
+ operationId: memoryExtractEntities
263
+ requestBody:
264
+ required: true
265
+ content:
266
+ application/json:
267
+ schema:
268
+ type: object
269
+ required: [session_id]
270
+ properties:
271
+ session_id:
272
+ type: string
273
+ responses:
274
+ '200':
275
+ $ref: '#/components/responses/ToolResponse'
276
+
277
+ components:
278
+ schemas:
279
+ ToolDefinition:
280
+ type: object
281
+ properties:
282
+ name:
283
+ type: string
284
+ description:
285
+ type: string
286
+ inputSchema:
287
+ type: object
288
+
289
+ ToolResponse:
290
+ type: object
291
+ properties:
292
+ success:
293
+ type: boolean
294
+ tool:
295
+ type: string
296
+ output:
297
+ type: string
298
+
299
+ responses:
300
+ ToolResponse:
301
+ description: Tool execution result
302
+ content:
303
+ application/json:
304
+ schema:
305
+ $ref: '#/components/schemas/ToolResponse'