@vectorize-io/hindsight-client 0.0.11

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.
Files changed (87) hide show
  1. package/README.md +57 -0
  2. package/dist/generated/client/client.gen.d.ts +3 -0
  3. package/dist/generated/client/client.gen.d.ts.map +1 -0
  4. package/dist/generated/client/client.gen.js +233 -0
  5. package/dist/generated/client/client.gen.js.map +1 -0
  6. package/dist/generated/client/index.d.ts +9 -0
  7. package/dist/generated/client/index.d.ts.map +1 -0
  8. package/dist/generated/client/index.js +18 -0
  9. package/dist/generated/client/index.js.map +1 -0
  10. package/dist/generated/client/types.gen.d.ts +118 -0
  11. package/dist/generated/client/types.gen.d.ts.map +1 -0
  12. package/dist/generated/client/types.gen.js +4 -0
  13. package/dist/generated/client/types.gen.js.map +1 -0
  14. package/dist/generated/client/utils.gen.d.ts +34 -0
  15. package/dist/generated/client/utils.gen.d.ts.map +1 -0
  16. package/dist/generated/client/utils.gen.js +245 -0
  17. package/dist/generated/client/utils.gen.js.map +1 -0
  18. package/dist/generated/client.gen.d.ts +13 -0
  19. package/dist/generated/client.gen.d.ts.map +1 -0
  20. package/dist/generated/client.gen.js +7 -0
  21. package/dist/generated/client.gen.js.map +1 -0
  22. package/dist/generated/core/auth.gen.d.ts +19 -0
  23. package/dist/generated/core/auth.gen.d.ts.map +1 -0
  24. package/dist/generated/core/auth.gen.js +19 -0
  25. package/dist/generated/core/auth.gen.js.map +1 -0
  26. package/dist/generated/core/bodySerializer.gen.d.ts +26 -0
  27. package/dist/generated/core/bodySerializer.gen.d.ts.map +1 -0
  28. package/dist/generated/core/bodySerializer.gen.js +61 -0
  29. package/dist/generated/core/bodySerializer.gen.js.map +1 -0
  30. package/dist/generated/core/params.gen.d.ts +44 -0
  31. package/dist/generated/core/params.gen.d.ts.map +1 -0
  32. package/dist/generated/core/params.gen.js +105 -0
  33. package/dist/generated/core/params.gen.js.map +1 -0
  34. package/dist/generated/core/pathSerializer.gen.d.ts +34 -0
  35. package/dist/generated/core/pathSerializer.gen.d.ts.map +1 -0
  36. package/dist/generated/core/pathSerializer.gen.js +124 -0
  37. package/dist/generated/core/pathSerializer.gen.js.map +1 -0
  38. package/dist/generated/core/queryKeySerializer.gen.d.ts +19 -0
  39. package/dist/generated/core/queryKeySerializer.gen.d.ts.map +1 -0
  40. package/dist/generated/core/queryKeySerializer.gen.js +106 -0
  41. package/dist/generated/core/queryKeySerializer.gen.js.map +1 -0
  42. package/dist/generated/core/serverSentEvents.gen.d.ts +72 -0
  43. package/dist/generated/core/serverSentEvents.gen.d.ts.map +1 -0
  44. package/dist/generated/core/serverSentEvents.gen.js +140 -0
  45. package/dist/generated/core/serverSentEvents.gen.js.map +1 -0
  46. package/dist/generated/core/types.gen.d.ts +79 -0
  47. package/dist/generated/core/types.gen.d.ts.map +1 -0
  48. package/dist/generated/core/types.gen.js +4 -0
  49. package/dist/generated/core/types.gen.js.map +1 -0
  50. package/dist/generated/core/utils.gen.d.ts +20 -0
  51. package/dist/generated/core/utils.gen.d.ts.map +1 -0
  52. package/dist/generated/core/utils.gen.js +94 -0
  53. package/dist/generated/core/utils.gen.js.map +1 -0
  54. package/dist/generated/index.d.ts +3 -0
  55. package/dist/generated/index.d.ts.map +1 -0
  56. package/dist/generated/index.js +19 -0
  57. package/dist/generated/index.js.map +1 -0
  58. package/dist/generated/sdk.gen.d.ts +200 -0
  59. package/dist/generated/sdk.gen.d.ts.map +1 -0
  60. package/dist/generated/sdk.gen.js +254 -0
  61. package/dist/generated/sdk.gen.js.map +1 -0
  62. package/dist/generated/types.gen.d.ts +1437 -0
  63. package/dist/generated/types.gen.d.ts.map +1 -0
  64. package/dist/generated/types.gen.js +4 -0
  65. package/dist/generated/types.gen.js.map +1 -0
  66. package/dist/src/index.d.ts +100 -0
  67. package/dist/src/index.d.ts.map +1 -0
  68. package/dist/src/index.js +216 -0
  69. package/dist/src/index.js.map +1 -0
  70. package/generated/client/client.gen.ts +301 -0
  71. package/generated/client/index.ts +25 -0
  72. package/generated/client/types.gen.ts +241 -0
  73. package/generated/client/utils.gen.ts +332 -0
  74. package/generated/client.gen.ts +16 -0
  75. package/generated/core/auth.gen.ts +42 -0
  76. package/generated/core/bodySerializer.gen.ts +100 -0
  77. package/generated/core/params.gen.ts +176 -0
  78. package/generated/core/pathSerializer.gen.ts +181 -0
  79. package/generated/core/queryKeySerializer.gen.ts +136 -0
  80. package/generated/core/serverSentEvents.gen.ts +264 -0
  81. package/generated/core/types.gen.ts +118 -0
  82. package/generated/core/utils.gen.ts +143 -0
  83. package/generated/index.ts +4 -0
  84. package/generated/sdk.gen.ts +267 -0
  85. package/generated/types.gen.ts +1577 -0
  86. package/package.json +42 -0
  87. package/src/index.ts +273 -0
