anthropics / anthropic-quickstarts

A collection of projects designed to help developers quickly get started with building deployable applications using the Anthropic API
MIT License
6.55k stars 902 forks source link

Feature Request: Continue previous session when reconnecting #142

Open Quasimondo opened 6 days ago

Quasimondo commented 6 days ago

It is my impression that when - as it happens occasionally - the browser locks up or one closes the localhost:8080 tab and reconnects the entire previous session is lost. I assume this is due to all vital data being stored in st.session_state. It would be desirable if there was a way to reconnect to the previous session and continue with the ongoing thread. Maybe there is a way in loop.py to continuously store the session information in a local file and on request restore that data?

p-i- commented 6 days ago

It would be nice to have a dump of the conversation json into a logfile as a stopgap/quickfix. Then we could at least feed an old convo in as an initial message (maybe after some rudimentary pruning). maybe a tools/ folder with an inspect_logs.sh and an extract_convo_text.py. Maybe a build_image.sh and run_image.sh too?)

Quasimondo commented 5 days ago

In my customized system I have implemented that feature already and yes it is a possibility. In the end you can always ask claude to improve itself - the only difficulty is that when it starts changing loop.py and streamlit.py it tends to temporarily break things which is exactly where being able to restore the session would come in handy.

drorm commented 5 days ago
  1. As @p-i- mentions, this should be thought of in the context of keeping a full history of sessions and interactions.
  2. I vote for a file per session since the amount of data is quite large.
  3. I'm ambivalent about JSON vs markdown. JSON would let us replay the exact history, but I'm not convinced that that's what we want. In ways markdown summaries seem like a better way to feed the LLM, but we'd need to experiment.
p-i- commented 5 days ago

YAML > (Markdown, NestedText, JSON)

(I've tried all 4).

You can YAML -> JSON, and YAML is (Nigh-optimally) human-readable, especially if you use a VSCode extension for syntax-hilighting markdown-blocks--in--YAML. Yummy.

p-i- commented 5 days ago

Crosslinking https://github.com/anthropics/anthropic-quickstarts/issues/137

dikkietrom commented 3 days ago

It would be nice to have a dump of the conversation json into a logfile as a stopgap/quickfix. Then we could at least feed an old convo in as an initial message (maybe after some rudimentary pruning). maybe a tools/ folder with an inspect_logs.sh and an extract_convo_text.py. Maybe a build_image.sh and run_image.sh too?)

good idea, it should be possible to let claude add that to the computer use demo and submit that as a pull request so that we all have it. I am trying to do self improvement but when there is a bug it is also self crashing haha, it needs a computer demo in a computer demo to work on self. Anyways I am trying to set it up like that as we speak, not quite there yet.

p-i- commented 3 days ago

@dikkietrom That's what I've done. If you search the issues for author:p-i- you'll get fixes for the main blockers. Last one only took 20 mins(!).

Quasimondo commented 3 days ago

If you are looking for some code that can push PRs as autonomously to a repo you can check out this prototype (written with Claude): https://github.com/Quasimondo/OpenMender

On Sun, Nov 3, 2024, 12:58 AM Pi @.***> wrote:

@dikkietrom https://github.com/dikkietrom That's what I've done. If you search the issues for author:p-i- you'll get fixes for the main blockers. Last one only took 20 mins(!).

— Reply to this email directly, view it on GitHub https://github.com/anthropics/anthropic-quickstarts/issues/142#issuecomment-2453229743, or unsubscribe https://github.com/notifications/unsubscribe-auth/AABMOUXBUI3PUUJ74NG2FZ3Z6VRK5AVCNFSM6AAAAABQ55GLTCVHI2DSMVQWIX3LMV43OSLTON2WKQ3PNVWWK3TUHMZDINJTGIZDSNZUGM . You are receiving this because you authored the thread.Message ID: @.***>

dikkietrom commented 2 days ago

@dikkietrom That's what I've done. If you search the issues for author:p-i- you'll get fixes for the main blockers. Last one only took 20 mins(!).

thanks, impressive not this stuff? i mapped a host folder to the container so it can work on things on my mac without controlling it and removed the computer tool because it does not work ok and takes all my credits. my head explodes thinking over the potential implications of this. it is already at a high level of usefulness to me in this initial state

dikkietrom commented 2 days ago

If you are looking for some code that can push PRs as autonomously to a repo you can check out this prototype (written with Claude): https://github.com/Quasimondo/OpenMender On Sun, Nov 3, 2024, 12:58 AM Pi @.> wrote: @dikkietrom https://github.com/dikkietrom That's what I've done. If you search the issues for author:p-i- you'll get fixes for the main blockers. Last one only took 20 mins(!). — Reply to this email directly, view it on GitHub <#142 (comment)>, or unsubscribe https://github.com/notifications/unsubscribe-auth/AABMOUXBUI3PUUJ74NG2FZ3Z6VRK5AVCNFSM6AAAAABQ55GLTCVHI2DSMVQWIX3LMV43OSLTON2WKQ3PNVWWK3TUHMZDINJTGIZDSNZUGM . You are receiving this because you authored the thread.Message ID: @.>

I would want a fork of computer use that is managed by AI so that we can do PRs that are immediately reviewed/tested and deployed. Just as an experiment to see what happens.