Live data from Hacker News

Show HN: A live Python REPL with an agentic LLM that edits and evaluates code

news.ycombinator.com

1–5 of 5 posts

Show HN: A live Python REPL with an agentic LLM that edits and evaluates code

#1
I built PyChat.ai, an open-source Python REPL written in Rust that embeds an LLM agent capable of inspecting and modifying the live Python runtime state.

A sample interaction:

    py> def succ(n):
    py>   n + 1
    py> succ(42)
    None
    ai> why is succ not working?
    
        Thinking...
        -> Listing globals
         Inspecting: succ
         Evaluating: succ(5)
        
Unlike typical AI coding assistants, the model isn’t just generating text — it can introspect the interpreter state and execute code inside the live session.

Everything runs inside a Rust process embedding the Python interpreter, with a terminal UI where you can switch between Python and the agent via .

It’s very much a prototype, and definitely insecure, but I think the interaction model is interesting and potentially generalizable.

Source: https://github.com/andreabergia/pychat.ai

Blog post: https://andreabergia.com/blog/2026/02/pychat-ai/

Re: Show HN: A live Python REPL with an agentic LLM that edits and evaluates code

#3
> it can introspect the interpreter state and execute code inside the live session.

So you could presumably also set it up to implement its suggestions (i.e. if it "executes" its proposed definition for `succ` that would actually just update it in the global namespace). Fun stuff.

> a terminal UI where you can switch between Python and the agent via .

I'd suggest rethinking this; people usually expect the tab key to auto-complete.

At any rate, thanks for writing the description yourself. The usual LLM-generated copy for these kinds of projects is really obnoxious.

Re: Show HN: A live Python REPL with an agentic LLM that edits and evaluates code

#4
post #3

> it can introspect the interpreter state and execute code inside the live session. So you could presumably also set it up to implement its suggestions (i.e. if it "executes" its proposed definition for `succ` that would actually just update it in the global namespace). Fun stuff. > a terminal UI where you can switch between Python and the agent via . I'd suggest rethinking this; people usually expect the tab key to…

> So you could presumably also set it up to implement its suggestions (i.e. if it "executes" its proposed definition for `succ` that would actually just update it in the global namespace). Fun stuff.

Yep, I've had that working in some earlier version of the tooling.

> I'd suggest rethinking this; people usually expect the tab key to auto-complete.

That's a fair point.

> At any rate, thanks for writing the description yourself.

I might let an LLM write the code, and even the user's manual, but I write my own blog post and comments. :-)