Hacker Newsnew | past | comments | ask | show | jobs | submitlogin
Chat-UI, the codebase of HuggingChat, is open sourced (github.com/huggingface)
141 points by osanseviero on May 11, 2023 | hide | past | favorite | 30 comments


ATM ChatGPT is tedious.

I think there are two things we can take from discord/fb messenger/slack to improve it:

1) ChatGPT and this thing needs threads. I want to be able to take a conversation and fork it - with separate conversational memories/context after a point of forking. I want to be able to take a message, go "reply" to it, and be able to do that as many times as I want, per message, with each reply being treated independently of all other replies. It is insanely useful to be able to take a conversation / debugging session / etc into a different direction experimentally without risking the entire state of the conversation thus far.

2) I want to be able to react to the messages. Thumbs up / down, agree/ disagree, etc - a small set of reactions to drive behavior would be huge, and would cut down on a lot of back and forth verbosity that plagues these.


ChatGPT allows you to do this, using the edit prompt and arrow buttons to switch between chat “trees”

With that said, I was frustrated with this enough to build my own tool that allows you to branch/fork any conversation into an entirely new chat (“seeding”).

Overtime we’ve added agents, multiplayer, memory, document upload etc. but the most used feature is still the branching/seeding concept.

Happy to share more details if curious!


Personally, I'm primarily using TypingMind UI (via API). To my great surprise, it seems that at some point, the author removed this feature from the UI. It's their one decision I just can't understand.

Unfortunately, I haven't found a better UI replacement yet. ChatGPT on OpenAI doesn't cut it - that app is, for some reason, way too slow and heavy for my Firefox, both on my laptop and my phone.

As for GP's request in general: I fear this is unfortunately the blind spot of communication tools design showing up again. With ChatGPT, it's important more so than ever, to recognize that a prolonged discussion will naturally fit a DAG. Not just a tree, but a directed acyclic graph.

(Tree is what you get when you want to branch out. DAG is what you get when you then want to merge branches back, or generally reference multiple parallel threads in one response.)

EDIT: This took me by surprise - someone actually did a tree interface for ChatGPT!

See: https://github.com/jumang4423/treed-gpt4

Discovered via: https://news.ycombinator.com/item?id=35909273 (thanks 'itsuka!)


TypingMind can still fork a conversation, although it does seem harder to find.

