@vectorize-io/hindsight-client 0.0.14 → 0.0.15
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/README.md +66 -34
- package/package.json +1 -1
package/README.md
CHANGED
|
@@ -1,57 +1,89 @@
|
|
|
1
|
-
#
|
|
1
|
+
# Hindsight TypeScript Client
|
|
2
2
|
|
|
3
|
-
TypeScript client for Hindsight
|
|
4
|
-
|
|
5
|
-
**Auto-generated from OpenAPI spec** - provides type-safe access to all Hindsight API endpoints.
|
|
3
|
+
TypeScript client library for the Hindsight API.
|
|
6
4
|
|
|
7
5
|
## Installation
|
|
8
6
|
|
|
9
7
|
```bash
|
|
10
|
-
npm install @hindsight
|
|
8
|
+
npm install @vectorize-io/hindsight-client
|
|
11
9
|
# or
|
|
12
|
-
yarn add @hindsight
|
|
10
|
+
yarn add @vectorize-io/hindsight-client
|
|
13
11
|
```
|
|
14
12
|
|
|
15
|
-
##
|
|
13
|
+
## Usage
|
|
16
14
|
|
|
17
15
|
```typescript
|
|
18
|
-
import {
|
|
16
|
+
import { HindsightClient } from '@vectorize-io/hindsight-client';
|
|
19
17
|
|
|
20
|
-
|
|
21
|
-
OpenAPI.BASE = 'http://localhost:8888';
|
|
18
|
+
const client = new HindsightClient({ baseUrl: 'http://localhost:8888' });
|
|
22
19
|
|
|
23
|
-
//
|
|
24
|
-
await
|
|
25
|
-
|
|
26
|
-
|
|
27
|
-
|
|
20
|
+
// Retain information
|
|
21
|
+
await client.retain('my-bank', 'Alice works at Google in Mountain View.');
|
|
22
|
+
|
|
23
|
+
// Recall memories
|
|
24
|
+
const results = await client.recall('my-bank', 'Where does Alice work?');
|
|
25
|
+
|
|
26
|
+
// Reflect and get an opinion
|
|
27
|
+
const response = await client.reflect('my-bank', 'What do you think about Alice\'s career?');
|
|
28
|
+
```
|
|
29
|
+
|
|
30
|
+
## API Reference
|
|
31
|
+
|
|
32
|
+
### `retain(bankId, content, options?)`
|
|
28
33
|
|
|
29
|
-
|
|
30
|
-
|
|
31
|
-
|
|
32
|
-
|
|
33
|
-
|
|
34
|
+
Store a single memory.
|
|
35
|
+
|
|
36
|
+
```typescript
|
|
37
|
+
await client.retain('my-bank', 'User prefers dark mode', {
|
|
38
|
+
timestamp: new Date(),
|
|
39
|
+
context: 'Settings conversation',
|
|
40
|
+
metadata: { source: 'chat' }
|
|
34
41
|
});
|
|
42
|
+
```
|
|
35
43
|
|
|
36
|
-
|
|
44
|
+
### `retainBatch(bankId, items, options?)`
|
|
45
|
+
|
|
46
|
+
Store multiple memories in batch.
|
|
47
|
+
|
|
48
|
+
```typescript
|
|
49
|
+
await client.retainBatch('my-bank', [
|
|
50
|
+
{ content: 'Alice loves hiking' },
|
|
51
|
+
{ content: 'Alice visited Paris last summer' }
|
|
52
|
+
], { async: true });
|
|
37
53
|
```
|
|
38
54
|
|
|
39
|
-
|
|
55
|
+
### `recall(bankId, query, options?)`
|
|
40
56
|
|
|
41
|
-
|
|
42
|
-
- `SearchService` - Semantic and temporal search
|
|
43
|
-
- `ReasoningService` - Personality-driven thinking
|
|
44
|
-
- `VisualizationService` - Memory graphs and statistics
|
|
45
|
-
- `ManagementService` - Agent profiles and configuration
|
|
46
|
-
- `DocumentsService` - Document tracking
|
|
57
|
+
Recall memories matching a query.
|
|
47
58
|
|
|
48
|
-
|
|
59
|
+
```typescript
|
|
60
|
+
const results = await client.recall('my-bank', 'What are Alice\'s hobbies?', {
|
|
61
|
+
budget: 'mid'
|
|
62
|
+
});
|
|
63
|
+
```
|
|
64
|
+
|
|
65
|
+
### `reflect(bankId, query, options?)`
|
|
66
|
+
|
|
67
|
+
Generate a contextual answer using the bank's identity and memories.
|
|
68
|
+
|
|
69
|
+
```typescript
|
|
70
|
+
const response = await client.reflect('my-bank', 'What should I do this weekend?', {
|
|
71
|
+
budget: 'low'
|
|
72
|
+
});
|
|
73
|
+
console.log(response.text);
|
|
74
|
+
```
|
|
75
|
+
|
|
76
|
+
### `createBank(bankId, options)`
|
|
49
77
|
|
|
50
|
-
|
|
78
|
+
Create or update a memory bank with personality.
|
|
51
79
|
|
|
52
|
-
|
|
80
|
+
```typescript
|
|
81
|
+
await client.createBank('my-bank', {
|
|
82
|
+
name: 'My Assistant',
|
|
83
|
+
background: 'A helpful assistant that remembers everything.'
|
|
84
|
+
});
|
|
85
|
+
```
|
|
53
86
|
|
|
54
|
-
##
|
|
87
|
+
## Documentation
|
|
55
88
|
|
|
56
|
-
|
|
57
|
-
- [Full Documentation](https://github.com/vectorize-io/hindsight/blob/main/README.md)
|
|
89
|
+
For full documentation, visit [hindsight](https://github.com/vectorize-io/hindsight).
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@vectorize-io/hindsight-client",
|
|
3
|
-
"version": "0.0.
|
|
3
|
+
"version": "0.0.15",
|
|
4
4
|
"description": "TypeScript client for Hindsight - Semantic memory system with personality-driven thinking",
|
|
5
5
|
"main": "./dist/src/index.js",
|
|
6
6
|
"types": "./dist/src/index.d.ts",
|