mnemon icon indicating copy to clipboard operation
mnemon copied to clipboard

Output should be more token-friendly

Open ira-at-work opened this issue 6 months ago • 2 comments

Problem

The tool output is in JSON and maybe to verbose, which translates to a waste of tokens ingested

Proposed solution

Use CSV or a markdown table, and perhaps figure out a way to return less text in the initial search of insights, only expose full text when pulling a specific item.

Alternatives considered

I learned about Mnemon from this gist by Singapore's foreign minister

One commenter suggested a way to make mnemon return more relevant results:

I have asked an LLM to make this suggestion into a design for a wrapper around mnemon to implement this, and this is what it suggested

I have not tried this, I hope it's legit but I don't understand enough on the subject to judge.

more info

TOON as an alternative to JSON for LLMs

ira-at-work avatar May 30 '26 11:05 ira-at-work

Keeping JSON as the canonical machine format while adding an explicit compact/search projection is safer than switching globally to CSV or Markdown, which lose nested fields and escaping clarity. Initial search results could return id, title, score, short excerpt, and pagination, with a separate get-by-id for full content and a --format choice for humans. Token/byte benchmarks on representative results would verify the projection actually helps without hiding required context.

hiSandog avatar Jul 12 '26 07:07 hiSandog

@hiSandog I specifically referenced this in my post. JSON is great for deterministic code parsing crackets, but a huge waste of tokens when ingested by LLMs. see the last link and why TOON was created. since mnemon was created primarily to be used by LLMs, it makes a lot of sense to avoid JSON for that specific application. I had my mnemon hook rewritten to force a pipe through a translator for this, I suggest that it becomes the default output instead, that's all.

ira-at-work avatar Jul 13 '26 11:07 ira-at-work