tarasglek / chatcraft.org

Developer-oriented ChatGPT clone
https://chatcraft.org/
MIT License
148 stars 26 forks source link

Rework chatcraft message store around the concepts in openai assistants #658

Open tarasglek opened 5 days ago

tarasglek commented 5 days ago

For reference openai assistants docs: https://platform.openai.com/docs/assistants/overview

Assistants is a verbose wrapper over chat completion api..but it's a useful way to think about openai chat abstraction.

  1. Lets change chatcraft backend to store message history in Threads
  2. instead of system prompt history, we should store assistants.
  3. Instead of pasting webhandlers as chat message content, they should attached as attachments to messages
  4. Assistants have vector stores. For now we can just treat files in vector stores and things we can attach to system prompt.

Once we have such an api, we should be able to point chatcraft at official openai assistants as backend or use it locally with indexedb as we do now and just change the schema to match that of assistants.

We might wanna use duckdb to move away from indexedb, as duckdb can import/export in compressed files, can do vector search, etc. It's only 7.6mb

https://duckdb.org/docs/api/wasm/overview.html https://shell.duckdb.org/

humphd commented 4 days ago

This is such a cool idea. Let's find some time to discuss a plan for how to work toward it.