OverviewFilesCommitsIssuesDocsReleasesPeers

ollama_semantic_function_calling commits / 9b8326a

Add documentation for Keet identity setup and device linking
9b8326a5526ae0d96aa882166f2d44a274d4133a
by fleeky.ashatron <fleeky@7rnx.net> · 2025-04-21T18:47:19.000Z

Changed files (1) +141 -0

ollamatools-new/KEET_IDENTITY_README.md +141 -0
……@@ -0,0 +1,141 @@
1# Keet Identity and Device Linking
2
3This document explains how to set up a real identity for the Keet bot and link multiple devices to the same identity.
4
5## Identity Structure
6
7A Keet identity consists of two main components:
8
91. The main identity file (`identity.json`) in the storage root directory
102. A simplified identity file (`identity.json`) in the database directory
11
12Both files need to be properly configured for the identity to be recognized as a real identity by the Keet client.
13
14### Main Identity File
15
16The main identity file (`test-keet-storage/identity.json`) has the following structure:
17
18```json
19{
20 "anonymous": false,
21 "memberId": "s3hngfgxfgs9db17jxynwxpdyieq8sesoo91wnd5mycp56t6o5ay",
22 "timestamp": 1745254354218,
23 "displayName": "KeetBot",
24 "avatar": null,
25 "devices": [
26 {
27 "deviceId": "s3hngfgxfgs9db17jxynwxpdyieq8sesoo91wnd5mycp56t6o5ay",
28 "isMobile": false,
29 "name": null,
30 "confirmed": true
31 },
32 {
33 "deviceId": "device-1745260473843",
34 "isMobile": true,
35 "name": "Mobile Device",
36 "confirmed": true
37 }
38 ],
39 "local": {
40 "deviceId": "s3hngfgxfgs9db17jxynwxpdyieq8sesoo91wnd5mycp56t6o5ay"
41 }
42}
43```
44
45The key fields are:
46- `anonymous`: Must be set to `false` for a real identity
47- `memberId`: A unique identifier for the member (shared across all devices)
48- `devices`: An array of devices linked to this identity
49- `local.deviceId`: The device ID of the current device
50
51### Database Identity File
52
53The database identity file (`test-keet-storage/db/identity.json`) has a simpler structure:
54
55```json
56{
57 "id": "s3hngfgxfgs9db17jxynwxpdyieq8sesoo91wnd5mycp56t6o5ay",
58 "name": "KeetBot",
59 "anonymous": false
60}
61```
62
63The key fields are:
64- `id`: Should match the `memberId` in the main identity file
65- `name`: Should match the `displayName` in the main identity file
66- `anonymous`: Must be set to `false` for a real identity
67
68## Setting Up a Real Identity
69
70To set up a real identity for the Keet bot, you can use the `update_identity.js` script:
71
72```bash
73node tests/update_identity.js [--storage=path/to/storage] [--name=display-name]
74```
75
76This script will:
771. Read the existing identity file
782. Set `anonymous` to `false`
793. Update the display name if provided
804. Write the updated identity back to the file
81
82## Device Linking
83
84To link multiple devices to the same identity, you can use the `link_device.js` script:
85
86```bash
87cd second-device-keet && node link_device.js
88```
89
90This script will:
911. Read the identity from the first device
922. Create a new device ID
933. Create a new identity for the second device that links to the first device's identity
944. Update the first device's identity to include the new device
95
96### Confirming a Device
97
98After linking a device, you need to confirm it using the `keet_cmd.js` script:
99
100```bash
101node tests/keet_cmd.js --confirm-device=device-id --storage=path/to/storage
102```
103
104Alternatively, you can manually update the identity files to set the `confirmed` status to `true` for the device.
105
106## Running the Keet Bot
107
108### Primary Device
109
110To run the Keet bot on the primary device, use the `run_keet_bot.sh` script:
111
112```bash
113./run_keet_bot.sh <room-key> [model]
114```
115
116Example:
117```bash
118./run_keet_bot.sh pear://keet/abcdef123456 llama3.1:latest
119```
120
121### Secondary Device
122
123To run the Keet bot on the secondary device, use the `run_second_device.sh` script:
124
125```bash
126./run_second_device.sh <room-key> [model]
127```
128
129Example:
130```bash
131./run_second_device.sh pear://keet/abcdef123456 llama3.1:latest
132```
133
134## Troubleshooting
135
136If the Keet client doesn't recognize the bot as having a real identity, check the following:
137
1381. Make sure both identity files (`identity.json` in the storage root and in the `db` directory) have `anonymous` set to `false`
1392. Make sure the `id` in the database identity file matches the `memberId` in the main identity file
1403. Make sure the `name` in the database identity file matches the `displayName` in the main identity file
1414. Check if the Keet client is using a different storage location