from medium-chat Medium Chat Initial Prototype Implementation Log

  • Implementation
    • Since we have the opportunity, let’s try to outline the process of creating a prototype using ChatGPT and similar tools.

10:38

  • I’d like the agent to be autonomously standing by rather than being called to action.
    • As we might want to do unconventional things rather than the usual back-and-forth interaction.
    • I think that’s where we’ll end up if we want to create a realistic agent.
      • Constantly monitoring input and deciding “should I respond now” based on some logic.
        • Well, this can be put on hold for now (blu3mo)

image

  • What is RabbitMQ?
    • https://e-words.jp/w/AMQP.html
    • It seems useful, but I don’t want to make things that complex right now. It seems like we can implement it more simply for just creating a chat. image
  • Avoiding RabbitMQ by specifying supabase
  • Hmm, doesn’t quite fit.
    • Feels like it could be simpler.

10:51 Looking at these, I came up with a structure myself (blu3mo)

- Unrelated to AI
- Being able to send messages by specifying the room ID and username

- If you specify the room IDs of User A and User B, it bridges the two.
  • This seems promising (blu3mo)(blu3mo)

  • Let’s first quickly build part 1

    • image
      • By using App Router, we can prompt the corresponding code to be generated.
    • image
  • Created the repository for medium-chat and set up directories for the frontend and agent.

  • Simultaneously thinking about how to build the agent side

    • It’s either Python or TypeScript (node.js)
      • Well, TypeScript seems safe.
  • Setting up supabase

    • Ah, maximum of 2 projects. Hit the limit.
    • Maybe pausing asym-chat would be okay
      • Or worst case, we can piggyback on asym-chat.
    • Pausing asym-chat. Seems like it’ll take time, so moving to the agent side.

11:13

  • Agent side implementation
    • image
    • Rather than diving into LLM conversion right away, let’s first implement a simpler system with the same structure to confirm functionality (blu3mo)(blu3mo)
      • In this case, a mechanism that simply forwards messages to another room without any conversion.

11:23

  • Testing the simple chat frontend
    • image
    • image
    • It’s too minimalistic, but at least it’s doing what it’s supposed to do for now.
  • Testing the agent side
    • image
    • Hmm, not picking up new posts. Why?
    • I suspected the filter process, so I tried turning it off, and that picked up the posts.
      • While looking at other errors, I realized I had mistyped the database column name I gave to Claude.
      • Rather than debugging, it’s faster to correct and regenerate the prompt.
  • It worked, but there was an infinite loop
    • Well, that makes sense (blu3mo)
    • It’s more helpful to have a visible flag, so I temporarily added “_ai” as a suffix to the username to not pick up those messages.
      • image
      • image
    • Done ✅ (blu3mo)
  • However, there seems to be a glitch on the frontend where updates from other rooms are temporarily displayed in the chat log.- I was looking at the code and roughly understood the issue, so I had Claude fix it (blu3mo).
    • image

Checking the functionality: - imageimage - Looks good (blu3mo) (blu3mo)

11:45 pm

  • Commited here for now and taking a break
    • image
    • Getting more enjoyable (blu3mo) (blu3mo) (blu3mo) (blu3mo)

The next morning image

  • Improving the design while playing around in Claude

10:35 Thinking about the design of the Agent part:

  • Current concept:
    • def Item: Notes being added to the communication queue
      • Description of speech and communication (e.g., “A greeted and introduced themselves as ‘A’“)
      • Want to come up with a better name (blu3mo)
    • When a new post arrives in Room A, think about “Has a new item been created in Room A?”
      • If it is determined that an item should be added, add the item to the shared notes, set completion to roomA: true, roomB: false, roomC: false, and set sender as A
      • Show LLM “current conversation logs” and “items in the current list that are true in that room,” and prompt to generate a response for items that are in the conversation logs but not in the item list?
    • Speaking timing
      • For now, I want to keep this simple
      • Like, “Start generating after receiving a message for 3 seconds,” or something
        • It could be made more realistic and interesting, but not necessary for the MVP
      • Pull elements from the item list where the sender matches and completion is false, and try to incorporate them while conversing, and generate responses with this prompt
        • Weighting importance could also be possible, but let’s put that on hold for now
    • Design is decided for now (blu3mo)
      • Just have to build it now

10:54

  • Let’s start by creating the outer frame.
    • image
  • Once that’s done, we’ll work on the interior
    • First, we need to extract the items

Thoughts: - Is it okay for LLM to say new things on its own? - If not allowed at all, responses can be difficult - It’s tough to extend with vague responses - Ideally, it would be nice if that could also be somewhat predictable - You can predict about 90% of what humans say

While observing the development process of writing code with Claude, I realized that there are still many subjective processes like “finding bugs by staring at the code” and “coming up with designs by staring at requirements” (blu3mo).