diff options
| author | Ben Sima <ben@bensima.com> | 2025-12-12 18:55:15 -0500 |
|---|---|---|
| committer | Ben Sima <ben@bensima.com> | 2025-12-12 18:55:15 -0500 |
| commit | a6863d562a76eff5de36e0faa244e6ae2310bc22 (patch) | |
| tree | 1953a43ecaacbf48355bb0c6b32d7b81e853455d /Omni/Agent/Memory.hs | |
| parent | 622786d69393c650d8d5e2b080ba9fad77f901e0 (diff) | |
Add PDF and Notes tools to Telegram bot
- Omni/Agent/Tools/Pdf.hs: Extract text from PDFs using pdftotext
- Omni/Agent/Tools/Notes.hs: Quick notes CRUD with topics
- Add notes table schema to Memory.hs initMemoryDb
- Wire both tools into Telegram bot with logging callbacks
Diffstat (limited to 'Omni/Agent/Memory.hs')
| -rw-r--r-- | Omni/Agent/Memory.hs | 15 |
1 files changed, 15 insertions, 0 deletions
diff --git a/Omni/Agent/Memory.hs b/Omni/Agent/Memory.hs index 461f7ac..8337baf 100644 --- a/Omni/Agent/Memory.hs +++ b/Omni/Agent/Memory.hs @@ -513,6 +513,21 @@ initMemoryDb conn = do SQL.execute_ conn "CREATE INDEX IF NOT EXISTS idx_summary_user_chat ON conversation_summaries(user_id, chat_id)" + SQL.execute_ + conn + "CREATE TABLE IF NOT EXISTS notes (\ + \ id INTEGER PRIMARY KEY AUTOINCREMENT,\ + \ user_id TEXT NOT NULL,\ + \ topic TEXT NOT NULL,\ + \ content TEXT NOT NULL,\ + \ created_at TIMESTAMP DEFAULT CURRENT_TIMESTAMP\ + \)" + SQL.execute_ + conn + "CREATE INDEX IF NOT EXISTS idx_notes_user ON notes(user_id)" + SQL.execute_ + conn + "CREATE INDEX IF NOT EXISTS idx_notes_topic ON notes(user_id, topic)" -- | Create a new user. createUser :: Text -> Maybe Int -> IO User |
