@nebula-ai/sdk 1.1.28 → 1.1.30

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.
package/dist/index.d.mts CHANGED
@@ -123,12 +123,13 @@ interface ActivatedFacet {
123
123
  facet_id: string;
124
124
  facet_name: string;
125
125
  relevance_score: number;
126
- facts: ActivatedFact[];
126
+ facts: ActivatedKnowledge[];
127
127
  coherence_score?: number;
128
128
  is_noise: boolean;
129
129
  }
130
- interface ActivatedFact {
130
+ interface ActivatedKnowledge {
131
131
  id?: string;
132
+ category?: string;
132
133
  entity_id?: string;
133
134
  entity_name?: string;
134
135
  facet_name?: string;
@@ -140,8 +141,11 @@ interface ActivatedFact {
140
141
  corroboration_count?: number;
141
142
  confidence?: number;
142
143
  source_chunk_ids?: string[];
144
+ reasoning?: string;
145
+ resolved_at?: string;
146
+ source_nodegroup_ids?: string[];
143
147
  }
144
- interface GroundedUtterance {
148
+ interface GroundedSource {
145
149
  id?: string;
146
150
  text: string;
147
151
  activation_score: number;
@@ -154,29 +158,24 @@ interface GroundedUtterance {
154
158
  supporting_fact_ids?: string[];
155
159
  metadata?: Record<string, unknown>;
156
160
  }
157
- interface InferenceHint {
158
- term: string;
159
- predicate: string;
160
- object: string;
161
- inferred?: boolean;
162
- confidence?: number;
163
- ledger_p_use?: number;
164
- ledger_p_true?: number;
165
- ledger_p_stable?: number;
166
- usable_for_rewrite?: boolean;
167
- used_for_rewrite?: boolean;
168
- relationship_id?: string;
169
- subject_id?: string;
170
- object_id?: string;
171
- metadata?: Record<string, unknown>;
172
- inference_metadata?: Record<string, unknown>;
161
+ interface ActivatedEpisode {
162
+ id?: string;
163
+ name: string;
164
+ activation_score: number;
165
+ status?: string;
166
+ t_start?: number;
167
+ t_last?: number;
168
+ n_facts: number;
169
+ member_knowledge_ids?: string[];
170
+ source_chunk_ids?: string[];
171
+ entity_names?: string[];
173
172
  }
174
173
  interface MemoryResponse {
175
174
  query: string;
176
175
  entities: ActivatedEntity[];
177
- facts: ActivatedFact[];
178
- utterances: GroundedUtterance[];
179
- inference_hints?: InferenceHint[];
176
+ knowledge: ActivatedKnowledge[];
177
+ episodes?: ActivatedEpisode[];
178
+ sources: GroundedSource[];
180
179
  total_traversal_time_ms?: number;
181
180
  token_count?: number;
182
181
  }
@@ -304,16 +303,16 @@ declare class Nebula {
304
303
  };
305
304
  };
306
305
  }>;
307
- /** Delete a specific chunk or message within a memory */
308
- deleteChunk(chunkId: string): Promise<boolean>;
309
- /** Update a specific chunk or message within a memory */
310
- updateChunk(chunkId: string, content: string, metadata?: Record<string, unknown>): Promise<boolean>;
306
+ /** Delete a specific source within a memory */
307
+ deleteSource(sourceId: string): Promise<boolean>;
308
+ /** Update a specific source within a memory */
309
+ updateSource(sourceId: string, content: string, metadata?: Record<string, unknown>): Promise<boolean>;
311
310
  /**
312
311
  * Update memory-level properties including name, metadata, and collection associations.
313
312
  *
314
313
  * This method allows updating properties of an entire memory (document or conversation)
315
- * without modifying its content. For updating individual chunks or messages within a memory,
316
- * use updateChunk(). For updating content, use storeMemory() to append.
314
+ * without modifying its content. For updating individual sources within a memory,
315
+ * use updateSource(). For updating content, use storeMemory() to append.
317
316
  *
318
317
  * @param options - Update configuration
319
318
  * @param options.memoryId - The ID of the memory to update
@@ -546,4 +545,4 @@ type MemoryFactory = {
546
545
  declare const Memory: MemoryFactory;
547
546
  type Memory = Memory$1;
548
547
 
549
- export { type ActivatedEntity, type ActivatedFacet, type ActivatedFact, type Chunk, type Collection, type FileContentPart, type GraphCommunityResult, type GraphEntityResult, type GraphRelationshipResult, GraphSearchResultType, type GroundedUtterance, Memory, type MemoryResponse, type MultimodalContentPart, Nebula, NebulaAuthenticationException, type NebulaClientConfig, NebulaClientException, NebulaCollectionNotFoundException, NebulaContent, NebulaException, NebulaNotFoundException, NebulaRateLimitException, NebulaValidationException, type S3FileReferencePart, type SearchOptions, type SearchResult, type StructuredChunk, type TextContentPart, Nebula as default };
548
+ export { type ActivatedEntity, type ActivatedEpisode, type ActivatedFacet, type ActivatedKnowledge, type Chunk, type Collection, type FileContentPart, type GraphCommunityResult, type GraphEntityResult, type GraphRelationshipResult, GraphSearchResultType, type GroundedSource, Memory, type MemoryResponse, type MultimodalContentPart, Nebula, NebulaAuthenticationException, type NebulaClientConfig, NebulaClientException, NebulaCollectionNotFoundException, NebulaContent, NebulaException, NebulaNotFoundException, NebulaRateLimitException, NebulaValidationException, type S3FileReferencePart, type SearchOptions, type SearchResult, type StructuredChunk, type TextContentPart, Nebula as default };
package/dist/index.d.ts CHANGED
@@ -123,12 +123,13 @@ interface ActivatedFacet {
123
123
  facet_id: string;
124
124
  facet_name: string;
125
125
  relevance_score: number;
126
- facts: ActivatedFact[];
126
+ facts: ActivatedKnowledge[];
127
127
  coherence_score?: number;
128
128
  is_noise: boolean;
129
129
  }
130
- interface ActivatedFact {
130
+ interface ActivatedKnowledge {
131
131
  id?: string;
132
+ category?: string;
132
133
  entity_id?: string;
133
134
  entity_name?: string;
134
135
  facet_name?: string;
@@ -140,8 +141,11 @@ interface ActivatedFact {
140
141
  corroboration_count?: number;
141
142
  confidence?: number;
142
143
  source_chunk_ids?: string[];
144
+ reasoning?: string;
145
+ resolved_at?: string;
146
+ source_nodegroup_ids?: string[];
143
147
  }
144
- interface GroundedUtterance {
148
+ interface GroundedSource {
145
149
  id?: string;
146
150
  text: string;
147
151
  activation_score: number;
@@ -154,29 +158,24 @@ interface GroundedUtterance {
154
158
  supporting_fact_ids?: string[];
155
159
  metadata?: Record<string, unknown>;
156
160
  }
157
- interface InferenceHint {
158
- term: string;
159
- predicate: string;
160
- object: string;
161
- inferred?: boolean;
162
- confidence?: number;
163
- ledger_p_use?: number;
164
- ledger_p_true?: number;
165
- ledger_p_stable?: number;
166
- usable_for_rewrite?: boolean;
167
- used_for_rewrite?: boolean;
168
- relationship_id?: string;
169
- subject_id?: string;
170
- object_id?: string;
171
- metadata?: Record<string, unknown>;
172
- inference_metadata?: Record<string, unknown>;
161
+ interface ActivatedEpisode {
162
+ id?: string;
163
+ name: string;
164
+ activation_score: number;
165
+ status?: string;
166
+ t_start?: number;
167
+ t_last?: number;
168
+ n_facts: number;
169
+ member_knowledge_ids?: string[];
170
+ source_chunk_ids?: string[];
171
+ entity_names?: string[];
173
172
  }
174
173
  interface MemoryResponse {
175
174
  query: string;
176
175
  entities: ActivatedEntity[];
177
- facts: ActivatedFact[];
178
- utterances: GroundedUtterance[];
179
- inference_hints?: InferenceHint[];
176
+ knowledge: ActivatedKnowledge[];
177
+ episodes?: ActivatedEpisode[];
178
+ sources: GroundedSource[];
180
179
  total_traversal_time_ms?: number;
181
180
  token_count?: number;
182
181
  }
@@ -304,16 +303,16 @@ declare class Nebula {
304
303
  };
305
304
  };
306
305
  }>;
307
- /** Delete a specific chunk or message within a memory */
308
- deleteChunk(chunkId: string): Promise<boolean>;
309
- /** Update a specific chunk or message within a memory */
310
- updateChunk(chunkId: string, content: string, metadata?: Record<string, unknown>): Promise<boolean>;
306
+ /** Delete a specific source within a memory */
307
+ deleteSource(sourceId: string): Promise<boolean>;
308
+ /** Update a specific source within a memory */
309
+ updateSource(sourceId: string, content: string, metadata?: Record<string, unknown>): Promise<boolean>;
311
310
  /**
312
311
  * Update memory-level properties including name, metadata, and collection associations.
313
312
  *
314
313
  * This method allows updating properties of an entire memory (document or conversation)
315
- * without modifying its content. For updating individual chunks or messages within a memory,
316
- * use updateChunk(). For updating content, use storeMemory() to append.
314
+ * without modifying its content. For updating individual sources within a memory,
315
+ * use updateSource(). For updating content, use storeMemory() to append.
317
316
  *
318
317
  * @param options - Update configuration
319
318
  * @param options.memoryId - The ID of the memory to update
@@ -546,4 +545,4 @@ type MemoryFactory = {
546
545
  declare const Memory: MemoryFactory;
547
546
  type Memory = Memory$1;
548
547
 
549
- export { type ActivatedEntity, type ActivatedFacet, type ActivatedFact, type Chunk, type Collection, type FileContentPart, type GraphCommunityResult, type GraphEntityResult, type GraphRelationshipResult, GraphSearchResultType, type GroundedUtterance, Memory, type MemoryResponse, type MultimodalContentPart, Nebula, NebulaAuthenticationException, type NebulaClientConfig, NebulaClientException, NebulaCollectionNotFoundException, NebulaContent, NebulaException, NebulaNotFoundException, NebulaRateLimitException, NebulaValidationException, type S3FileReferencePart, type SearchOptions, type SearchResult, type StructuredChunk, type TextContentPart, Nebula as default };
548
+ export { type ActivatedEntity, type ActivatedEpisode, type ActivatedFacet, type ActivatedKnowledge, type Chunk, type Collection, type FileContentPart, type GraphCommunityResult, type GraphEntityResult, type GraphRelationshipResult, GraphSearchResultType, type GroundedSource, Memory, type MemoryResponse, type MultimodalContentPart, Nebula, NebulaAuthenticationException, type NebulaClientConfig, NebulaClientException, NebulaCollectionNotFoundException, NebulaContent, NebulaException, NebulaNotFoundException, NebulaRateLimitException, NebulaValidationException, type S3FileReferencePart, type SearchOptions, type SearchResult, type StructuredChunk, type TextContentPart, Nebula as default };
package/dist/index.js CHANGED
@@ -578,30 +578,30 @@ var _Nebula = class _Nebula {
578
578
  throw new NebulaClientException(`Unknown error: ${String(error)}`);
579
579
  }
580
580
  }
581
- /** Delete a specific chunk or message within a memory */
582
- async deleteChunk(chunkId) {
581
+ /** Delete a specific source within a memory */
582
+ async deleteSource(sourceId) {
583
583
  try {
584
- await this._makeRequest("DELETE", `/v1/chunks/${chunkId}`);
584
+ await this._makeRequest("DELETE", `/v1/sources/${sourceId}`);
585
585
  return true;
586
586
  } catch (error) {
587
587
  if (error instanceof NebulaException && error.statusCode === 404) {
588
- throw new NebulaNotFoundException(chunkId, "Chunk");
588
+ throw new NebulaNotFoundException(sourceId, "Source");
589
589
  }
590
590
  throw error;
591
591
  }
592
592
  }
593
- /** Update a specific chunk or message within a memory */
594
- async updateChunk(chunkId, content, metadata) {
593
+ /** Update a specific source within a memory */
594
+ async updateSource(sourceId, content, metadata) {
595
595
  const payload = { content };
596
596
  if (metadata !== void 0) {
597
597
  payload.metadata = metadata;
598
598
  }
599
599
  try {
600
- await this._makeRequest("PATCH", `/v1/chunks/${chunkId}`, payload);
600
+ await this._makeRequest("PATCH", `/v1/sources/${sourceId}`, payload);
601
601
  return true;
602
602
  } catch (error) {
603
603
  if (error instanceof NebulaException && error.statusCode === 404) {
604
- throw new NebulaNotFoundException(chunkId, "Chunk");
604
+ throw new NebulaNotFoundException(sourceId, "Source");
605
605
  }
606
606
  throw error;
607
607
  }
@@ -610,8 +610,8 @@ var _Nebula = class _Nebula {
610
610
  * Update memory-level properties including name, metadata, and collection associations.
611
611
  *
612
612
  * This method allows updating properties of an entire memory (document or conversation)
613
- * without modifying its content. For updating individual chunks or messages within a memory,
614
- * use updateChunk(). For updating content, use storeMemory() to append.
613
+ * without modifying its content. For updating individual sources within a memory,
614
+ * use updateSource(). For updating content, use storeMemory() to append.
615
615
  *
616
616
  * @param options - Update configuration
617
617
  * @param options.memoryId - The ID of the memory to update
@@ -847,9 +847,9 @@ var _Nebula = class _Nebula {
847
847
  const memoryResponse = {
848
848
  query: memoryResponseData.query || options.query,
849
849
  entities: memoryResponseData.entities || [],
850
- facts: memoryResponseData.facts || [],
851
- utterances: memoryResponseData.utterances || [],
852
- inference_hints: memoryResponseData.inference_hints || [],
850
+ knowledge: memoryResponseData.knowledge ?? [],
851
+ episodes: memoryResponseData.episodes || [],
852
+ sources: memoryResponseData.sources || memoryResponseData.utterances || [],
853
853
  total_traversal_time_ms: memoryResponseData.total_traversal_time_ms,
854
854
  token_count: memoryResponseData.token_count
855
855
  };