feat(agent): messages array, memory (#2023)

* feat(agent): messages array, memory options

* feat(messages-input): re-order messages

* backend for new memory setup, backwards compatibility in loadWorkflowsFromNormalizedTable from old agent block to new format

* added memories all conversation sliding token window, standardized modals

* lint

* fix build

* reorder popover for output selector for chat

* add internal auth, finish memories

* fix rebase

* fix failing test

---------

Co-authored-by: waleed <walif6@gmail.com>
This commit is contained in:
Emir Karabeg
2025-11-18 15:58:10 -08:00
committed by GitHub
parent a8a693f1ff
commit 02d9fedf0c
53 changed files with 11580 additions and 1430 deletions

View File

@@ -0,0 +1,2 @@
ALTER TABLE "memory" ALTER COLUMN "data" SET DATA TYPE jsonb;--> statement-breakpoint
ALTER TABLE "memory" DROP COLUMN "type";

File diff suppressed because it is too large Load Diff

View File

@@ -757,6 +757,13 @@
"when": 1762572820066,
"tag": "0108_cuddly_scream",
"breakpoints": true
},
{
"idx": 109,
"version": "7",
"when": 1763503885555,
"tag": "0109_bumpy_earthquake",
"breakpoints": true
}
]
}

View File

@@ -916,9 +916,8 @@ export const memory = pgTable(
{
id: text('id').primaryKey(),
workflowId: text('workflow_id').references(() => workflow.id, { onDelete: 'cascade' }),
key: text('key').notNull(), // Identifier for the memory within its context
type: text('type').notNull(), // 'agent' or 'raw'
data: json('data').notNull(), // Stores either agent message data or raw data
key: text('key').notNull(), // Conversation ID provided by user with format: conversationId:blockId
data: jsonb('data').notNull(), // Stores agent messages as array of {role, content} objects
createdAt: timestamp('created_at').notNull().defaultNow(),
updatedAt: timestamp('updated_at').notNull().defaultNow(),
deletedAt: timestamp('deleted_at'),