upleb.uk

Public git repos — served from a NIP-34 GRASP relay at git.upleb.uk

summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorpablof7z <pfer@me.com>2026-02-12 22:54:49 +0000
committerpablof7z <pfer@me.com>2026-02-12 22:54:49 +0000
commit51a5be04186773e6ffffe80992e80ed0dfad2d44 (patch)
tree2e28d59dbc09b39355a43a96f5bd10f76fcb7d8b
parente83326e6d45050f323de128e2e0b75ea9e0acde2 (diff)
Add NIP-AE: Agents
-rw-r--r--AE.md163
-rw-r--r--README.md5
2 files changed, 168 insertions, 0 deletions
diff --git a/AE.md b/AE.md
new file mode 100644
index 0000000..18432b8
--- /dev/null
+++ b/AE.md
@@ -0,0 +1,163 @@
1NIP-AE
2======
3
4Agents
5------
6
7`draft` `optional`
8
9Defines event kinds for agent definitions, lessons, nudges, and attribution.
10
11## Terminology
12
13An **agent definition** is a Nostr event describing an agent's identity, capabilities, and behavior. It is a template.
14
15An **agent** is a runtime instance: a signing keypair executing according to an agent definition.
16
17Multiple agents can instantiate from the same definition.
18
19## Behavior Model
20
21An agent's runtime behavior is composed of:
22
231. **Agent definition** — The base template (kind 4199)
242. **Lessons** — Behavioral refinements published by agents of the same definition (kind 4129)
253. **Lesson comments** — Human or agent corrections/additions to lessons (kind 1111)
26
27Execution platforms determine which lessons and comments to apply based on trust.
28
29---
30
31## Agent Definition (Kind 4199)
32
33```json
34{
35 "kind": 4199,
36 "pubkey": "<publisher-pubkey>",
37 "tags": [
38 ["title", "<agent-name>"],
39 ["role", "<expertise-and-personality>"],
40 ["instructions", "<operational-guidelines>"],
41 ["use-criteria", "<when-to-use-this-agent>"],
42 ["description", "<one-line-description>"],
43 ["tool", "<tool-name>"],
44 ["ver", "<version-number>"],
45 ["image", "<avatar-url>"]
46 ],
47 "content": ""
48}
49```
50
51### Tags
52
53- `title` — Agent name
54- `role` — Expertise, personality, approach
55- `instructions` — Operational guidelines
56- `use-criteria` — When to select this agent
57- `description` — One-line description
58- `tool` — Zero or more tags of tool names the agent expects to have
59- `ver` — Version number, defaults to `1`
60- `image` — Avatar URL
61
62---
63
64## Agent Nudge (Kind 4201)
65
66Nudges modify agent behavior and/or tool availability.
67
68```json
69{
70 "kind": 4201,
71 "pubkey": "<publisher-pubkey>",
72 "tags": [
73 ["title", "<nudge-title>"],
74 ["only-tool", "<tool-name>"],
75 ["allow-tool", "<tool-name>"],
76 ["deny-tool", "<tool-name>"]
77 ],
78 "content": "<behavioral-modifier>"
79}
80```
81
82### Tags
83
84- `title` — Short identifier
85- `only-tool` — Agent gets exactly these tools, overrides defaults
86- `allow-tool` — Add tool to default set (ignored if `only-tool` present)
87- `deny-tool` — Remove tool from default set (ignored if `only-tool` present)
88
89Precedence: `only-tool` > `allow-tool`/`deny-tool`. Multiple tool tags allowed.
90
91---
92
93## Agent Lesson (Kind 4129)
94
95Agents publish lessons learned during operation.
96
97```json
98{
99 "kind": 4129,
100 "pubkey": "<agent-pubkey>",
101 "tags": [
102 ["title", "<lesson-title>"],
103 ["category", "<topic-area>"],
104 ["e", "<agent-definition-id>"]
105 ],
106 "content": "<lesson-content>"
107}
108```
109
110### Tags
111
112- `title` — Short summary
113- `e` — Reference to the agent definition (kind 4199)
114- `category` — Topic classification
115
116Humans or agents can refine lessons using NIP-22 comments.
117
118---
119
120## Agent Attribution
121
122### Agent Profile (Kind 0)
123
124Agents publish kind 0 declaring their nature.
125
126- `bot` — Empty tag indicating automated pubkey
127- `e` — Reference to agent definition (kind 4199)
128- `p` — Claimed owner's pubkey
129
130```json
131{
132 "kind": 0,
133 "pubkey": "<agent-pubkey>",
134 "tags": [
135 ["bot"],
136 ["e", "<agent-definition-id>"],
137 ["p", "<owner-pubkey>"]
138 ],
139 "content": "{\"name\":\"Code Reviewer\"}"
140}
141```
142
143### Owner Claims (Kind 14199)
144
145Replaceable event where owners declare their agents.
146
147```json
148{
149 "kind": 14199,
150 "pubkey": "<owner-pubkey>",
151 "tags": [
152 ["p", "<agent-pubkey-1>"],
153 ["p", "<agent-pubkey-2>"]
154 ],
155 "content": ""
156}
157```
158
159### Bidirectional Verification
160
161Verified owner-agent relationship requires:
1621. Agent's kind 0 includes `["p", "<owner-pubkey>"]`
1632. Owner's kind 14199 includes `["p", "<agent-pubkey>"]`
diff --git a/README.md b/README.md
index 2e11906..9106759 100644
--- a/README.md
+++ b/README.md
@@ -105,6 +105,7 @@ They exist to document what may be implemented by [Nostr](https://github.com/nos
105- [NIP-99: Classified Listings](99.md) 105- [NIP-99: Classified Listings](99.md)
106- [NIP-A0: Voice Messages](A0.md) 106- [NIP-A0: Voice Messages](A0.md)
107- [NIP-A4: Public Messages](A4.md) 107- [NIP-A4: Public Messages](A4.md)
108- [NIP-AE: Agents](AE.md)
108- [NIP-B0: Web Bookmarks](B0.md) 109- [NIP-B0: Web Bookmarks](B0.md)
109- [NIP-B7: Blossom](B7.md) 110- [NIP-B7: Blossom](B7.md)
110- [NIP-BE: Nostr BLE Communications Protocol](BE.md) 111- [NIP-BE: Nostr BLE Communications Protocol](BE.md)
@@ -178,6 +179,9 @@ They exist to document what may be implemented by [Nostr](https://github.com/nos
178| `2003` | Torrent | [35](35.md) | 179| `2003` | Torrent | [35](35.md) |
179| `2004` | Torrent Comment | [35](35.md) | 180| `2004` | Torrent Comment | [35](35.md) |
180| `2022` | Coinjoin Pool | [joinstr][joinstr] | 181| `2022` | Coinjoin Pool | [joinstr][joinstr] |
182| `4129` | Agent Lesson | [AE](AE.md) |
183| `4199` | Agent Definition | [AE](AE.md) |
184| `4201` | Agent Nudge | [AE](AE.md) |
181| `4550` | Community Post Approval | [72](72.md) | 185| `4550` | Community Post Approval | [72](72.md) |
182| `5000`-`5999` | Job Request | [90](90.md) | 186| `5000`-`5999` | Job Request | [90](90.md) |
183| `6000`-`6999` | Job Result | [90](90.md) | 187| `6000`-`6999` | Job Result | [90](90.md) |
@@ -221,6 +225,7 @@ They exist to document what may be implemented by [Nostr](https://github.com/nos
221| `11111` | Transport Method Announcement | [Nostr Epoxy][nostr-epoxy] | 225| `11111` | Transport Method Announcement | [Nostr Epoxy][nostr-epoxy] |
222| `13194` | Wallet Info | [47](47.md) | 226| `13194` | Wallet Info | [47](47.md) |
223| `13534` | Membership Lists | [43](43.md) | 227| `13534` | Membership Lists | [43](43.md) |
228| `14199` | Agent List | [AE](AE.md) |
224| `14388` | User Sound Effect Lists | [Corny Chat][cornychat-usersoundlist] | 229| `14388` | User Sound Effect Lists | [Corny Chat][cornychat-usersoundlist] |
225| `17375` | Cashu Wallet Event | [60](60.md) | 230| `17375` | Cashu Wallet Event | [60](60.md) |
226| `21000` | Lightning Pub RPC | [Lightning.Pub][lnpub] | 231| `21000` | Lightning Pub RPC | [Lightning.Pub][lnpub] |