generate and save facts
This commit is contained in:
@@ -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();
|
||||
|
||||
Reference in New Issue
Block a user