You have to click “Edit” on a previous prompt, and then “Start new chat from here”. I don’t know where this is documented, but the FAQ chatbot (https://www.typingmind.com/faqs) was able to answer my question “How do I fork a conversation?”, and it does seem to work as described.

Ah, here it is (partly): https://tdinh.notion.site/Features-14e2788cd7264d87b0a4bf71b...


You're welcome :)

> someone actually did a tree interface for ChatGPT!

In case anyone is interested, UCSD Creativity Lab has a couple DAG UIs that offer richer interactions and visualizations:

- Sensecape: https://twitter.com/HaijunXia/status/1646919380704559104

- Graphologue: https://twitter.com/HaijunXia/status/1646917869115166720

According to the discussion on the thread, they are in the process of open sourcing these two projects.


Can you describe more how this DAG would look?

I can kind of understand it from a human perspective, sometimes someone will write a big block of text and you want to respond to different parts of it, so it branch off in that way, or you have 2 different people respond to the same parent comment and have it branch that way.

But merging -- sure I can see how a human might bring the ideas in each thread together again into one cohesive thought but visually, like in a UI, how would you represent that?

And how would you feed that back into ChatGPT? ChatGPT takes in a linear ordering of messages, not a tree or DAG.


> But merging -- sure I can see how a human might bring the ideas in each thread together again into one cohesive thought but visually, like in a UI, how would you represent that?

       ---------------------------
      (     THREAD ROOT           )
       ----------+---+------------
           …-----+   +---…
           |             |
        +--+---+      +--+---+
        | AAA  |      | BBB  +--+
        +--++--+      +--+---+  |
      +--+ ||  +--+      |      |
      |A1+-++--+A2|      |   +--+-+
      +-++     ++-+      |   | B1 |
        |       |        |   +--+-+
        |      ++-+      |      |
        |      |A3|      |      |
        |      ++-+      |      …
      +-+----+  |        |
      | CCC  +--+--------+
      +--+---+
         |
         …
(Note: this is meant to be a DAG - so edges have implied arrows.)

Here, reply "CCC" referred to / quoted replies "A1", "A3" and "BBB" - not only merging sub-branches of subthread "AAA", but also joining in subthread "BBB" as well. Text-wise, it would look something like:

  > [quote from A1]
  Yes, another poster covered it [BBB](here):

  > [quote from BBB]
  
  Also, [A3](that other thing) is actually the same thing
  in disguise, because ...
We've been doing stuff like this for ages - personally I've seen or done it many times on phpBB boards and in e-mails - but, because the interface itself was linear (or at best tree-shaped), you have to keep track of the implied DAG on your own, in your head. What I'm asking/wishing for is an UI that supports and visualizes this natively.

> And how would you feed that back into ChatGPT? ChatGPT takes in a linear ordering of messages, not a tree or DAG.

One possibility:

See diagram above. THREAD ROOT is your prompt. Say "CCC" is your reply. When you send it, the app would take the subgraph that stars with "THREAD ROOT" and ends with "CCC" (i.e. containing these two nodes and all other nodes on any of possible paths between start and end), and sort them topologically to get a linear sequence.

To give GPT-4 extra chance at comprehending the structure, we could even format each message like this:

  Chat-Message-ID: <CCC-uuid>
  In-Reply-To: <A1-uuid>, <A3-uuid>, <BBB-uuid>

  Text of the message.
Kind of like e-mail.

With GPT-4 32k, we could probably just dump the entire graph, to give GPT-4 a chance to make merges/cross-references on its own.

Also: it's really the same thing as e.g. resolving dependencies when building software. Dependencies form a DAG, but build order is linear (excluding parallelism, which is an optimization) - the build system toposorts the DAG and builds things in order.


My favorite is still the MacSoup Usenet client.


I'd absolutely be interested to hear more about the tool you're referring to!

How do you structure the memory for your chats? Is that a separate feature from the document upload?


Great question! We segment memory based on "bud" - essentially an agent that remembers data across conversations. When you upload a document, it gets added to the same vector store, allowing each bud to remember things over time.

To be candid, remembering every message in a conversation isn't actually that useful, so by default we don't (search is an exception), and instead rely on a method that extracts the "novel" information for use later.

Happy to set you up with an account, email in profile.


Yeah please share!!


ChatGPT (at least, the paid version) does do this. But the UI doesn't emphasize it very much, and there's no way to visualize the tree of conversations.


Where does it do this?


There are thumbs up and thumbs down to the right of the response, next to the clipboard.

If you hover over your message, an edit button appears. Editing your message fork the conversation, and creates a pagination thing to the left of the user icon.


Oh, sorry, this falls short of what I was asking for:

For the thumbs, this does not seem to change the conversation in any way - ChatGPT does not react.

For editing (this is new to me, so TIL, ty!) - it seems to share memory across threads in a few naive tests I just did, so almost there, but not entirely.


You can edit a message you’ve already sent by hovering over it and clicking the “edit” icon, which will create a new “fork” in the conversation. You can toggle between forks as needed too.


I dont think you can jump back though, right? If you change a previous prompt, you’re just resetting to that point and creating a new thread at the expense of the old one? I use this feature but have coke to the conclusion this is how it works. Have you seen differently?


Once you've changed a prompt, a pair of arrows show up to the left of the prompt allowing you to toggle between the new and old prompts!


The UI is essentially a replication of OpenAI's ChatGPT front-end, which is good, although I wonder if there can be some innovation there.

That's one of the perks of open sourcing it, I suppose.


I maintain a list of open source UIs built on top of OpenAI API to explore unique features and integrations that others have developed: https://github.com/itsuka-dev/awesome-chatgpt-ui. Web version, which has more information: https://atorie.xyz/crafts/plurality

In addition to the usual speech synthesis/recognition and embedding/vector search features, there are also:

- Node layout

- Multiple LLMs and parallel output

- 3D avatar

- Selection + custom context menu (for extensions)

- Native app integration such as Siri and Calendar (for Shortcut in Apple ecosystem)

- etc. (I'm sure there are many other interesting UIs and features that I missed.)


FYI it's svelte over mongo.


Shout out to FerretDB, which is an in progress open source re-implementation of MongoDB atop PostgreSQL.

https://github.com/FerretDB/FerretDB https://hn.algolia.com/?q=Ferretdb


What's with the +filenames? I haven't seen that before. Is it even a legal filename?

Example: chat-ui/src/routes/settings/+page.server.ts



Ah, thanks. I googled it but used the word "plus". I thought that the + wouldn't be recognized, but trying it now actually found it no problem. I guess I need to erase the Google+ era from my mind.


Just a matter of time, until plugins are supported!


Ok smart people how can I create a dropdown list at the top of this that will allow me to select my onsite Llama instance or use Chatgpt api instead


Have you tried asking ChatGPT?


Not yet was hoping someone already has a project going


Will chatgpt even know?

This is past 2021.




Guidelines | FAQ | Lists | API | Security | Legal | Apply to YC | Contact

Search: