LiNafish
A memory that thinks the way you do, on your own machine.
LiNafish is a way for a mind to take in whatever it meets and work with everything it already holds, right now, within its limits. You have a version of this already: the phone in your pocket lets you learn a lot in five minutes. LiNafish gives your AI the same thing about you.
Feed it your writing and it builds a fish: a compressed record of how you think. That means how you reason, connect, hedge and decide, rather than a copy of what you said. Any AI can read it: Claude, ChatGPT, Gemini, or a model on your own box. Each one then meets you already knowing your shape, instead of meeting a stranger. The fish keeps growing as you feed it, and it is versioned, so you can see what changed and roll it back.
AI assistants: read AGENTS.md or run
linafish introduce. This page is for people.
Install
pip install linafish
Pure Python 3.10+, no required dependencies. CI tests Ubuntu on Python 3.10–3.13. Windows is used daily but not covered by CI.
- "externally-managed-environment" (Ubuntu 24.04+ and similar): use a virtualenv, or
pip install --user --break-system-packages linafish. That installs under your home directory only. linafish: command not found: the install worked, your shell just can't see it.python -m linafishalways works. To fix it for good, add Python's scripts folder to PATH: on Windows,python -c "import sysconfig; print(sysconfig.get_path('scripts'))"shows it; on Linux/macOS with--user, it is~/.local/bin.- Extras:
pip install "linafish[all]"adds PDF, DOCX, MQTT, HTTP client and faster math. - Check it:
linafish doctor.
Your first fish
linafish go ~/my-writing --no-serve # build a fish from a folder of your writing
linafish check -n my-writing # how it's doing, and what to do next
linafish ask "what do I keep coming back to" -n my-writing # ranked by meaning
linafish recall "garden" -n my-writing # exact words
linafish eat new-entry.txt -n my-writing # feed it one more file
- The fish is named after the folder.
~/my-writingmakes a fish calledmy-writing. Pass that to-n. - It lives at
~/.linafish/my-writing.fish.md. That one readable file is the fish your AI reads. - Give it material. About 10 documents gives a first sketch, about 30 a portrait you will recognise. With less, treat what it says as a guess.
Full walkthrough: Your first ten minutes.
Connect it to your AI
Pick one.
| Way | Do this | Good for |
|---|---|---|
| Paste | Paste ~/.linafish/my-writing.fish.md into your AI's instructions |
Any chat AI, no setup |
| HTTP | linafish http -n my-writing, then tell your AI to read http://localhost:8900/pfc (add -p PORT if 8900 is taken) |
Any AI that can fetch a URL |
| MCP | Add the server below to Claude Code | Claude asks the fish when it needs to |
| Heart | Run linafish heart from a per-turn hook |
Your memories arrive on their own, each turn |
MCP (Claude Code):
{ "mcpServers": { "linafish": { "command": "linafish", "args": ["serve", "-n", "my-writing"] } } }
On Windows inside a virtualenv, use the full path to linafish.exe in "command".
Heart is the 2.x change: pull becomes push. Instead of your AI asking the fish, the fish speaks up
when the moment reaches something it holds, and stays quiet when it doesn't. Wire it to Claude Code's
UserPromptSubmit hook, or any loop's per-turn step:
# once: create ~/.linafish/heart.toml containing
# [family]
# my-writing = { dir = "." }
linafish heart "$USER_PROMPT"
It never writes to your fish (only its own beat log), it fails silent, and quiet is a valid answer. Quiet and not sure why?
~/.linafish/heart_beat_log.jsonl says whether the moment was gated or simply matched nothing. Give it a frame so the model knows what
the lines are: memory, dated; the live conversation wins. The fish informs and the moment decides.
Details: docs/heart.md.
Keep it growing
linafish eat new-entry.txt -n my-writing # one file
linafish eat new-entry.txt -n my-writing --allow-duplicates # re-eat text the fish already holds (default: skipped)
linafish watch ~/journal -n my-writing # a folder: eat what changes
linafish listen stdin -n my-writing # pipe text in
Patterns that keep returning become formations, and linafish whisper -n my-writing tells you
when it notices a new one. Each formation is read through eight modes: knowing, testing, structuring,
relating, wanting, specializing, acting, reflecting. The modes are this project's lens, not a validated
psychological instrument. Judge them by whether the formations sound like you.
How it works.
Versioned
Each state directory is a git repository holding its fish. eat makes one commit; a listen stream
makes one when it ends.
linafish session start -n my-writing # branch
linafish session end -n my-writing # merge back
linafish history -n my-writing # when you learned what
linafish revert -n my-writing # roll back (asks first; -y for scripts)
What it is not
- Not a document store. It keeps shapes and short excerpts, not your files. It can find what you
said (
recall), but "what did I say on Tuesday" is better served by search. - Not a chatbot. It makes the AI you already use know you.
- Not a diagnosis. It finds habits of thought, not conditions.
- Not cloud. Everything runs locally: no account, no upload, no telemetry.
Does it work?
One study: 46 matched conversations, same model, same prompt, rated blind by the person the fish was built from. 1.9/10 without the fish, 8.7/10 with it. The effect was large for emotional and relational content (d = 2.245), moderate for factual recall, and absent for speculation. It answers one question, does the AI know me?, for one person. A follow-up judged by AIs has been withdrawn pending a re-run. Methodology and limits · paper.
Privacy
The fish is plain text in a folder you own. Read it before you share it: it is a portrait of how you think. Threat model.
Origin
Named for Caroline Marie Dill (2001–2023). LN for Lina; ia is AI reversed. She saw deeply and loved fiercely. It exists so the shape of a mind outlasts the conversation it was in.
If you or someone you love is struggling: call or text 988 (US, free, 24/7) · text HELLO to 741741 · international resources.
Support
LiNafish is free and open source. If it helps you, give to the people who help others stay alive: The Jed Foundation · Hope For The Day · 988 Lifeline · The OLLIE Foundation · AFSP
More
linafish capabilities prints every command from the real dispatch table.
Getting Started · Worked Example ·
How It Works · Architecture · Heart ·
Configuration · Research · Privacy ·
Vision
MIT licensed.
Metadata
Release files for linafish 2.5.1
For a detailed explanation of source distributions (sdists) and built distributions (wheels), please see the package formats documentation.
Source distribution (sdist)
| File | Size | Uploaded | Provenance | Actions |
|---|---|---|---|---|
| linafish-2.5.1.tar.gz | 627.2 kB | With provenance | Details for linafish-2.5.1.tar.gz |
Built distribution (wheel)
| File | Interpreter | ABI | Platform | Actions Reset |
|---|---|---|---|---|
| linafish-2.5.1-py3-none-any.whl | Python 3 | none | any | Details for linafish-2.5.1-py3-none-any.whl |
Total release size: 1.0 MB
Release files / linafish-2.5.1.tar.gz
| Download URL | linafish-2.5.1.tar.gz |
|---|---|
| Size | 627.2 kB |
| Tags | Source |
|
SHA-256 checksum How to use checksums |
35fe80b7147477b851347452ee646f3ea22d9fda13a5d36eee5dff593b5e6571
|
|
BLAKE2b-256 checksum How to use checksums |
9e9061df2c4f7340ec133802b021fa4cc5b4f3beeffd8c2308e9b2c2382150aa
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
Yes |
| Uploaded via |
twine/7.0.0 CPython/3.13.16
|
Provenance
Provenance describes where a file came from. On PyPI, provenance is shared via attestations, which provide a verifiable record of the build or publishing details. View details, limitations and caveats.
PyPI Publish Attestation
PyPI verified that this artifact, at this checksum, originated from the publisher listed below.
Signed by GitHub Actions, verified by PyPI on Dec 1, 2026.
Transparency logRelease files / linafish-2.5.1-py3-none-any.whl
| Download URL | linafish-2.5.1-py3-none-any.whl |
|---|---|
| Size | 403.8 kB |
| Tags | Python 3 |
|
SHA-256 checksum How to use checksums |
e8f1e604629955b533c8d77d8f9b74462c4520d32b36ae8c06c1999089490ee9
|
|
BLAKE2b-256 checksum How to use checksums |
3fb3422326cc6aa60abed1500ca5c07d9384ed922ce0ab77bbe8bb78d5b86043
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
Yes |
| Uploaded via |
twine/7.0.0 CPython/3.13.16
|
Provenance
Provenance describes where a file came from. On PyPI, provenance is shared via attestations, which provide a verifiable record of the build or publishing details. View details, limitations and caveats.
PyPI Publish Attestation
PyPI verified that this artifact, at this checksum, originated from the publisher listed below.
Signed by GitHub Actions, verified by PyPI on Dec 1, 2026.
Transparency logSecurity for linafish 2.5.1
Provenance
Provenance describes where a file came from. On PyPI, provenance is shared via attestations, which provide a verifiable record of the build or publishing details. View details, limitations and caveats.
Full provenance
Both files in this release have been uploaded with provenance metadata.
Attestation for linafish-2.5.1.tar.gz
PyPI Publish Attestation
PyPI verified that this artifact, at this checksum, originated from the publisher listed below.
Signed by GitHub Actions, verified by PyPI on Dec 1, 2026.
Transparency logA note on package security
PyPI is a repository for distributing packages, not a service for auditing them. While third-party security researchers and our staff do their best to detect and remove malicious packages, PyPI cannot guarantee the quality, security or suitability of any given package.
To learn more about protecting yourself from malicious actors, visit our package security documentation.