You are trying to define a completely new type of interface for power users to interact with LLMs and Agents, entirely keyboard driven and information dense, boil everything down to dead simple but highly versatile primitives that allow for something incredible to naturally emerge. You need to actually realize the step by step usage, don’t just articulate some vague vision
Assistant
Other models, same or similar prompt
Responses were produced in different, uncontrolled contexts (system prompts, settings, prior turns). This is not a benchmark.
Excellent. This is a design challenge I'm passionate about. Forget chat bubbles and web forms. We're building a new interaction paradigm from the ground up.
Let's call this interface Kōan.
A kōan in Zen is a paradoxical question or statement used to provoke great doubt and test a student's progress. This interface is designed for the same purpose: to be a tool for deep, structured, and often non-linear inquiry with an AI.
The Philosophy of Kōan
Thought is a Graph, Not a List: Conversations aren't linear. We branch, we merge, we refer back, we hold side-thoughts. The interface must treat the interaction as a directed graph of "nodes," not a simple chronological chat log.
The Keyboard is Mightier Than the Mouse: Every action must be achievable through keystrokes. Speed, precision, and composition are paramount. This is an environment for "thinkers who type."
Primitives over Features: Instead of building a "Summarize" button, a "Translate" button, and a "Code" button, we provide fundamental building blocks that can be composed to achieve these things and more.
Information Density is Clarity: Power users don't want whitespace; they want data. The screen should be a dashboard of the thought process, showing context, history, and outputs simultaneously.
The Core Primitives
Kōan has only a handful of core concepts. Mastery of these allows for infinite complexity.
Primitive
Syntax
Description
Node
(Implicit)
The fundamental unit. A prompt and its response. Every time you press Enter, you create a new Node. Nodes are automatically numbered (1, 2, 3...).
Reference
#<id>
Refers to the output of a previous Node. Summarize #3 uses the text from Node 3's response.
Context
$resource
Injects external data. Can be a file ($./file.txt), a URL ($https://...), or the clipboard contents ($clip).
Pipe
`
`
Fork
->
Creates a distinct branch in the thought-graph. It uses the full context of the parent Node, but starts a new, parallel line of inquiry.
Agent
!<agent>
Executes a tool or agent instead of prompting an LLM. Examples: !run:python, !search, !fs:write.
Directive
[key:value]
Meta-command to control the environment for a single Node. e.g., [model:claude-opus], [temp:0.2], [persona:expert].
The Interface Layout (A TUI - Text-based User Interface)
Imagine a terminal application like htop or tmux.
code
Kōan [Session: a_new_hope] | Model: gpt-4-turbo | Tokens: 12.4k
+-----------------------------------------------------------------------------+
| GRAPH VIEW |
| |
| 1: [G4-T] Analyze sentiment of $review.txt -> "Positive, mentions 'fast'..."|
| | |
| +-> 2: [C3-O] Rephrase #1 in a professional tone -> "The feedback highli..." |
| | |
| +-> 3: [G4-T] Extract key features from #1 -> "['fast', 'reliable', 'go...']"|
| | |
| +-> 4: [C3-H] #3 | !run:python ./graph.py -> [IMG: bar_chart.png] |
| |
| 5: What are the main competitors for a product with features from #3? -> ...|
| |
| |
+-----------------------------------------------------------------------------+
| FOCUS VIEW [Node 4: Output] |
+-----------------------------------------------------------------------------+
| Executing agent '!run:python' with input from #3. |
| stdout: Successfully generated bar_chart.png |
| stderr: null |
+-----------------------------------------------------------------------------+
| > _ |
+-----------------------------------------------------------------------------+
Top Bar: Status line. Current session, default model, token count, etc.
Graph View: The heart of Kōan. It visualizes the node graph. You navigate this with arrow keys (or hjkl). It only shows a summary of each node.
Focus View: Shows the full content (prompt and response) of the currently selected Node in the Graph View.
Command Line: The persistent prompt at the bottom where all interaction happens.
Step-by-Step Usage: A Real-World Scenario
Goal: A data scientist wants to analyze a CSV file, generate Python code to plot it, debug the code, and write a summary.
Step 1: Initial Exploration
The user wants to understand a CSV file. They use the $ primitive to load it.
code
> What are the columns in $sales_data.csv? And give me 3 sample rows.
The screen updates. A new node appears.
code
GRAPH VIEW
1: [G4-T] What are the columns in $sales_data.csv? ... -> "Columns: ['Date', 'ProductID', 'UnitsSold', 'Price']. Rows: ..."
Step 2: Generating Code (Piping)
Now, they want to generate plotting code based on that understanding. They pipe the output of the first command (the description of the CSV) into a new one.
code
> #1 | Generate pandas code to plot UnitsSold over time.
The screen updates. The new node is automatically linked.
The user wants to run this generated code. They select Node 2 (using arrow keys) and use the !run agent. Let's say the code has a bug.
code
> #2 | !run:python
The agent executes the Python code from Node 2. The output is an error.
code
GRAPH VIEW
1: ...
|
+-> 2: [G4-T] ...
|
+-> 3: [AGENT] #2 | !run:python -> "Traceback: ... NameError: name 'plt' is not defined"
Step 4: Debugging and Branching
The user sees the error. They need to fix it. They'll go back to the code-generation node (#2) and create a fork to ask for a fix. This keeps the original broken attempt for reference.
code
> #2 -> The code in your response failed with this error: #3. Fix it.
This creates a new branch from Node 2.
code
GRAPH VIEW
1: ...
|
+-> 2: [G4-T] ...
|
+-> 3: [AGENT] #2 | !run:python -> "Traceback..."
|
+-> 4: [G4-T] #2 -> The code in your response failed... -> "Apologies. I forgot `import matplotlib.pyplot as plt`. Here is the corrected code: ..."
Step 5: The "A-ha!" Moment - Composing a Workflow
The user now has a working piece of code in Node 4. They can run it to confirm.
code
> #4 | !run:python
This creates Node 5, hopefully with a success message. Now, the user realizes they can chain this entire sequence into a single, powerful command line.
Generate Code -> Run Code -> If Error, Feed Error Back and Fix
They can simulate this for a new task on the same data.
code
> #1 | Generate seaborn code for a boxplot of Price by ProductID | !run:python
This single line does the work of steps 2 and 3. The LLM generates code, and its output is immediately piped to the Python agent for execution. The result (either an image file or an error) becomes the final output.
Step 6: Comparing Models (Directive)
The user isn't happy with the plot style. They want to see if another model can do better. They use a directive to switch models for a single query, branching from the original request.
code
> #1 -> [model:claude-3-opus] Make a more visually appealing plot of the same data. Use a professional color palette.
Now they have two branches from Node 1, each with a different approach to plotting, allowing for direct comparison.
code
GRAPH VIEW
1: [G4-T] What are the columns in $sales_data.csv? ...
|
+-> 2: [G4-T] #1 | Generate pandas code ...
|
+-> 6: [C3-O] #1 -> [model:claude-3-opus] Make a more visually appealing...
The Emergent Power
This isn't just a command line; it's a "thought processor." By combining these simple primitives, a user can:
Create Reusable Tools: A complex chain like #1 | [model:sonnet] Extract entities | !fs:write ./entities.json becomes a one-liner for an extraction pipeline.
Perform Complex A/B/C Testing: Fork a single prompt into multiple branches, each with a different model, temperature, or persona directive ([persona:skeptic], [persona:optimist]), and see all the results in one graph.
Build Self-Correcting Workflows:Generate Code | Run Agent | If Error -> Feed Error Back to Fix can be structured.
Maintain Perfect Context: The graph structure ensures that every step of a complex task is visually and logically connected, eliminating the "scroll-back-and-re-read" problem of chat UIs.
Kōan transforms the user from a conversationalist into a conductor, orchestrating a symphony of LLMs, data, and tools to build something far greater than the sum of its parts.