generate fact triggers on each turn

This commit is contained in:
Avraham Sakal
2025-07-28 22:15:59 -04:00
parent 55d35e150c
commit c2815b4d83
3 changed files with 147 additions and 5 deletions
+12
View File
@@ -15,6 +15,16 @@ export type Fact = {
createdAt: string;
};
export type FactTrigger = {
id: string;
sourceFactId: string;
content: string;
priorityMultiplier: number;
priorityMultiplierReason: string;
scopeConversationId: string;
createdAt: string;
};
type DB = {
conversations: Array<Conversation>;
messages: Array<{
@@ -27,12 +37,14 @@ type DB = {
runningSummary?: string;
}>;
facts: Array<Fact>;
factTriggers: Array<FactTrigger>;
};
export const db = new Low<DB>(new JSONFile("db.json"), {
conversations: [],
messages: [],
facts: [],
factTriggers: [],
});
/** Initialize the database. Sets `db.data` to the default state if the file doesn't exist. */
await db.read();