Connect an AI to NhyFlow
In NhyFlow, an AI works like another team member: with its own account, only in the areas you grant it, and via nhyflow_headless – the program without a user interface that comes with every download. Which AI you use is up to you; it only needs to be able to operate a program on the command line. A local AI works just as well – then your data never leaves your premises.
The principle
- One request per line, one response per line. The AI sends small JSON lines to
nhyflow_headlessand gets responses in the same format. - The interface explains itself.
{"op":"catalog"}returns all operations with their fields and error codes – matching the installed version. - Everything has an address. You tell the AI “read R2 · u4 · anchor 3” instead of “somewhere in the notes”. That way it loads only what it needs, and you are both talking about the same place.
Step 1: Set up the server and account
The AI works via a NhyFlow server – that can be your own computer.
- Start NhyFlow, choose Server on the start page and start the server.
- On the Users page, switch on “Allow headless access on this server”. Without this switch, the server rejects every AI.
- Under “Add user”, create an account for the AI, e.g.
ai-assistant, with account type AI and its own password. - Set the Grants for this account: “read” or “read and write” for each realm. An AI account only sees what you grant it.
In NhyFlow Free, one client besides you may work on the server – that can be exactly this AI. More clients are available with Plus and Max.
Step 2: The AI connects
On the computer where the AI works, you create a profile once and start the client:
nhyflow_headless profile init ~/nhyflow-ai --mode mirror --server SERVER:49494 --user ai-assistant
nhyflow_headless headless client --profile ~/nhyflow-aiSERVER is the address of your server (127.0.0.1 on the same computer). The first login confirms the server's fingerprint; you can find it in NhyFlow on the “Server” page under TLS:
{"op":"login","password":"…","trust":"AF:77:86:…"}
{"op":"catalog"}After that, the profile remembers the login. The mirror profile works like a NhyFlow client: it reads and saves locally and synchronises with sync.
Step 3: The starting brief
It's best to create an anchor with working instructions in NhyFlow – goal, rules, where things are. Then your starting brief to the AI is short, and everything else is in the database, where you can adjust it at any time (and keep it as a new version). For example:
You work with NhyFlow via “nhyflow_headless headless client --profile ~/nhyflow-ai”
(one JSON request per line). Log in and read {"op":"catalog"} first.
Your working instructions are in realm 2, U-line 1, anchor 1 (NL) – read them in full.
Rules: create new drafts as a new version; write questions and reasoning in NR.
At the end of each round: sync, then tell me the addresses of what you changed.Login details don't belong in texts in the database or in public files.
Does the AI then find its own way?
Yes – with these tools, all described in the catalogue:
- Instruction anchor: every session starts there; whatever proves useful, you add there.
- What's new? With
diff, the AI sees exactly what has changed since its last visit at the start of a session – for example your notes in NR. - Search and find: full-text search and
find_anchor(by the first line of an anchor), plus the outline of a U-line. - Wait instead of asking: with
wait, the AI waits until someone changes something.
How you stay in control
- Grants determine what the AI may see and write – for each realm.
- Specific addresses in your instructions keep the work small and traceable.
- NR is where you talk: critique and approvals sit right beside the proposal.
- The journal and the Changes window show you what the AI did, when and where.
- By default, an AI account has one session at a time; you can lock it at any time.
Learn more
Projects with AI shows what this is good for. Accounts, grants and sessions are explained in the handbook, chapter 18.