Technicals.
K.ai has four systems. A private path connects your phone to your own computer. Voice processing runs on your machine. A private index holds your own files. A managed router selects the model for each question.
K.ai Link
K.ai Link lets your phone ask questions about the files on your own computer. The computer does the search. The computer sends back short quotations and a relative name for each source.
Your phone can link to more than one computer. Each computer keeps its own identity, its own permissions, its own record, and its own session keys. No computer trusts another computer.
The K.ai server is not in the Link path. It does not find the devices. It does not signal, route, relay, or keep Link traffic.
After the local search, the computer can use the ordinary no-logging inference of K.ai to write the answer. That API request is separate from Link connectivity.
- Encrypted and authenticated messages
- Replay rejection and a pinned transport key
- Permission for each folder, and immediate removal
How a phone pairs with a computer
Pairing is a peer-to-peer ceremony. The two devices build the same secret at the same time. Neither device sends that secret. Nothing in the ceremony passes through a K.ai server.
- You start the pairing on the computer. The computer makes a temporary key pair. The computer shows a QR code.
- The QR code holds one
kai://link/v1#…address. The invitation rides in the fragment after the#. The invitation is 8 KiB or less before the encoding, and the offer inside it is valid for five minutes. - You scan the QR code with the phone. The phone makes its own temporary key pair. The phone sends its offer back over the transport.
- Both devices do a P-256 key agreement. Both devices calculate the same root key. The root key never crosses the link.
- Both devices hash the same transcript. The transcript holds the two offers in a fixed order, so the order of arrival cannot change it.
- Both screens show the same six-digit code. The code comes from that transcript hash.
- You compare the two codes. You confirm on the computer and on the phone. If the two codes are different, do not confirm.
- Each device sends an HMAC proof under the root key. The proof covers its role, its device identifier, and the transcript.
- The computer makes the permission only after both proofs are correct. The phone then locks the root key to your current biometric set.
The transcript also pins the signature key of each device. The computer records the transport identity of the phone separately, when the offer arrives. A confirmation frame must then come from that same identity, and the computer refuses a correct transcript that arrives from a different transport key.
What the QR code contains
- The protocol version
- The 32-byte transport key of the computer
- A public key for the key agreement
- A public key for the signatures
- A 32-byte random value
- A device name and a device identifier
- A start time and an end time, five minutes apart
What the QR code does not contain
- A hostname, an IP address, or a port
- Your account, or any server token
- A file name, a folder name, or file content
- The root key. Each device calculates the root key. No device sends it.
Sessions and keys
A pairing does not open a session. Each new session starts again, and each computer starts its own.
The computer makes a challenge. The challenge names the paired phone and the session. The challenge is valid for two minutes.
Your iPhone signs the challenge with a P-256 key in the Secure Enclave, and Face ID releases that key. An Android phone signs with a Keystore key, and a strong biometric releases it. Neither platform accepts a device passcode for remote retrieval.
Both sides then make the session key with HKDF-SHA256. The input is the root key. The salt is the hash of the challenge that the phone signed. The signature bytes are not part of that hash. The information string names the protocol version.
A session lasts ten minutes. ChaCha20-Poly1305 protects each session envelope. The session identifier, the message type, the sequence number, and the time are authenticated with the envelope. A counter for each session rejects an envelope that arrives twice. The pairing frames and the challenge are different frames with their own rules.
If you link more than one computer, one biometric ceremony can authorize the group. Each computer still receives its own signed challenge. Each pair derives an unrelated session key.
The limits in one session
Encryption alone is not enough. A stolen phone could ask many plausible questions and rebuild private material from the answers. Every session is therefore bounded before it starts.
| Bound | Value | Why |
|---|---|---|
| Questions in one session | 20 | Limits how much one session can ask |
| Content disclosed in one session | 256 KiB | Limits how much one session can learn |
| Session lifetime | 10 minutes | A new session needs Face ID again |
| Challenge lifetime | 2 minutes | An old authorization cannot open a new session |
| Pairing offer lifetime | 5 minutes | A QR code left on a screen expires |
| Question | 4 KiB | Bounds the inbound request |
| Answer | 64 KiB | Bounds one reply |
| Evidence in one reply | 48 KiB | Bounds the quotations that leave the machine |
| Quotations in one reply | 16 | Each quotation carries its own relative source |
| Files one reply can name | 12 | Several quotations from one file cost one name between them |
| Named sources in a written answer | 6 | Bounds what one answer cites |
| Linked folders one device can reach | 8 | A grant names folders, not the machine |
| Envelope | 96 KiB | Bounds one encrypted message |
| Transport frame | 128 KiB | The carrier refuses a larger packet before any network work |
| Stored audit records | 1000 | The record is bounded and content-free |
Many computers, one question
Your phone sends the question to the computers you select. It sends them in parallel.
A computer that sleeps does not stop the answer. The phone waits 12 seconds for a computer to become available. It waits up to 65 seconds for a real answer.
The phone remembers a failed probe for 60 seconds. A sleeping computer then costs one wait, and not one wait for each question. A computer that already holds a session answers immediately.
Each computer ranks its own quotations. Each computer sends the order and not the score, because BM25 scores from different collections are not comparable.
The phone merges the quotations round-robin by rank. It takes one quotation from each computer at each rank, before any computer gives more. One budget of 48,000 characters covers them all.
The phone then writes one answer. The names of your computers stay on the phone. They never enter the request that leaves it.
What never crosses the link
- The vectors and the relationship graph
- The list of your files
- Security-scoped bookmarks
- Absolute paths. Only relative source names cross, and a path that tries to traverse is refused.
Records, and how you remove a device
The computer keeps a record of each query result. A record can hold the device, the session, the folder, the number of sources, the time, and the result. A record never holds a question, an answer, a quotation, or a path.
You can remove a device at any time, and the removal is immediate. The computer announces itself on the network only while it has a reason to: an unrevoked phone, or a pairing in progress. When you remove the last phone, the computer stops the announcement.
The transport
The carrier is Pear over HyperDHT. It moves opaque packets of 128 KiB or less. It receives no application key and no plain text.
The carrier finds the other device on the public DHT. It makes a direct connection when it can. It can use a blind encrypted relay when a direct connection fails.
Those peers can see endpoint and traffic data. They cannot read your questions or your answers. K.ai operates no signaling server, no rendezvous server, no routing server, and no relay server.
Where each platform is today. The Mac is a host. The iPhone, the iPad, and Android phones are clients. The Linux host is in development. The Linux beta indexes and searches on the machine, through the daemon and the CLI. Its chat uses the K.ai API, like the other clients. See K.ai for Linux.
Local Dictation
A global shortcut starts the recording. K.ai records only while the session is active.
Sticky mode uses one press to start and one press to stop. Hold-to-talk records while you hold the keys.
K.ai puts the text into the field that had the focus. K.ai identifies that field before it types.
- One model download of approximately 500 MB
- K.ai deletes the temporary audio after each result
- Model weights unload after three minutes without use
Two routes, and you select one
On this Mac uses a pinned WhisperKit/Core ML model. You download the model one time. After that download the transcription works offline. It makes no provider charge.
Cloud is a separate route. You select it at the start of a recording. It needs the internet and K.ai credit. It uses less battery and less memory.
K.ai never changes from the local route to the cloud route without your instruction. A failure says so.
Private RAG
You select folders, and K.ai gets read-only access to them. K.ai extracts the text, divides it into chunks, and makes semantic vectors with Apple NLEmbedding.
K.ai keeps the index, the vectors, and the relationship graph in a local SQLite database. That database is separate from your files.
Your files, the folder locations, the vectors, and the database stay on the machine.
- FTS5 finds the literal words; the vectors find the related meaning
- Links, tags, backlinks, and folders connect related notes
- Answers keep the file citation and the PDF page
What leaves the machine for an answer
K.ai selects a small number of passages for the question. Your question and those passages go into the transient no-logging request, with the relative source name of each passage. No other file content leaves the machine.
The index, the vectors, the graph, the folder locations, and the other files stay where they are. Unlinking a folder deletes the index for that folder. It never deletes your files.
LLM routing
K.ai selects a task lane. K.ai does not select a model brand.
The shape of the request, the language, the attachments, the recency, and the complexity select the lane. A small classifier decides the unclear cases.
Each lane points to a maintained model configuration: everyday answers, multilingual work, reasoning, code, vision, low-latency voice, and deep research.
The models can change. The app does not change, and you do not have to watch the model market.
What K.ai keeps
Cloud inference is temporary. K.ai keeps a delivery copy only until the app receives it, or until that copy expires.
The usage record keeps the lane, the token counts, the latency, and the cost. It does not store the prompt or answer.
This is the K.ai router. It follows similar methodologies as the UIUC LLMRouter package. It is a smaller implementation of its own, built around the K.ai lanes, the accounting, the source rules, and the fallbacks.