@breign/db-schemas 0.1.44 → 0.1.45

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
@@ -0,0 +1,26 @@
1
+ /**
2
+ * Long-term agent memory — one row per virtual file under /memories/.
3
+ *
4
+ * Shared between brain-api (storage adapters + tool) and any other consumer.
5
+ * The path is a virtual filesystem key (e.g. '/memories/core.md'); identity
6
+ * (organisationId/agentId/userId) never comes from the path, always from the
7
+ * server-side chat context.
8
+ */
9
+ export type AgentMemory = {
10
+ id: string;
11
+ /**
12
+ * British spelling "organisationId" — aligned with Agent.organisationId
13
+ * (domain + Mongo storage). In PostgreSQL the COLUMN is organizationId ("z"),
14
+ * mapped inside the PG adapter (cf. agents-pg.adapter.ts).
15
+ */
16
+ organisationId: string;
17
+ /** agentId (not brainId) — consistent with Chat.agentId and the rest of the code. */
18
+ agentId: string;
19
+ userId: string;
20
+ /** e.g. '/memories/core.md' — namespace validated tool-side, never by the model alone. */
21
+ path: string;
22
+ content: string;
23
+ /** Optimistic lock — incremented on every write (see "Concurrency" in the spec). */
24
+ version: number;
25
+ updatedAt: string;
26
+ };
@@ -0,0 +1,2 @@
1
+ "use strict";
2
+ Object.defineProperty(exports, "__esModule", { value: true });
@@ -41,8 +41,14 @@ export type Agent = {
41
41
  hideConversationsInHistory?: boolean;
42
42
  maxToolSteps?: number;
43
43
  contextualKnowledgeConversation?: ContextualKnowledgeConversationConfig;
44
+ memoryConfiguration?: AgentMemoryConfiguration;
44
45
  speechToText?: SpeechToTextConfig;
45
46
  };
47
+ export type AgentMemoryConfiguration = {
48
+ userMemoryEnabled?: boolean;
49
+ agentMemoryEnabled?: boolean;
50
+ organizationMemoryEnabled?: boolean;
51
+ };
46
52
  export type ContextualKnowledgeConversationBackend = 'weaviate' | 'qdrant' | 'colpali';
47
53
  export type ContextualKnowledgeConversationConfig = {
48
54
  enabled: boolean;
@@ -1,4 +1,5 @@
1
1
  export * from './agent';
2
+ export * from './agent-memory';
2
3
  export * from './app';
3
4
  export * from './flow';
4
5
  export * from './flow-editor';
@@ -15,6 +15,7 @@ var __exportStar = (this && this.__exportStar) || function(m, exports) {
15
15
  };
16
16
  Object.defineProperty(exports, "__esModule", { value: true });
17
17
  __exportStar(require("./agent"), exports);
18
+ __exportStar(require("./agent-memory"), exports);
18
19
  __exportStar(require("./app"), exports);
19
20
  __exportStar(require("./flow"), exports);
20
21
  __exportStar(require("./flow-editor"), exports);
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@breign/db-schemas",
3
- "version": "0.1.44",
3
+ "version": "0.1.45",
4
4
  "main": "dist/index.js",
5
5
  "types": "dist/index.d.ts",
6
6
  "scripts": {
@@ -0,0 +1,26 @@
1
+ /**
2
+ * Long-term agent memory — one row per virtual file under /memories/.
3
+ *
4
+ * Shared between brain-api (storage adapters + tool) and any other consumer.
5
+ * The path is a virtual filesystem key (e.g. '/memories/core.md'); identity
6
+ * (organisationId/agentId/userId) never comes from the path, always from the
7
+ * server-side chat context.
8
+ */
9
+ export type AgentMemory = {
10
+ id: string;
11
+ /**
12
+ * British spelling "organisationId" — aligned with Agent.organisationId
13
+ * (domain + Mongo storage). In PostgreSQL the COLUMN is organizationId ("z"),
14
+ * mapped inside the PG adapter (cf. agents-pg.adapter.ts).
15
+ */
16
+ organisationId: string;
17
+ /** agentId (not brainId) — consistent with Chat.agentId and the rest of the code. */
18
+ agentId: string;
19
+ userId: string;
20
+ /** e.g. '/memories/core.md' — namespace validated tool-side, never by the model alone. */
21
+ path: string;
22
+ content: string;
23
+ /** Optimistic lock — incremented on every write (see "Concurrency" in the spec). */
24
+ version: number;
25
+ updatedAt: string;
26
+ };
@@ -37,9 +37,16 @@ export type Agent = {
37
37
  hideConversationsInHistory?: boolean;
38
38
  maxToolSteps?: number;
39
39
  contextualKnowledgeConversation?: ContextualKnowledgeConversationConfig;
40
+ memoryConfiguration?: AgentMemoryConfiguration;
40
41
  speechToText?: SpeechToTextConfig;
41
42
  };
42
43
 
44
+ export type AgentMemoryConfiguration = {
45
+ userMemoryEnabled?: boolean;
46
+ agentMemoryEnabled?: boolean;
47
+ organizationMemoryEnabled?: boolean;
48
+ };
49
+
43
50
  export type ContextualKnowledgeConversationBackend = 'weaviate' | 'qdrant' | 'colpali';
44
51
 
45
52
  export type ContextualKnowledgeConversationConfig = {
@@ -1,4 +1,5 @@
1
1
  export * from './agent';
2
+ export * from './agent-memory';
2
3
  export * from './app';
3
4
  export * from './flow';
4
5
  export * from './flow-editor';