# (\*\*UPDATE\*\*): GPT Chat History Only REMEMBERS First Message – Can’t Get Full Thread Working

**URL:** <https://community.glideapps.com/t/update-gpt-chat-history-only-remembers-first-message-can-t-get-full-thread-working/84513>\
**Category:** Ask for Help\
**Created:** [September 22, 2025, 1:37am UTC](https://community.glideapps.com/t/update-gpt-chat-history-only-remembers-first-message-can-t-get-full-thread-working/84513 "2025-09-22T01:37:57Z")\
**Posts on this page:** 3\
**Page:** 1

<div class="post-metadata">

**Author:** ![Kyle\_Kendrick](https://sea2.discourse-cdn.com/flex002/user_avatar/community.glideapps.com/kyle_kendrick/32/91920_2.png) [@Kyle\_Kendrick](https://community.glideapps.com/u/Kyle_Kendrick)\
**Post date:** [September 22, 2025, 1:37am UTC](https://community.glideapps.com/t/update-gpt-chat-history-only-remembers-first-message-can-t-get-full-thread-working/84513/1 "2025-09-22T01:37:57Z")

</div>

Hey Glide team and community — I’m building a custom OpenAI-powered chat system in Glide and I’ve hit a wall for over a week. Hoping someone can help me troubleshoot what’s wrong with my message history setup.

### ⚙ What I’m Building:

A chat assistant that uses Glide’s GPT block (Complete Chat with History) to let users have persistent conversations across sessions — like a mini ChatGPT clone.

- Each **Session** is one conversation.
- Each **Message** belongs to a Session.
- Assistant responses are saved as new rows, not just inline in the user’s message row.

### ❌ The Problem:

Only the **first message** is ever REMEMBERED in the message history for GPT.

- **All messages are showing in the chat view** — so relations are working fine.
- **BUT GPT only REMEMBERS the very first message.**
- Every response it gives is as if it’s replying to message #1 — like it’s blind to the full thread.

💡 This isn’t a display issue.  
The visual chat log is perfect. The **message history memory for GPT** is what’s broken.

- No future user messages seem to be recognized.
- I know this because only the first message shows the user avatar; all others show a “?”.
- I confirmed that all messages are being saved **with the correct Session ID**.
- I also confirmed the GPT block is **inside the detail screen of that Session row**.

### ✅ What I’ve Done So Far:

#### 📄 `Sessions` Table (my version of “Chats”):

- `Session ID` (Row ID)
- `User Email` (set as row owner)
- `Bot Email` (pulled from Settings)
- `SessionMsgs_Rel` → Relation to `Messages` where `Messages.Session ID` = `Sessions.Session ID`

#### 💬 `Messages` Table:

- `Content`: user input
- `Result`: assistant response (optional)
- `Role`: `"user"` or `"assistant"`
- `Email`: sender (either logged-in user or bot)
- `Receiver Email`: receiver (opposite party)
- `Session ID`: points to parent session
- `Timestamp`: sent time

→ **Both `Email` and `Receiver Email` are Row Owners**

#### ⚙ GPT Block Setup (in Messages component):

- **Message History** : `SessionMsgs_Rel`
- **Prompt** : pulled from `Settings → Prompt`
- **Message** : `Content`
- **Session ID** : from current Session
- **Result** : `Result`
- **Role** : `"user"`
- **Email** : `App → User Email`
- **Receiver Email** : bot email (via lookup or single value)

#### 🧠 GPT Submit Action:

1. Complete Chat with History
2. Then → Add Row to `Messages` with:

- `Content`: Result
- `Role`: `"assistant"`
- `Email`: bot email
- `Receiver Email`: user email
- `Session ID`: same session
- `Timestamp`: now

#### 🧭 Navigation Logic:

When a session is tapped, I set the current session’s ID into a user-specific column to track active chat.

* * *

### 🧪 What I’ve Tried:

- Double-checked everything 100x over
- Verified GPT block is in the detail screen of `Sessions → SessionMsgs_Rel`
- Ensured roles are being set as `"user"` and `"assistant"` in text (not capitalized)
- Confirmed all Row Owner rules are applied correctly
- Checked that Submit action writes the assistant reply as a **new row** , not updating user row
- Tried logging and watching message flow — everything is saving as expected

* * *

### ❓What I Need:

- Is there something _else_ Glide needs in the config for the GPT block to access multiple messages by Session ID?
- Is there a bug with the message history system only remembering the first message?
- Is there a better way to pass `Msgs_Rel` into the GPT block for memory?

* * *

### Screenshots / Reference:

Happy to provide screen recordings or screenshots if needed. This is a core part of my project, and it’s so close — but GPT just isn’t remembering the full message thread.

Appreciate any help —

Thank you so much in advance!

* * *

---

<div class="post-metadata">

**Author:** ![Kyle\_Kendrick](https://sea2.discourse-cdn.com/flex002/user_avatar/community.glideapps.com/kyle_kendrick/32/91920_2.png) [@Kyle\_Kendrick](https://community.glideapps.com/u/Kyle_Kendrick)\
**Post date:** [September 22, 2025, 4:26pm UTC](https://community.glideapps.com/t/update-gpt-chat-history-only-remembers-first-message-can-t-get-full-thread-working/84513/2 "2025-09-22T16:26:11Z")

</div>

**Update: It’s working.**

After weeks of Glide’s `Complete chat (with history)` silently dropping memory, I rebuilt the entire flow manually:

• Created a `Msg_JSON_Snippet` per message  
• Joined + wrapped them in `[]` in `Sessions`  
• Looked up that full history into `Messages` via relation  
• Passed the wrapped JSON into the `Complete chat` block (no history)  
• Manually wrote the assistant reply to `Messages`

Now it remembers every message. Every session. Perfectly.

If Glide’s memory isn’t working for you — stop using their auto-history. Build your own.  
You’ll never go back.

---

<div class="post-metadata">

**Author:** ![ThinhDinh](https://sea2.discourse-cdn.com/flex002/user_avatar/community.glideapps.com/thinhdinh/32/49_2.png) [@ThinhDinh](https://community.glideapps.com/u/ThinhDinh)\
**Post date:** [September 22, 2025, 11:45pm UTC](https://community.glideapps.com/t/update-gpt-chat-history-only-remembers-first-message-can-t-get-full-thread-working/84513/3 "2025-09-22T23:45:38Z")

</div>

That’s the general way to build it, but beware with the limit of tokens you can send in a single call, and the cost it would take to keep up a long conversation with that approach.
