HACKER Q&A
📣 michaelmure

What is a good format for a tool to report data to a LLM?


For CLI tools, humans like visually organized text possibly with colors or TUIs. Machines likes tabs-separated tabular data, or json and similar.

What's the equivalent for LLMs for tabular or structured data? What makes them grasp the data easily and efficiently?


  👤 kooi Accepted Answer ✓
Standard disclosure of "I'm no LLM expert".

Could tokens be pre-embedded and saved? Suppose you're transferring a context to another agent. Currently I just copy/paste, tell the other agent to reference a .md file.

What is I could get a "compressed" binary file containing the context in the embedding space. Then the other agent can consume that and continue on it's merry way.


👤 michaelmure
I'm asking this because as I wrote a new CLI tool I picked json as the recommended output format for LLMs. I noticed though that they easily get lost and generally consume a lot of tokens to analyse the output. I'm sure it would work well when the LLM is trained for and already know what to expect, but that doesn't work for a new tool.

So, what's the natural language for them?


👤 vivekyyy
In my experience, LLMs are really good with SQL. If you can structure your data into easily queryable SQL data, your LLM will be able to generate queries to get what it needs really effectively

👤 Leftium
I settled on JSONL for an LLM-optimized output format. Rationale: https://github.com/Leftium/gg/blob/main/specs/completed/gg-a...

Combine that with context mode: https://hw.leftium.com/i/47193064