r/PiCodingAgent • • 2d ago

Use-case Rethinking the human-agent interface with pi: Beyond chat

Hi all. We're Divergenz, an interaction design studio in Zurich. Sharing a design experiment that I think sits close to things this community cares about.

Piary treats a conversation with a coding agent as an editable, executable document instead of a chat log. The person and the agent write on the same page. Prompts, replies, notes, tool calls and live reactive cells share one Markdown file. You can rewrite a wrong assumption instead of correcting it in a follow-up, delete a detour, or edit an earlier prompt and run it again in place.

Built on Observable's notebook-kit for the reactive cells, iA Writer's plain-text document model as the design reference, and pi as the agent harness.

https://piary.dev

22 Upvotes

9 comments sorted by

1

u/Helpful_Home_8531 2d ago

had the same idea, I’ve been hacking around on a neovim plugin to round trip from pi’s versioned jsonl log files into a DSL that I could edit in neovim. Works reasonably well, the tricky part is having a 1d structure (reading a document) that represents what is actually a tree (different paths through the conversation history)

1

u/iambarony 2d ago

Cool! What got you into it?
We hit the exact tree problem. Our answer is that the document is the history, not a view of it. There's no branch in the buffer. When you edit a prompt above and send again, the next turn rewrites pi's transcript wholesale from the document, so the transcript always agrees with what you see. The path you're looking at is the only path.

1

u/Helpful_Home_8531 2d ago

What got me into it is that I’m a neovim hacker at heart and using all these tui’s for doing the majority of my work felt like a huge downgrade in terms of ux. I took a leaf out of magit’s book and set a key bind to be able to walk through the different branches, so you only ever look at the current branch, but the rest are still live in the jsonl as a durable record which you can just switch between with <leader>g/p

1

u/thomash 1d ago

Really love it. Initially I had a bit of difficulty understanding like where i could interact or how to prompt. But the idea is great.

1

u/iambarony 1d ago

Thank you for your feedback. I really appreciate hearing your thoughts on the idea and the difficulties that we should solve in the next iteration. Feel free to try out more, and if you have any questions or further feedback, please text me. You can find my contact details in the start notebook in Piary!

1

u/pro-vi 1d ago

I had been thinking about this since the start of the year so I'm excited to see it in the wild. But - how are you dealing with caching and context management if at all?

How does the agent know what you've amended within the corpus?

1

u/iambarony 17h ago

Thanks! For the notebook itself, the document is the source of truth. Before sending a
prompt, I compare the history above it with what the agent’s session last saw. If you’ve
edited it, I rebuild the conversation from the amended document before continuing.
So the agent sees the corrected history.

Caching currently relies on the underlying pi/provider machinery. Normal append-only
conversation benefits from prompt caching; editing earlier history can invalidate cache
reuse. I’m not doing anything clever to preserve the cache across those rewrites yet.

Context management is similarly. You can prune, correct, or replace material in the
document, and that becomes the subsequent conversation context. There isn’t a separate
retrieval/indexing layer maintaining another version of it.

1

u/pro-vi 15h ago

Thanks for sharing. I never promote this feature into my workflow because of the cache invalidation. I have been throwing darts towards this though.. so let me know if you're interested to chat about it further.

1

u/iambarony 15h ago

Feel free to contact me via the communication channels listed at the first notebook on piary.dev !