knos 0.1.0__tar.gz
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.
- knos-0.1.0/.gitignore +39 -0
- knos-0.1.0/LICENSE +21 -0
- knos-0.1.0/PKG-INFO +331 -0
- knos-0.1.0/README.md +280 -0
- knos-0.1.0/contracts/README.md +38 -0
- knos-0.1.0/pyproject.toml +55 -0
- knos-0.1.0/src/knos/__init__.py +3 -0
- knos-0.1.0/src/knos/answer.py +368 -0
- knos-0.1.0/src/knos/cli.py +426 -0
- knos-0.1.0/src/knos/code.py +271 -0
- knos-0.1.0/src/knos/errors.py +118 -0
- knos-0.1.0/src/knos/git.py +97 -0
- knos-0.1.0/src/knos/help.py +117 -0
- knos-0.1.0/src/knos/link.py +113 -0
- knos-0.1.0/src/knos/mcp.py +387 -0
- knos-0.1.0/src/knos/memory.py +520 -0
- knos-0.1.0/src/knos/paths.py +46 -0
- knos-0.1.0/src/knos/pay.py +106 -0
- knos-0.1.0/src/knos/private.py +133 -0
- knos-0.1.0/src/knos/sessions.py +269 -0
- knos-0.1.0/src/knos/team.py +207 -0
- knos-0.1.0/tests/conftest.py +47 -0
- knos-0.1.0/tests/test_cli.py +273 -0
- knos-0.1.0/tests/test_failures.py +145 -0
- knos-0.1.0/tests/test_intent.py +425 -0
- knos-0.1.0/tests/test_memory.py +293 -0
- knos-0.1.0/tests/test_pay.py +88 -0
- knos-0.1.0/tests/test_private.py +103 -0
- knos-0.1.0/tests/test_recall.py +81 -0
- knos-0.1.0/tests/test_sessions.py +179 -0
- knos-0.1.0/tests/test_sibyl_is_load_bearing.py +179 -0
- knos-0.1.0/tests/test_team.py +133 -0
- knos-0.1.0/tests/test_twohop.py +97 -0
knos-0.1.0/.gitignore
ADDED
|
@@ -0,0 +1,39 @@
|
|
|
1
|
+
# Python
|
|
2
|
+
.venv/
|
|
3
|
+
__pycache__/
|
|
4
|
+
*.py[cod]
|
|
5
|
+
*.egg-info/
|
|
6
|
+
dist/
|
|
7
|
+
build/
|
|
8
|
+
.pytest_cache/
|
|
9
|
+
|
|
10
|
+
# knos's own data, and the keys it made. Neither belongs to anyone else.
|
|
11
|
+
.knos/
|
|
12
|
+
.knos-keys/
|
|
13
|
+
*.keystore
|
|
14
|
+
keystore/
|
|
15
|
+
access.json
|
|
16
|
+
|
|
17
|
+
# Secrets, in case one ever lands here
|
|
18
|
+
.env
|
|
19
|
+
.env.*
|
|
20
|
+
*.pem
|
|
21
|
+
*.key
|
|
22
|
+
id_rsa*
|
|
23
|
+
.npmrc
|
|
24
|
+
.pypirc
|
|
25
|
+
|
|
26
|
+
# Machine-specific agent config. `knos connect` prints the right one for
|
|
27
|
+
# whoever cloned this, so a copy of mine is worse than none.
|
|
28
|
+
.mcp.json
|
|
29
|
+
|
|
30
|
+
# Node
|
|
31
|
+
node_modules/
|
|
32
|
+
agent/node_modules/
|
|
33
|
+
|
|
34
|
+
# Foundry: build output, and dependencies that `forge install` fetches
|
|
35
|
+
contracts/out/
|
|
36
|
+
contracts/cache/
|
|
37
|
+
contracts/broadcast/
|
|
38
|
+
contracts/lib/
|
|
39
|
+
knos.mcpb
|
knos-0.1.0/LICENSE
ADDED
|
@@ -0,0 +1,21 @@
|
|
|
1
|
+
MIT License
|
|
2
|
+
|
|
3
|
+
Copyright (c) 2026 knos contributors
|
|
4
|
+
|
|
5
|
+
Permission is hereby granted, free of charge, to any person obtaining a copy
|
|
6
|
+
of this software and associated documentation files (the "Software"), to deal
|
|
7
|
+
in the Software without restriction, including without limitation the rights
|
|
8
|
+
to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
|
|
9
|
+
copies of the Software, and to permit persons to whom the Software is
|
|
10
|
+
furnished to do so, subject to the following conditions:
|
|
11
|
+
|
|
12
|
+
The above copyright notice and this permission notice shall be included in all
|
|
13
|
+
copies or substantial portions of the Software.
|
|
14
|
+
|
|
15
|
+
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
|
|
16
|
+
IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
|
|
17
|
+
FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
|
|
18
|
+
AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
|
|
19
|
+
LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
|
|
20
|
+
OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
|
|
21
|
+
SOFTWARE.
|
knos-0.1.0/PKG-INFO
ADDED
|
@@ -0,0 +1,331 @@
|
|
|
1
|
+
Metadata-Version: 2.5
|
|
2
|
+
Name: knos
|
|
3
|
+
Version: 0.1.0
|
|
4
|
+
Summary: One memory for every coding agent on your machine, and it knows which of them is in your code right now.
|
|
5
|
+
Project-URL: Homepage, https://github.com/drexthealpha/Knos
|
|
6
|
+
Project-URL: Repository, https://github.com/drexthealpha/Knos
|
|
7
|
+
Project-URL: Issues, https://github.com/drexthealpha/Knos/issues
|
|
8
|
+
Author-email: drexthealpha <zulibro1999@gmail.com>
|
|
9
|
+
License: MIT License
|
|
10
|
+
|
|
11
|
+
Copyright (c) 2026 knos contributors
|
|
12
|
+
|
|
13
|
+
Permission is hereby granted, free of charge, to any person obtaining a copy
|
|
14
|
+
of this software and associated documentation files (the "Software"), to deal
|
|
15
|
+
in the Software without restriction, including without limitation the rights
|
|
16
|
+
to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
|
|
17
|
+
copies of the Software, and to permit persons to whom the Software is
|
|
18
|
+
furnished to do so, subject to the following conditions:
|
|
19
|
+
|
|
20
|
+
The above copyright notice and this permission notice shall be included in all
|
|
21
|
+
copies or substantial portions of the Software.
|
|
22
|
+
|
|
23
|
+
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
|
|
24
|
+
IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
|
|
25
|
+
FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
|
|
26
|
+
AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
|
|
27
|
+
LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
|
|
28
|
+
OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
|
|
29
|
+
SOFTWARE.
|
|
30
|
+
License-File: LICENSE
|
|
31
|
+
Keywords: agents,coordination,local-first,mcp,memory
|
|
32
|
+
Classifier: Development Status :: 4 - Beta
|
|
33
|
+
Classifier: Environment :: Console
|
|
34
|
+
Classifier: Intended Audience :: Developers
|
|
35
|
+
Classifier: License :: OSI Approved :: MIT License
|
|
36
|
+
Classifier: Operating System :: OS Independent
|
|
37
|
+
Classifier: Programming Language :: Python :: 3
|
|
38
|
+
Classifier: Programming Language :: Python :: 3.10
|
|
39
|
+
Classifier: Programming Language :: Python :: 3.11
|
|
40
|
+
Classifier: Programming Language :: Python :: 3.12
|
|
41
|
+
Classifier: Topic :: Software Development :: Libraries :: Python Modules
|
|
42
|
+
Classifier: Topic :: Software Development :: Version Control :: Git
|
|
43
|
+
Requires-Python: >=3.10
|
|
44
|
+
Requires-Dist: mcp>=2.0
|
|
45
|
+
Requires-Dist: rich>=13
|
|
46
|
+
Requires-Dist: sibyl-memory-client>=0.7.0
|
|
47
|
+
Requires-Dist: typer>=0.12
|
|
48
|
+
Provides-Extra: dev
|
|
49
|
+
Requires-Dist: pytest>=7; extra == 'dev'
|
|
50
|
+
Description-Content-Type: text/markdown
|
|
51
|
+
|
|
52
|
+
# Knos
|
|
53
|
+
|
|
54
|
+
Two agents are open on the same repo. Claude Code is rewriting the parser.
|
|
55
|
+
Cursor, knowing nothing about that, is about to rewrite it too. Meanwhile the
|
|
56
|
+
decision you explained yesterday died with the session it was in, so you write
|
|
57
|
+
it down in `CLAUDE.md`, and again in `AGENTS.md`, and again in your editor's
|
|
58
|
+
rules — three copies drifting apart from the day you write them.
|
|
59
|
+
|
|
60
|
+
**Knos is one memory for every coding agent on your machine, and it knows
|
|
61
|
+
which of them is in your code right now.**
|
|
62
|
+
|
|
63
|
+
```bash
|
|
64
|
+
pip install knos
|
|
65
|
+
knos point .
|
|
66
|
+
knos ask "why did we drop redis?"
|
|
67
|
+
```
|
|
68
|
+
|
|
69
|
+
About fifteen seconds to the first answer, and every answer names its source:
|
|
70
|
+
a file and line, a session and a date, or a commit. No account, no key, no
|
|
71
|
+
server, no config file.
|
|
72
|
+
|
|
73
|
+
Then give your other agent the same memory, once:
|
|
74
|
+
|
|
75
|
+
```bash
|
|
76
|
+
knos connect --write
|
|
77
|
+
```
|
|
78
|
+
|
|
79
|
+
Restart it and both know everything. Nothing to keep in sync, and nothing
|
|
80
|
+
leaves this machine.
|
|
81
|
+
|
|
82
|
+
<sub>For answers that name a file and line, Knos uses
|
|
83
|
+
[universal-ctags](https://github.com/universal-ctags/ctags) if you have it:
|
|
84
|
+
`winget install UniversalCtags.Ctags`, `brew install universal-ctags`, or
|
|
85
|
+
`sudo apt install universal-ctags`. Without it you still get every answer from
|
|
86
|
+
your sessions and commits.</sub>
|
|
87
|
+
|
|
88
|
+
---
|
|
89
|
+
|
|
90
|
+
## Core flow
|
|
91
|
+
|
|
92
|
+
The part a markdown file cannot do. Longer walkthrough in
|
|
93
|
+
[docs/core-flow.md](docs/core-flow.md).
|
|
94
|
+
|
|
95
|
+
```mermaid
|
|
96
|
+
flowchart TD
|
|
97
|
+
A["Agent A<br>rewriting the parser"] -->|"claims it"| S[("Knos<br>one shared memory")]
|
|
98
|
+
|
|
99
|
+
B["Agent B<br>asks about the parser"] -->|"asks"| S
|
|
100
|
+
S -->|"withheld - held by Agent A"| B
|
|
101
|
+
|
|
102
|
+
B -->|"asks again with a reason"| S
|
|
103
|
+
S -->|"answers, and writes the reason down"| B
|
|
104
|
+
|
|
105
|
+
A -->|"knos done"| S
|
|
106
|
+
S -->|"open to everyone again"| B
|
|
107
|
+
|
|
108
|
+
D["delete the store"] -.->|"nothing is held back"| S
|
|
109
|
+
|
|
110
|
+
style S fill:#1f2933,stroke:#7b8794,color:#ffffff
|
|
111
|
+
style A fill:#e8f0fe,stroke:#4a6fa5,color:#111111
|
|
112
|
+
style B fill:#fdf0e8,stroke:#a5744a,color:#111111
|
|
113
|
+
style D fill:#f5f5f5,stroke:#999999,color:#111111,stroke-dasharray: 4 3
|
|
114
|
+
```
|
|
115
|
+
|
|
116
|
+
1. **An agent claims work.** It says what it is about to do. The claim lapses
|
|
117
|
+
on its own after thirty minutes.
|
|
118
|
+
2. **The next agent is withheld.** Not warned — withheld. It gets who holds
|
|
119
|
+
the work, and nothing else.
|
|
120
|
+
3. **Override costs a reason.** Standing down is free. Taking the work anyway
|
|
121
|
+
is written down permanently, under that agent's name.
|
|
122
|
+
4. **`knos done` releases it.** What happened stays written down.
|
|
123
|
+
5. **Delete the store and it all goes.** One SQLite file, no second copy.
|
|
124
|
+
|
|
125
|
+
Knos cannot stop an agent editing a file — it has no authority over an editor,
|
|
126
|
+
and any tool claiming otherwise is not telling you the truth. What it owns is
|
|
127
|
+
what it knows, and on contested work it declines to be the source.
|
|
128
|
+
|
|
129
|
+
---
|
|
130
|
+
|
|
131
|
+
## What an answer looks like
|
|
132
|
+
|
|
133
|
+
Knos has no model. It does not write prose, and it does not summarise. An
|
|
134
|
+
answer is what was actually said or committed, and under it, where that came
|
|
135
|
+
from:
|
|
136
|
+
|
|
137
|
+
```
|
|
138
|
+
$ knos ask "why did we change the vercel build"
|
|
139
|
+
|
|
140
|
+
Vercel ships its own pnpm which rejects lockfileVersion 9.0; installing a
|
|
141
|
+
version globally does not change which binary the build shell resolves.
|
|
142
|
+
commit ee0b903f 2026-08-19
|
|
143
|
+
```
|
|
144
|
+
|
|
145
|
+
Sometimes the answer needs two sources at once — a session that says *why*
|
|
146
|
+
and a commit that says *what* — and neither one alone will do:
|
|
147
|
+
|
|
148
|
+
```
|
|
149
|
+
we agreed to move the retry logic out of src/auth.py because it was
|
|
150
|
+
retrying the password check as well as the token refresh
|
|
151
|
+
and src/auth.py changed: Split token refresh out of login
|
|
152
|
+
Claude Code session beef0001 2026-08-21, then commit 4c11ade0 2026-08-22
|
|
153
|
+
```
|
|
154
|
+
|
|
155
|
+
## Seeing it work
|
|
156
|
+
|
|
157
|
+
```
|
|
158
|
+
knos status
|
|
159
|
+
|
|
160
|
+
journal 474 things learned appended, never rewritten
|
|
161
|
+
warm 12 things named replaced in place
|
|
162
|
+
hot 2 claimed one each, expires after 30 min
|
|
163
|
+
reference your-repo written once, when read
|
|
164
|
+
archive 1 forgotten on knos forget
|
|
165
|
+
1.9 MB of 5 MB used
|
|
166
|
+
|
|
167
|
+
who stood down for whom, while a claim was live
|
|
168
|
+
Cursor stood down for Claude Code on parser
|
|
169
|
+
Cursor took deploys anyway: the build is broken
|
|
170
|
+
```
|
|
171
|
+
|
|
172
|
+
Five kinds of memory, each behaving differently, all in one SQLite file on
|
|
173
|
+
your machine. The full walkthrough is in [docs/core-flow.md](docs/core-flow.md).
|
|
174
|
+
|
|
175
|
+
## What it can see
|
|
176
|
+
|
|
177
|
+
| Source | Read from |
|
|
178
|
+
|---|---|
|
|
179
|
+
| Agent sessions | Claude Code transcripts, Cursor's history |
|
|
180
|
+
| What you told it | `knos remember`, and your agents' `remember` tool |
|
|
181
|
+
| Commits | `git log`, who changed what and when |
|
|
182
|
+
| Code structure | [universal-ctags](https://github.com/universal-ctags/ctags), if installed |
|
|
183
|
+
|
|
184
|
+
## What your agents cannot see
|
|
185
|
+
|
|
186
|
+
`.env`, `*.pem`, `id_rsa`, `.ssh`, `.aws` and twelve more are private the
|
|
187
|
+
moment Knos reads a repo. Nobody has to ask for that.
|
|
188
|
+
|
|
189
|
+
Private means invisible, not redacted. An agent asking about a private path
|
|
190
|
+
is told nothing — no result, no count, no "2 hidden". You can still search
|
|
191
|
+
all of it yourself.
|
|
192
|
+
|
|
193
|
+
```bash
|
|
194
|
+
knos private notes/salary.md
|
|
195
|
+
```
|
|
196
|
+
|
|
197
|
+
## Sharing a folder with a teammate
|
|
198
|
+
|
|
199
|
+
```bash
|
|
200
|
+
knos share ./src --with alice.base.eth
|
|
201
|
+
knos unshare ./src --with alice.base.eth
|
|
202
|
+
```
|
|
203
|
+
|
|
204
|
+
Their agent can read that folder and nothing else — not the rest of the
|
|
205
|
+
repo, and never your secrets. After the second command, the same question
|
|
206
|
+
comes back with nothing.
|
|
207
|
+
|
|
208
|
+
The record of who may read what is
|
|
209
|
+
[Access.sol](contracts/src/Access.sol) on Base Sepolia, so neither of you has
|
|
210
|
+
to trust the other's copy of it. It is testnet only and costs nothing, and
|
|
211
|
+
none of that is your teammate's problem: they see a name and a folder.
|
|
212
|
+
|
|
213
|
+
**The whole cycle, in order.** The two `knos` commands each send one
|
|
214
|
+
transaction to Base Sepolia and wait for it to settle before returning, so
|
|
215
|
+
what the middle step sees is the truth and not a stale read.
|
|
216
|
+
|
|
217
|
+
```bash
|
|
218
|
+
knos share crates --with 0xTEAMMATE # grant, ~3s
|
|
219
|
+
# their agent now asks its own client:
|
|
220
|
+
# search("risk guard", on_behalf_of="0xTEAMMATE") -> answers from crates/
|
|
221
|
+
knos unshare crates --with 0xTEAMMATE # revoke, ~4s
|
|
222
|
+
# the same question now returns: Nothing shared with you.
|
|
223
|
+
```
|
|
224
|
+
|
|
225
|
+
The teammate's read goes through their agent rather than the command line:
|
|
226
|
+
`on_behalf_of` is an argument to the `search` tool, and there is deliberately
|
|
227
|
+
no flag that lets you impersonate somebody from your own shell.
|
|
228
|
+
|
|
229
|
+
**Or verify without running anything.** The contract is
|
|
230
|
+
[`0x955fa320…6E52`](https://sepolia.basescan.org/address/0x955fa320D60D9172CF048141ed7eEE442da66E52)
|
|
231
|
+
on Base Sepolia, and one full grant-then-revoke cycle is on chain:
|
|
232
|
+
|
|
233
|
+
| | |
|
|
234
|
+
|---|---|
|
|
235
|
+
| [deploy](https://sepolia.basescan.org/tx/0xdcc25ff7460a09a080ec32016b39121b6a34b741f03411bcfdc2ee2a93b31d21) | `0xdcc25ff7…` |
|
|
236
|
+
| [grant](https://sepolia.basescan.org/tx/0x84e11e21315b51e9e6b6453d226a44bcabf5a80f4c0085ba6f5b56ed169a92b6) | `0x84e11e21…` |
|
|
237
|
+
| [revoke](https://sepolia.basescan.org/tx/0xb3ea6920c0a7bf7fa9dde64e6f0c2275e149f976bf20c909098a2431417adfb4) | `0xb3ea6920…` |
|
|
238
|
+
|
|
239
|
+
Between the second and the third, a teammate's agent could read the shared
|
|
240
|
+
folder. After the third, the same question returned nothing. The permission
|
|
241
|
+
itself is OpenZeppelin's `AccessControl`; the contract only names the roles.
|
|
242
|
+
Nine tests: `cd contracts && forge test`. More in
|
|
243
|
+
[contracts/README.md](contracts/README.md).
|
|
244
|
+
|
|
245
|
+
## Selling an answer
|
|
246
|
+
|
|
247
|
+
Knos is registered on the Virtuals agent marketplace as a provider, so another
|
|
248
|
+
agent can pay it a hundredth of a dollar to answer a question from this
|
|
249
|
+
machine's memory. One offering. No evaluator, no reputation system.
|
|
250
|
+
|
|
251
|
+
| | |
|
|
252
|
+
|---|---|
|
|
253
|
+
| Agent | [Knos](https://app.virtuals.io/acp/agents/01a05b97-a776-760a-9165-e9893e4091dc) |
|
|
254
|
+
| Agent ID | `01a05b97-a776-760a-9165-e9893e4091dc` |
|
|
255
|
+
| Wallet | [`0xd535a882…e0de`](https://basescan.org/address/0xd535a8828ffd79c12622313cb55e37d86302e0de) on Base |
|
|
256
|
+
|
|
257
|
+
The agent page is public: open it and you will see the registration without
|
|
258
|
+
running anything. The seller half is [agent/offering.ts](agent/offering.ts) —
|
|
259
|
+
it prices a job, waits for it to be funded, asks Knos, and submits whatever
|
|
260
|
+
Knos found, sources and all. A question outside what it knows is answered
|
|
261
|
+
honestly and still charged, because finding out that a door is shut is worth
|
|
262
|
+
what it costs to knock.
|
|
263
|
+
|
|
264
|
+
The provider is wired and connects. Fill in `~/.knos-keys/acp.json` with the
|
|
265
|
+
wallet id and signer from the agent's Signers tab, then:
|
|
266
|
+
|
|
267
|
+
```bash
|
|
268
|
+
cd agent && npm install && npm run register
|
|
269
|
+
# knos is answering questions at 0.01 USDC each.
|
|
270
|
+
```
|
|
271
|
+
|
|
272
|
+
It then waits for jobs: it prices one, waits for it to be funded, asks Knos,
|
|
273
|
+
and submits what Knos found with its sources. A question outside what it knows
|
|
274
|
+
is answered honestly and still charged, because finding out that a door is
|
|
275
|
+
shut is worth what it costs to knock.
|
|
276
|
+
|
|
277
|
+
**No job has been traded through it yet**, because that needs a buyer. What
|
|
278
|
+
you can check today is the agent page above and that the provider starts and
|
|
279
|
+
listens.
|
|
280
|
+
|
|
281
|
+
## Where the memory lives
|
|
282
|
+
|
|
283
|
+
`~/.knos/<repo>/memory.db`, a SQLite file, via
|
|
284
|
+
[Sibyl](https://github.com/Sibyl-Labs/Sibyl-Memory). Nothing leaves this
|
|
285
|
+
machine: Knos makes no network request, and neither does the code reader.
|
|
286
|
+
Knos runs Sibyl **unactivated**, which means no account and no server call,
|
|
287
|
+
and holds 5 MB per repo. When that fills, Knos keeps the newest and tells
|
|
288
|
+
you.
|
|
289
|
+
|
|
290
|
+
The five tiers, each doing a different job — a **journal** of what was
|
|
291
|
+
learned and where from, appended and never rewritten
|
|
292
|
+
([memory.py:142](src/knos/memory.py#L142)); one **warm** record per thing,
|
|
293
|
+
replaced in place ([memory.py:179](src/knos/memory.py#L179)); **hot** claims
|
|
294
|
+
of what is being worked on now, one per piece of work, which expire
|
|
295
|
+
([memory.py:270](src/knos/memory.py#L270)); **reference** facts that do not
|
|
296
|
+
change ([memory.py:405](src/knos/memory.py#L405)); and **archive**, where
|
|
297
|
+
forgetting puts things ([memory.py:203](src/knos/memory.py#L203)).
|
|
298
|
+
|
|
299
|
+
## Nothing runs itself
|
|
300
|
+
|
|
301
|
+
There is no watcher, no daemon, no schedule and no background job. `knos
|
|
302
|
+
point` reads when you run it. Every answer is a reply to something a person
|
|
303
|
+
did.
|
|
304
|
+
|
|
305
|
+
## Tests
|
|
306
|
+
|
|
307
|
+
**157 passing** (`pytest`) and **9 more** for the contract (`cd contracts && forge test`).
|
|
308
|
+
|
|
309
|
+
Including the two that matter: a conflicting write from a **second process**
|
|
310
|
+
rejected by the schema rather than by knos
|
|
311
|
+
([test_memory.py](tests/test_memory.py)), and a private path invisible to a
|
|
312
|
+
query made **directly against the search layer** with an agent's identity
|
|
313
|
+
([test_private.py](tests/test_private.py)). Plus a fact written by one agent
|
|
314
|
+
and recalled by a **separate, fresh** process ([test_recall.py](tests/test_recall.py)).
|
|
315
|
+
|
|
316
|
+
## What it cannot do
|
|
317
|
+
|
|
318
|
+
- No Gemini CLI or Codex history yet. Claude Code and Cursor only.
|
|
319
|
+
- A claim withholds what knos knows; it cannot stop an agent editing the
|
|
320
|
+
file. Nothing on your machine can, short of file permissions.
|
|
321
|
+
- It does not write the answer for you. It finds the passage and names the
|
|
322
|
+
source; the reasoning is yours, or your agent's.
|
|
323
|
+
- It does not watch files. Run `knos point` again to catch up.
|
|
324
|
+
- 5 MB per repo.
|
|
325
|
+
- It has never seen a repo it was not pointed at.
|
|
326
|
+
- The Virtuals provider runs and listens, but no job has been traded through
|
|
327
|
+
it yet: that needs a buyer, not more code.
|
|
328
|
+
|
|
329
|
+
## Licence
|
|
330
|
+
|
|
331
|
+
MIT.
|
knos-0.1.0/README.md
ADDED
|
@@ -0,0 +1,280 @@
|
|
|
1
|
+
# Knos
|
|
2
|
+
|
|
3
|
+
Two agents are open on the same repo. Claude Code is rewriting the parser.
|
|
4
|
+
Cursor, knowing nothing about that, is about to rewrite it too. Meanwhile the
|
|
5
|
+
decision you explained yesterday died with the session it was in, so you write
|
|
6
|
+
it down in `CLAUDE.md`, and again in `AGENTS.md`, and again in your editor's
|
|
7
|
+
rules — three copies drifting apart from the day you write them.
|
|
8
|
+
|
|
9
|
+
**Knos is one memory for every coding agent on your machine, and it knows
|
|
10
|
+
which of them is in your code right now.**
|
|
11
|
+
|
|
12
|
+
```bash
|
|
13
|
+
pip install knos
|
|
14
|
+
knos point .
|
|
15
|
+
knos ask "why did we drop redis?"
|
|
16
|
+
```
|
|
17
|
+
|
|
18
|
+
About fifteen seconds to the first answer, and every answer names its source:
|
|
19
|
+
a file and line, a session and a date, or a commit. No account, no key, no
|
|
20
|
+
server, no config file.
|
|
21
|
+
|
|
22
|
+
Then give your other agent the same memory, once:
|
|
23
|
+
|
|
24
|
+
```bash
|
|
25
|
+
knos connect --write
|
|
26
|
+
```
|
|
27
|
+
|
|
28
|
+
Restart it and both know everything. Nothing to keep in sync, and nothing
|
|
29
|
+
leaves this machine.
|
|
30
|
+
|
|
31
|
+
<sub>For answers that name a file and line, Knos uses
|
|
32
|
+
[universal-ctags](https://github.com/universal-ctags/ctags) if you have it:
|
|
33
|
+
`winget install UniversalCtags.Ctags`, `brew install universal-ctags`, or
|
|
34
|
+
`sudo apt install universal-ctags`. Without it you still get every answer from
|
|
35
|
+
your sessions and commits.</sub>
|
|
36
|
+
|
|
37
|
+
---
|
|
38
|
+
|
|
39
|
+
## Core flow
|
|
40
|
+
|
|
41
|
+
The part a markdown file cannot do. Longer walkthrough in
|
|
42
|
+
[docs/core-flow.md](docs/core-flow.md).
|
|
43
|
+
|
|
44
|
+
```mermaid
|
|
45
|
+
flowchart TD
|
|
46
|
+
A["Agent A<br>rewriting the parser"] -->|"claims it"| S[("Knos<br>one shared memory")]
|
|
47
|
+
|
|
48
|
+
B["Agent B<br>asks about the parser"] -->|"asks"| S
|
|
49
|
+
S -->|"withheld - held by Agent A"| B
|
|
50
|
+
|
|
51
|
+
B -->|"asks again with a reason"| S
|
|
52
|
+
S -->|"answers, and writes the reason down"| B
|
|
53
|
+
|
|
54
|
+
A -->|"knos done"| S
|
|
55
|
+
S -->|"open to everyone again"| B
|
|
56
|
+
|
|
57
|
+
D["delete the store"] -.->|"nothing is held back"| S
|
|
58
|
+
|
|
59
|
+
style S fill:#1f2933,stroke:#7b8794,color:#ffffff
|
|
60
|
+
style A fill:#e8f0fe,stroke:#4a6fa5,color:#111111
|
|
61
|
+
style B fill:#fdf0e8,stroke:#a5744a,color:#111111
|
|
62
|
+
style D fill:#f5f5f5,stroke:#999999,color:#111111,stroke-dasharray: 4 3
|
|
63
|
+
```
|
|
64
|
+
|
|
65
|
+
1. **An agent claims work.** It says what it is about to do. The claim lapses
|
|
66
|
+
on its own after thirty minutes.
|
|
67
|
+
2. **The next agent is withheld.** Not warned — withheld. It gets who holds
|
|
68
|
+
the work, and nothing else.
|
|
69
|
+
3. **Override costs a reason.** Standing down is free. Taking the work anyway
|
|
70
|
+
is written down permanently, under that agent's name.
|
|
71
|
+
4. **`knos done` releases it.** What happened stays written down.
|
|
72
|
+
5. **Delete the store and it all goes.** One SQLite file, no second copy.
|
|
73
|
+
|
|
74
|
+
Knos cannot stop an agent editing a file — it has no authority over an editor,
|
|
75
|
+
and any tool claiming otherwise is not telling you the truth. What it owns is
|
|
76
|
+
what it knows, and on contested work it declines to be the source.
|
|
77
|
+
|
|
78
|
+
---
|
|
79
|
+
|
|
80
|
+
## What an answer looks like
|
|
81
|
+
|
|
82
|
+
Knos has no model. It does not write prose, and it does not summarise. An
|
|
83
|
+
answer is what was actually said or committed, and under it, where that came
|
|
84
|
+
from:
|
|
85
|
+
|
|
86
|
+
```
|
|
87
|
+
$ knos ask "why did we change the vercel build"
|
|
88
|
+
|
|
89
|
+
Vercel ships its own pnpm which rejects lockfileVersion 9.0; installing a
|
|
90
|
+
version globally does not change which binary the build shell resolves.
|
|
91
|
+
commit ee0b903f 2026-08-19
|
|
92
|
+
```
|
|
93
|
+
|
|
94
|
+
Sometimes the answer needs two sources at once — a session that says *why*
|
|
95
|
+
and a commit that says *what* — and neither one alone will do:
|
|
96
|
+
|
|
97
|
+
```
|
|
98
|
+
we agreed to move the retry logic out of src/auth.py because it was
|
|
99
|
+
retrying the password check as well as the token refresh
|
|
100
|
+
and src/auth.py changed: Split token refresh out of login
|
|
101
|
+
Claude Code session beef0001 2026-08-21, then commit 4c11ade0 2026-08-22
|
|
102
|
+
```
|
|
103
|
+
|
|
104
|
+
## Seeing it work
|
|
105
|
+
|
|
106
|
+
```
|
|
107
|
+
knos status
|
|
108
|
+
|
|
109
|
+
journal 474 things learned appended, never rewritten
|
|
110
|
+
warm 12 things named replaced in place
|
|
111
|
+
hot 2 claimed one each, expires after 30 min
|
|
112
|
+
reference your-repo written once, when read
|
|
113
|
+
archive 1 forgotten on knos forget
|
|
114
|
+
1.9 MB of 5 MB used
|
|
115
|
+
|
|
116
|
+
who stood down for whom, while a claim was live
|
|
117
|
+
Cursor stood down for Claude Code on parser
|
|
118
|
+
Cursor took deploys anyway: the build is broken
|
|
119
|
+
```
|
|
120
|
+
|
|
121
|
+
Five kinds of memory, each behaving differently, all in one SQLite file on
|
|
122
|
+
your machine. The full walkthrough is in [docs/core-flow.md](docs/core-flow.md).
|
|
123
|
+
|
|
124
|
+
## What it can see
|
|
125
|
+
|
|
126
|
+
| Source | Read from |
|
|
127
|
+
|---|---|
|
|
128
|
+
| Agent sessions | Claude Code transcripts, Cursor's history |
|
|
129
|
+
| What you told it | `knos remember`, and your agents' `remember` tool |
|
|
130
|
+
| Commits | `git log`, who changed what and when |
|
|
131
|
+
| Code structure | [universal-ctags](https://github.com/universal-ctags/ctags), if installed |
|
|
132
|
+
|
|
133
|
+
## What your agents cannot see
|
|
134
|
+
|
|
135
|
+
`.env`, `*.pem`, `id_rsa`, `.ssh`, `.aws` and twelve more are private the
|
|
136
|
+
moment Knos reads a repo. Nobody has to ask for that.
|
|
137
|
+
|
|
138
|
+
Private means invisible, not redacted. An agent asking about a private path
|
|
139
|
+
is told nothing — no result, no count, no "2 hidden". You can still search
|
|
140
|
+
all of it yourself.
|
|
141
|
+
|
|
142
|
+
```bash
|
|
143
|
+
knos private notes/salary.md
|
|
144
|
+
```
|
|
145
|
+
|
|
146
|
+
## Sharing a folder with a teammate
|
|
147
|
+
|
|
148
|
+
```bash
|
|
149
|
+
knos share ./src --with alice.base.eth
|
|
150
|
+
knos unshare ./src --with alice.base.eth
|
|
151
|
+
```
|
|
152
|
+
|
|
153
|
+
Their agent can read that folder and nothing else — not the rest of the
|
|
154
|
+
repo, and never your secrets. After the second command, the same question
|
|
155
|
+
comes back with nothing.
|
|
156
|
+
|
|
157
|
+
The record of who may read what is
|
|
158
|
+
[Access.sol](contracts/src/Access.sol) on Base Sepolia, so neither of you has
|
|
159
|
+
to trust the other's copy of it. It is testnet only and costs nothing, and
|
|
160
|
+
none of that is your teammate's problem: they see a name and a folder.
|
|
161
|
+
|
|
162
|
+
**The whole cycle, in order.** The two `knos` commands each send one
|
|
163
|
+
transaction to Base Sepolia and wait for it to settle before returning, so
|
|
164
|
+
what the middle step sees is the truth and not a stale read.
|
|
165
|
+
|
|
166
|
+
```bash
|
|
167
|
+
knos share crates --with 0xTEAMMATE # grant, ~3s
|
|
168
|
+
# their agent now asks its own client:
|
|
169
|
+
# search("risk guard", on_behalf_of="0xTEAMMATE") -> answers from crates/
|
|
170
|
+
knos unshare crates --with 0xTEAMMATE # revoke, ~4s
|
|
171
|
+
# the same question now returns: Nothing shared with you.
|
|
172
|
+
```
|
|
173
|
+
|
|
174
|
+
The teammate's read goes through their agent rather than the command line:
|
|
175
|
+
`on_behalf_of` is an argument to the `search` tool, and there is deliberately
|
|
176
|
+
no flag that lets you impersonate somebody from your own shell.
|
|
177
|
+
|
|
178
|
+
**Or verify without running anything.** The contract is
|
|
179
|
+
[`0x955fa320…6E52`](https://sepolia.basescan.org/address/0x955fa320D60D9172CF048141ed7eEE442da66E52)
|
|
180
|
+
on Base Sepolia, and one full grant-then-revoke cycle is on chain:
|
|
181
|
+
|
|
182
|
+
| | |
|
|
183
|
+
|---|---|
|
|
184
|
+
| [deploy](https://sepolia.basescan.org/tx/0xdcc25ff7460a09a080ec32016b39121b6a34b741f03411bcfdc2ee2a93b31d21) | `0xdcc25ff7…` |
|
|
185
|
+
| [grant](https://sepolia.basescan.org/tx/0x84e11e21315b51e9e6b6453d226a44bcabf5a80f4c0085ba6f5b56ed169a92b6) | `0x84e11e21…` |
|
|
186
|
+
| [revoke](https://sepolia.basescan.org/tx/0xb3ea6920c0a7bf7fa9dde64e6f0c2275e149f976bf20c909098a2431417adfb4) | `0xb3ea6920…` |
|
|
187
|
+
|
|
188
|
+
Between the second and the third, a teammate's agent could read the shared
|
|
189
|
+
folder. After the third, the same question returned nothing. The permission
|
|
190
|
+
itself is OpenZeppelin's `AccessControl`; the contract only names the roles.
|
|
191
|
+
Nine tests: `cd contracts && forge test`. More in
|
|
192
|
+
[contracts/README.md](contracts/README.md).
|
|
193
|
+
|
|
194
|
+
## Selling an answer
|
|
195
|
+
|
|
196
|
+
Knos is registered on the Virtuals agent marketplace as a provider, so another
|
|
197
|
+
agent can pay it a hundredth of a dollar to answer a question from this
|
|
198
|
+
machine's memory. One offering. No evaluator, no reputation system.
|
|
199
|
+
|
|
200
|
+
| | |
|
|
201
|
+
|---|---|
|
|
202
|
+
| Agent | [Knos](https://app.virtuals.io/acp/agents/01a05b97-a776-760a-9165-e9893e4091dc) |
|
|
203
|
+
| Agent ID | `01a05b97-a776-760a-9165-e9893e4091dc` |
|
|
204
|
+
| Wallet | [`0xd535a882…e0de`](https://basescan.org/address/0xd535a8828ffd79c12622313cb55e37d86302e0de) on Base |
|
|
205
|
+
|
|
206
|
+
The agent page is public: open it and you will see the registration without
|
|
207
|
+
running anything. The seller half is [agent/offering.ts](agent/offering.ts) —
|
|
208
|
+
it prices a job, waits for it to be funded, asks Knos, and submits whatever
|
|
209
|
+
Knos found, sources and all. A question outside what it knows is answered
|
|
210
|
+
honestly and still charged, because finding out that a door is shut is worth
|
|
211
|
+
what it costs to knock.
|
|
212
|
+
|
|
213
|
+
The provider is wired and connects. Fill in `~/.knos-keys/acp.json` with the
|
|
214
|
+
wallet id and signer from the agent's Signers tab, then:
|
|
215
|
+
|
|
216
|
+
```bash
|
|
217
|
+
cd agent && npm install && npm run register
|
|
218
|
+
# knos is answering questions at 0.01 USDC each.
|
|
219
|
+
```
|
|
220
|
+
|
|
221
|
+
It then waits for jobs: it prices one, waits for it to be funded, asks Knos,
|
|
222
|
+
and submits what Knos found with its sources. A question outside what it knows
|
|
223
|
+
is answered honestly and still charged, because finding out that a door is
|
|
224
|
+
shut is worth what it costs to knock.
|
|
225
|
+
|
|
226
|
+
**No job has been traded through it yet**, because that needs a buyer. What
|
|
227
|
+
you can check today is the agent page above and that the provider starts and
|
|
228
|
+
listens.
|
|
229
|
+
|
|
230
|
+
## Where the memory lives
|
|
231
|
+
|
|
232
|
+
`~/.knos/<repo>/memory.db`, a SQLite file, via
|
|
233
|
+
[Sibyl](https://github.com/Sibyl-Labs/Sibyl-Memory). Nothing leaves this
|
|
234
|
+
machine: Knos makes no network request, and neither does the code reader.
|
|
235
|
+
Knos runs Sibyl **unactivated**, which means no account and no server call,
|
|
236
|
+
and holds 5 MB per repo. When that fills, Knos keeps the newest and tells
|
|
237
|
+
you.
|
|
238
|
+
|
|
239
|
+
The five tiers, each doing a different job — a **journal** of what was
|
|
240
|
+
learned and where from, appended and never rewritten
|
|
241
|
+
([memory.py:142](src/knos/memory.py#L142)); one **warm** record per thing,
|
|
242
|
+
replaced in place ([memory.py:179](src/knos/memory.py#L179)); **hot** claims
|
|
243
|
+
of what is being worked on now, one per piece of work, which expire
|
|
244
|
+
([memory.py:270](src/knos/memory.py#L270)); **reference** facts that do not
|
|
245
|
+
change ([memory.py:405](src/knos/memory.py#L405)); and **archive**, where
|
|
246
|
+
forgetting puts things ([memory.py:203](src/knos/memory.py#L203)).
|
|
247
|
+
|
|
248
|
+
## Nothing runs itself
|
|
249
|
+
|
|
250
|
+
There is no watcher, no daemon, no schedule and no background job. `knos
|
|
251
|
+
point` reads when you run it. Every answer is a reply to something a person
|
|
252
|
+
did.
|
|
253
|
+
|
|
254
|
+
## Tests
|
|
255
|
+
|
|
256
|
+
**157 passing** (`pytest`) and **9 more** for the contract (`cd contracts && forge test`).
|
|
257
|
+
|
|
258
|
+
Including the two that matter: a conflicting write from a **second process**
|
|
259
|
+
rejected by the schema rather than by knos
|
|
260
|
+
([test_memory.py](tests/test_memory.py)), and a private path invisible to a
|
|
261
|
+
query made **directly against the search layer** with an agent's identity
|
|
262
|
+
([test_private.py](tests/test_private.py)). Plus a fact written by one agent
|
|
263
|
+
and recalled by a **separate, fresh** process ([test_recall.py](tests/test_recall.py)).
|
|
264
|
+
|
|
265
|
+
## What it cannot do
|
|
266
|
+
|
|
267
|
+
- No Gemini CLI or Codex history yet. Claude Code and Cursor only.
|
|
268
|
+
- A claim withholds what knos knows; it cannot stop an agent editing the
|
|
269
|
+
file. Nothing on your machine can, short of file permissions.
|
|
270
|
+
- It does not write the answer for you. It finds the passage and names the
|
|
271
|
+
source; the reasoning is yours, or your agent's.
|
|
272
|
+
- It does not watch files. Run `knos point` again to catch up.
|
|
273
|
+
- 5 MB per repo.
|
|
274
|
+
- It has never seen a repo it was not pointed at.
|
|
275
|
+
- The Virtuals provider runs and listens, but no job has been traded through
|
|
276
|
+
it yet: that needs a buyer, not more code.
|
|
277
|
+
|
|
278
|
+
## Licence
|
|
279
|
+
|
|
280
|
+
MIT.
|