@@ -0,0 +1,267 @@
1
+ // This file is auto-generated by @hey-api/openapi-ts
2
+
3
+ import type { Client, Options as Options2, TDataShape } from './client';
4
+ import { client } from './client.gen';
5
+ import type { AddBankBackgroundData, AddBankBackgroundErrors, AddBankBackgroundResponses, CancelOperationData, CancelOperationErrors, CancelOperationResponses, ClearBankMemoriesData, ClearBankMemoriesErrors, ClearBankMemoriesResponses, CreateOrUpdateBankData, CreateOrUpdateBankErrors, CreateOrUpdateBankResponses, DeleteDocumentData, DeleteDocumentErrors, DeleteDocumentResponses, GetAgentStatsData, GetAgentStatsErrors, GetAgentStatsResponses, GetBankProfileData, GetBankProfileErrors, GetBankProfileResponses, GetChunkData, GetChunkErrors, GetChunkResponses, GetDocumentData, GetDocumentErrors, GetDocumentResponses, GetEntityData, GetEntityErrors, GetEntityResponses, GetGraphData, GetGraphErrors, GetGraphResponses, ListBanksData, ListBanksResponses, ListDocumentsData, ListDocumentsErrors, ListDocumentsResponses, ListEntitiesData, ListEntitiesErrors, ListEntitiesResponses, ListMemoriesData, ListMemoriesErrors, ListMemoriesResponses, ListOperationsData, ListOperationsErrors, ListOperationsResponses, MetricsEndpointMetricsGetData, MetricsEndpointMetricsGetResponses, RecallMemoriesData, RecallMemoriesErrors, RecallMemoriesResponses, ReflectData, ReflectErrors, ReflectResponses, RegenerateEntityObservationsData, RegenerateEntityObservationsErrors, RegenerateEntityObservationsResponses, RetainMemoriesData, RetainMemoriesErrors, RetainMemoriesResponses, UpdateBankPersonalityData, UpdateBankPersonalityErrors, UpdateBankPersonalityResponses } from './types.gen';
6
+
7
+ export type Options<TData extends TDataShape = TDataShape, ThrowOnError extends boolean = boolean> = Options2<TData, ThrowOnError> & {
8
+ /**
9
+ * You can provide a client instance returned by `createClient()` instead of
10
+ * individual options. This might be also useful if you want to implement a
11
+ * custom client.
12
+ */
13
+ client?: Client;
14
+ /**
15
+ * You can pass arbitrary values through the `meta` object. This can be
16
+ * used to access values that aren't defined as part of the SDK function.
17
+ */
18
+ meta?: Record<string, unknown>;
19
+ };
20
+
21
+ /**
22
+ * Prometheus metrics endpoint
23
+ *
24
+ * Exports metrics in Prometheus format for scraping
25
+ */
26
+ export const metricsEndpointMetricsGet = <ThrowOnError extends boolean = false>(options?: Options<MetricsEndpointMetricsGetData, ThrowOnError>) => (options?.client ?? client).get<MetricsEndpointMetricsGetResponses, unknown, ThrowOnError>({ url: '/metrics', ...options });
27
+
28
+ /**
29
+ * Get memory graph data
30
+ *
31
+ * Retrieve graph data for visualization, optionally filtered by type (world/agent/opinion). Limited to 1000 most recent items.
32
+ */
33
+ export const getGraph = <ThrowOnError extends boolean = false>(options: Options<GetGraphData, ThrowOnError>) => (options.client ?? client).get<GetGraphResponses, GetGraphErrors, ThrowOnError>({ url: '/v1/default/banks/{bank_id}/graph', ...options });
34
+
35
+ /**
36
+ * List memory units
37
+ *
38
+ * List memory units with pagination and optional full-text search. Supports filtering by type. Results are sorted by most recent first (mentioned_at DESC, then created_at DESC).
39
+ */
40
+ export const listMemories = <ThrowOnError extends boolean = false>(options: Options<ListMemoriesData, ThrowOnError>) => (options.client ?? client).get<ListMemoriesResponses, ListMemoriesErrors, ThrowOnError>({ url: '/v1/default/banks/{bank_id}/memories/list', ...options });
41
+
42
+ /**
43
+ * Recall memory
44
+ *
45
+ * Recall memory using semantic similarity and spreading activation.
46
+ *
47
+ * The type parameter is optional and must be one of:
48
+ * - 'world': General knowledge about people, places, events, and things that happen
49
+ * - 'agent': Memories about what the AI agent did, actions taken, and tasks performed
50
+ * - 'opinion': The bank's formed beliefs, perspectives, and viewpoints
51
+ * - 'observation': Synthesized observations about entities (generated automatically)
52
+ *
53
+ * Set include_entities=true to get entity observations alongside recall results.
54
+ */
55
+ export const recallMemories = <ThrowOnError extends boolean = false>(options: Options<RecallMemoriesData, ThrowOnError>) => (options.client ?? client).post<RecallMemoriesResponses, RecallMemoriesErrors, ThrowOnError>({
56
+ url: '/v1/default/banks/{bank_id}/memories/recall',
57
+ ...options,
58
+ headers: {
59
+ 'Content-Type': 'application/json',
60
+ ...options.headers
61
+ }
62
+ });
63
+
64
+ /**
65
+ * Reflect and generate answer
66
+ *
67
+ * Reflect and formulate an answer using bank identity, world facts, and opinions.
68
+ *
69
+ * This endpoint:
70
+ * 1. Retrieves agent facts (bank's identity)
71
+ * 2. Retrieves world facts relevant to the query
72
+ * 3. Retrieves existing opinions (bank's perspectives)
73
+ * 4. Uses LLM to formulate a contextual answer
74
+ * 5. Extracts and stores any new opinions formed
75
+ * 6. Returns plain text answer, the facts used, and new opinions
76
+ */
77
+ export const reflect = <ThrowOnError extends boolean = false>(options: Options<ReflectData, ThrowOnError>) => (options.client ?? client).post<ReflectResponses, ReflectErrors, ThrowOnError>({
78
+ url: '/v1/default/banks/{bank_id}/reflect',
79
+ ...options,
80
+ headers: {
81
+ 'Content-Type': 'application/json',
82
+ ...options.headers
83
+ }
84
+ });
85
+
86
+ /**
87
+ * List all memory banks
88
+ *
89
+ * Get a list of all agents with their profiles
90
+ */
91
+ export const listBanks = <ThrowOnError extends boolean = false>(options?: Options<ListBanksData, ThrowOnError>) => (options?.client ?? client).get<ListBanksResponses, unknown, ThrowOnError>({ url: '/v1/default/banks', ...options });
92
+
93
+ /**
94
+ * Get statistics for memory bank
95
+ *
96
+ * Get statistics about nodes and links for a specific agent
97
+ */
98
+ export const getAgentStats = <ThrowOnError extends boolean = false>(options: Options<GetAgentStatsData, ThrowOnError>) => (options.client ?? client).get<GetAgentStatsResponses, GetAgentStatsErrors, ThrowOnError>({ url: '/v1/default/banks/{bank_id}/stats', ...options });
99
+
100
+ /**
101
+ * List entities
102
+ *
103
+ * List all entities (people, organizations, etc.) known by the bank, ordered by mention count.
104
+ */
105
+ export const listEntities = <ThrowOnError extends boolean = false>(options: Options<ListEntitiesData, ThrowOnError>) => (options.client ?? client).get<ListEntitiesResponses, ListEntitiesErrors, ThrowOnError>({ url: '/v1/default/banks/{bank_id}/entities', ...options });
106
+
107
+ /**
108
+ * Get entity details
109
+ *
110
+ * Get detailed information about an entity including observations (mental model).
111
+ */
112
+ export const getEntity = <ThrowOnError extends boolean = false>(options: Options<GetEntityData, ThrowOnError>) => (options.client ?? client).get<GetEntityResponses, GetEntityErrors, ThrowOnError>({ url: '/v1/default/banks/{bank_id}/entities/{entity_id}', ...options });
113
+
114
+ /**
115
+ * Regenerate entity observations
116
+ *
117
+ * Regenerate observations for an entity based on all facts mentioning it.
118
+ */
119
+ export const regenerateEntityObservations = <ThrowOnError extends boolean = false>(options: Options<RegenerateEntityObservationsData, ThrowOnError>) => (options.client ?? client).post<RegenerateEntityObservationsResponses, RegenerateEntityObservationsErrors, ThrowOnError>({ url: '/v1/default/banks/{bank_id}/entities/{entity_id}/regenerate', ...options });
120
+
121
+ /**
122
+ * List documents
123
+ *
124
+ * List documents with pagination and optional search. Documents are the source content from which memory units are extracted.
125
+ */
126
+ export const listDocuments = <ThrowOnError extends boolean = false>(options: Options<ListDocumentsData, ThrowOnError>) => (options.client ?? client).get<ListDocumentsResponses, ListDocumentsErrors, ThrowOnError>({ url: '/v1/default/banks/{bank_id}/documents', ...options });
127
+
128
+ /**
129
+ * Delete a document
130
+ *
131
+ * Delete a document and all its associated memory units and links.
132
+ *
133
+ * This will cascade delete:
134
+ * - The document itself
135
+ * - All memory units extracted from this document
136
+ * - All links (temporal, semantic, entity) associated with those memory units
137
+ *
138
+ * This operation cannot be undone.
139
+ */
140
+ export const deleteDocument = <ThrowOnError extends boolean = false>(options: Options<DeleteDocumentData, ThrowOnError>) => (options.client ?? client).delete<DeleteDocumentResponses, DeleteDocumentErrors, ThrowOnError>({ url: '/v1/default/banks/{bank_id}/documents/{document_id}', ...options });
141
+
142
+ /**
143
+ * Get document details
144
+ *
145
+ * Get a specific document including its original text
146
+ */
147
+ export const getDocument = <ThrowOnError extends boolean = false>(options: Options<GetDocumentData, ThrowOnError>) => (options.client ?? client).get<GetDocumentResponses, GetDocumentErrors, ThrowOnError>({ url: '/v1/default/banks/{bank_id}/documents/{document_id}', ...options });
148
+
149
+ /**
150
+ * Get chunk details
151
+ *
152
+ * Get a specific chunk by its ID
153
+ */
154
+ export const getChunk = <ThrowOnError extends boolean = false>(options: Options<GetChunkData, ThrowOnError>) => (options.client ?? client).get<GetChunkResponses, GetChunkErrors, ThrowOnError>({ url: '/v1/default/chunks/{chunk_id}', ...options });
155
+
156
+ /**
157
+ * List async operations
158
+ *
159
+ * Get a list of all async operations (pending and failed) for a specific agent, including error messages for failed operations
160
+ */
161
+ export const listOperations = <ThrowOnError extends boolean = false>(options: Options<ListOperationsData, ThrowOnError>) => (options.client ?? client).get<ListOperationsResponses, ListOperationsErrors, ThrowOnError>({ url: '/v1/default/banks/{bank_id}/operations', ...options });
162
+
163
+ /**
164
+ * Cancel a pending async operation
165
+ *
166
+ * Cancel a pending async operation by removing it from the queue
167
+ */
168
+ export const cancelOperation = <ThrowOnError extends boolean = false>(options: Options<CancelOperationData, ThrowOnError>) => (options.client ?? client).delete<CancelOperationResponses, CancelOperationErrors, ThrowOnError>({ url: '/v1/default/banks/{bank_id}/operations/{operation_id}', ...options });
169
+
170
+ /**
171
+ * Get memory bank profile
172
+ *
173
+ * Get personality traits and background for a memory bank. Auto-creates agent with defaults if not exists.
174
+ */
175
+ export const getBankProfile = <ThrowOnError extends boolean = false>(options: Options<GetBankProfileData, ThrowOnError>) => (options.client ?? client).get<GetBankProfileResponses, GetBankProfileErrors, ThrowOnError>({ url: '/v1/default/banks/{bank_id}/profile', ...options });
176
+
177
+ /**
178
+ * Update memory bank personality
179
+ *
180
+ * Update bank's Big Five personality traits and bias strength
181
+ */
182
+ export const updateBankPersonality = <ThrowOnError extends boolean = false>(options: Options<UpdateBankPersonalityData, ThrowOnError>) => (options.client ?? client).put<UpdateBankPersonalityResponses, UpdateBankPersonalityErrors, ThrowOnError>({
183
+ url: '/v1/default/banks/{bank_id}/profile',
184
+ ...options,
185
+ headers: {
186
+ 'Content-Type': 'application/json',
187
+ ...options.headers
188
+ }
189
+ });
190
+
191
+ /**
192
+ * Add/merge memory bank background
193
+ *
194
+ * Add new background information or merge with existing. LLM intelligently resolves conflicts, normalizes to first person, and optionally infers personality traits.
195
+ */
196
+ export const addBankBackground = <ThrowOnError extends boolean = false>(options: Options<AddBankBackgroundData, ThrowOnError>) => (options.client ?? client).post<AddBankBackgroundResponses, AddBankBackgroundErrors, ThrowOnError>({
197
+ url: '/v1/default/banks/{bank_id}/background',
198
+ ...options,
199
+ headers: {
200
+ 'Content-Type': 'application/json',
201
+ ...options.headers
202
+ }
203
+ });
204
+
205
+ /**
206
+ * Create or update memory bank
207
+ *
208
+ * Create a new agent or update existing agent with personality and background. Auto-fills missing fields with defaults.
209
+ */
210
+ export const createOrUpdateBank = <ThrowOnError extends boolean = false>(options: Options<CreateOrUpdateBankData, ThrowOnError>) => (options.client ?? client).put<CreateOrUpdateBankResponses, CreateOrUpdateBankErrors, ThrowOnError>({
211
+ url: '/v1/default/banks/{bank_id}',
212
+ ...options,
213
+ headers: {
214
+ 'Content-Type': 'application/json',
215
+ ...options.headers
216
+ }
217
+ });
218
+
219
+ /**
220
+ * Clear memory bank memories
221
+ *
222
+ * Delete memory units for a memory bank. Optionally filter by type (world, agent, opinion) to delete only specific types. This is a destructive operation that cannot be undone. The bank profile (personality and background) will be preserved.
223
+ */
224
+ export const clearBankMemories = <ThrowOnError extends boolean = false>(options: Options<ClearBankMemoriesData, ThrowOnError>) => (options.client ?? client).delete<ClearBankMemoriesResponses, ClearBankMemoriesErrors, ThrowOnError>({ url: '/v1/default/banks/{bank_id}/memories', ...options });
225
+
226
+ /**
227
+ * Retain memories
228
+ *
229
+ * Retain memory items with automatic fact extraction.
230
+ *
231
+ * This is the main endpoint for storing memories. It supports both synchronous and asynchronous processing
232
+ * via the async parameter.
233
+ *
234
+ * Features:
235
+ * - Efficient batch processing
236
+ * - Automatic fact extraction from natural language
237
+ * - Entity recognition and linking
238
+ * - Document tracking with automatic upsert (when document_id is provided on items)
239
+ * - Temporal and semantic linking
240
+ * - Optional asynchronous processing
241
+ *
242
+ * The system automatically:
243
+ * 1. Extracts semantic facts from the content
244
+ * 2. Generates embeddings
245
+ * 3. Deduplicates similar facts
246
+ * 4. Creates temporal, semantic, and entity links
247
+ * 5. Tracks document metadata
248
+ *
249
+ * When async=true:
250
+ * - Returns immediately after queuing the task
251
+ * - Processing happens in the background
252
+ * - Use the operations endpoint to monitor progress
253
+ *
254
+ * When async=false (default):
255
+ * - Waits for processing to complete
256
+ * - Returns after all memories are stored
257
+ *
258
+ * Note: If a memory item has a document_id that already exists, the old document and its memory units will be deleted before creating new ones (upsert behavior). Items with the same document_id are grouped together for efficient processing.
259
+ */
260
+ export const retainMemories = <ThrowOnError extends boolean = false>(options: Options<RetainMemoriesData, ThrowOnError>) => (options.client ?? client).post<RetainMemoriesResponses, RetainMemoriesErrors, ThrowOnError>({
261
+ url: '/v1/default/banks/{bank_id}/memories',
262
+ ...options,
263
+ headers: {
264
+ 'Content-Type': 'application/json',
265
+ ...options.headers
266
+ }
267
+ });