generate and save facts

This commit is contained in:
Avraham Sakal
2025-07-27 10:53:25 -04:00
parent d7716bd451
commit ee9e9424ab
7 changed files with 114 additions and 18 deletions
+10
View File
@@ -7,6 +7,14 @@ export type Conversation = {
userId: string;
};
export type Fact = {
id: string;
userId: string;
sourceMessageId: string;
content: string;
createdAt: string;
};
type DB = {
conversations: Array<Conversation>;
messages: Array<{
@@ -18,11 +26,13 @@ type DB = {
createdAt: string;
runningSummary?: string;
}>;
facts: Array<Fact>;
};
export const db = new Low<DB>(new JSONFile("db.json"), {
conversations: [],
messages: [],
facts: [],
});
/** Initialize the database. Sets `db.data` to the default state if the file doesn't exist. */
await db.read();