
Gentui: a full chat UI for your Strands or LangChain agent, in a few lines
Gentui is an open-source terminal UI that gives your Strands or LangChain agent a full chat experience in a few lines of code. No server, no frontend.
When I build an agent, the first thing I want to do is talk to it and see what it's doing: the streamed answer, each tool call with its arguments, the result, and the moment it asks for permission. Building a Streamlit or React front end just for that pulls me away from what I actually want to improve: the agent.
So I built Gentui, an open-source terminal UI for prototyping agents. Point it at any AG-UI endpoint, or, new in the latest releases, run your agent inline: inside Gentui, in the same Python process, with no server at all.
Run your agent inline
If you have a Strands agent, this is the whole integration:
1
2
3
4
5
6
7
8
9
10
11
from strands import Agent, tool
from gentui import GentUI
def multiply(a: float, b: float) -> float:
"""Multiply two numbers."""
return a * b
agent = Agent(tools=[multiply])
GentUI.from_strands(agent).run()And for LangChain or LangGraph:
1
2
3
4
5
6
7
8
9
10
11
12
from langchain.agents import create_agent
from langchain_core.tools import tool
from gentui import GentUI
def multiply(a: float, b: float) -> float:
"""Multiply two numbers."""
return a * b
agent = create_agent(model, tools=[multiply])
GentUI.from_langchain(agent).run()There is no FastAPI app, no endpoint and no second process. Install what you need:
1
2
pip install 'gentui[strands]' # Strands Agents
pip install 'gentui[langchain]' # LangChain / LangGraphUnder the hood, a small adapter calls your agent's streaming API and translates what comes back into AG-UI events. Everything after that is Gentui's normal pipeline, so the experience is the same whether the agent is in your process or behind an HTTP endpoint.
An agent on Amazon Bedrock AgentCore Runtime. If your runtime is deployed with the AG-UI protocol, give Gentui its ARN. It uses your normal AWS credentials and signs requests with SigV4, so there is no URL or token to manage:
1
2
3
4
5
6
pip install 'gentui[agentcore]'
gentui arn:aws:bedrock-agentcore:us-east-1:123456789012:runtime/my_agent-AbCdEfGhIj
# choose the profile, region or endpoint explicitly
gentui --agentcore-arn <ARN> --profile dev --region eu-west-1 --qualifier prodWhat you get
Streaming chat and reasoning. Answers stream in as they are generated. If the model returns its chain of thought, Gentui shows it separately and you can hide it. It never invents reasoning the model did not return.

Tool cards. Each tool call is a card with the tool name and arguments, a running state, and then the real result, or a red failed line if the tool raised.
1
2
3
4
> Calculate 125 * 42
◆ multiply(a=125.0, b=42.0)
⎿ 5250.0
● 125 × 42 = 5250.
Human approval. Some tools should not run until a person says yes. In Strands,
approval_hook pauses the agent before the tool runs. In LangChain, approval_middleware does the same through LangGraph's interrupt():1
2
3
agent.add_hook(approval_hook("delete_file")) # Strands
create_agent(model, tools, middleware=[approval_middleware("delete_file")]) # LangChainGentui shows Approve / Reject. Approve runs the tool. Reject never runs it, and the model is told the user refused, so it carries on sensibly.

Tables and charts. Give the agent tools named
show_table and show_chart and Gentui draws them in the terminal.
An event inspector. Press
d to see both sides of the translation, the framework's events coming in and the AG-UI events going out. It is the quickest way to find out why an agent did what it did.Record, replay and compare
Gentui can save any session to a JSON file and play it back with pause, a seek bar and speed control, with no agent and no network. You can also run the same prompts against two versions of your agent, diff the answers side by side, and have a judge (a local Ollama model, or your own function) score each prompt. The comparison exports to a single HTML page. For prototyping, that answers "did my last change make the agent better or worse?" without eyeballing two terminals.
In a browser too
Add
--serve to a command and the same UI opens in a web page:1
2
pip install 'gentui[web]'
gentui http://localhost:8000/agent --serve # open http://localhost:8080It listens on
localhost by default.Try it without a backend
1
2
pip install gentui
gentui --demoThe demo plays a scripted tour of every feature by itself.
Where it stands
Gentui is alpha and MIT-licensed. I have tested it with Strands Agents over AG-UI and with Amazon Bedrock AgentCore Runtime. The in-process Strands and LangChain adapters are tested against real agents driven by a scripted model; I have not yet run the LangChain one against a real model provider, so treat it as early. Issues, ideas and pull requests are welcome.
- Code: https://github.com/rahrajlat/Gentui
- Docs: https://rahrajlat.github.io/Gentui/
- PyPI: https://pypi.org/project/gentui/
Enjoyed reading this content? Let the author know!
Your likes, comments, shares, and saves help creators reach more builders.
Loading recommendations
Loading article