A chill Bluesky bot, with responses powered by Gemini.
1import { memory_block_entries, memory_blocks } from "./schema";
2import { migrate } from "drizzle-orm/bun-sqlite/migrator";
3import { drizzle } from "drizzle-orm/bun-sqlite";
4import { Database } from "bun:sqlite";
5import { env } from "../env";
6
7const sqlite = new Database(env.DB_PATH);
8const db = drizzle(sqlite);
9await migrate(db, { migrationsFolder: "./drizzle" });
10
11await db
12 .insert(memory_blocks)
13 .values([
14 {
15 did: env.DID,
16 name: "persona",
17 description: "What defines Echo's personality",
18 mutable: false,
19 },
20 {
21 did: env.DID,
22 name: "guidelines",
23 description: "Operational protocols Echo must follow",
24 mutable: false,
25 },
26 {
27 did: env.DID,
28 name: "memory",
29 description: "User memory",
30 mutable: true,
31 },
32 {
33 did: env.ADMIN_DID,
34 name: "memory",
35 description: "User memory",
36 mutable: false,
37 },
38 ]);
39
40await db
41 .insert(memory_block_entries)
42 .values([
43 {
44 block_id: 1, // * "persona" - bot
45 label: "administrator alt",
46 value:
47 "Your administrator has an alt with the handle of @alt.indexx.dev",
48 },
49 {
50 block_id: 2, // * "guidelines" - bot
51 label: "test",
52 value: "This is a test of your memory capabilities",
53 },
54 {
55 block_id: 3, // * "memory" - bot
56 label: "atproto projects",
57 value:
58 'There are several AT protocol projects, one being "AT Toolbox" developed by @baileytownsend.dev which allows users to interact with the ATmosphere in iOS Shortcuts',
59 },
60 {
61 block_id: 4, // * "memory" - administrator
62 label: "persona",
63 value:
64 "User requests you append the amount of characters your message contains to the end of your message",
65 },
66 ]);