update review-voice-notes to query MongoDB instead of filesystem
This commit is contained in:
parent
579d408ede
commit
fa21932081
2 changed files with 25 additions and 16 deletions
|
|
@ -1,7 +1,7 @@
|
|||
---
|
||||
name: review-voice-notes
|
||||
description: |
|
||||
Find, list, and act on voice notes by date. Searches the voice_notes directory for files matching a given date, reads each one, and presents them as a numbered table for the user to pick which ones to act on.
|
||||
Find, list, and act on voice notes by date. Queries the dictations collection in MongoDB for documents matching a given date, reads each one, and presents them as a numbered table for the user to pick which ones to act on.
|
||||
|
||||
Triggers when user mentions:
|
||||
- "review voice notes"
|
||||
|
|
@ -16,32 +16,39 @@ Review voice notes from a given date (defaults to today). Present them as a numb
|
|||
|
||||
## How It Works
|
||||
|
||||
Voice notes live in `Inbox/voice_notes/` with subdirectories like `unprocessed/`, `journal_box/`, `project_ideas/`, `zk/`, `inbox/`, `drafts/`, and `misc_dictations/`. Files are named with a date prefix in the format `YYMMDD-HHMM`.
|
||||
Voice notes are stored in the `notes.dictations` collection on MongoDB at `docdb.connorrhodes.com:35563`. Each document has a `created_at` field in `YYMMDD-HHMM` format, along with `title`, `summary`, `tags`, `content`, and `status` fields. Some older documents may not have a `created_at` value.
|
||||
|
||||
## Steps
|
||||
|
||||
### 1. Determine the date
|
||||
|
||||
If the user says "today", use today's date. If they specify a date, use that. Convert it to the `YYMMDD` prefix format used in filenames.
|
||||
If the user says "today", use today's date. If they specify a date, use that. Convert it to the `YYMMDD` prefix format used in the `created_at` field.
|
||||
|
||||
### 2. Find all matching files
|
||||
### 2. Query MongoDB for matching documents
|
||||
|
||||
Use `fd <YYMMDD> Inbox/voice_notes` to find every voice note file matching that date. This searches all subdirectories at once and returns the full picture.
|
||||
Use the mongodb skill to run a query against `notes.dictations`. Use a regex on `created_at` to match the date prefix:
|
||||
|
||||
### 3. Read every file
|
||||
```python
|
||||
collection.find({"created_at": {"$regex": "^260421"}}).sort("created_at", 1)
|
||||
```
|
||||
|
||||
Read the contents of every file found. Do not skip any. If there are many files, read them all in parallel.
|
||||
Sort by `created_at` ascending so notes appear in chronological order. If the user wants all notes (no date filter), omit the regex and just sort by `created_at`.
|
||||
|
||||
### 3. Read every document
|
||||
|
||||
Process all matching documents. Each document already has a `title` and `summary` field generated by the inference pipeline, so you have a head start. If there are many documents, process them all in parallel.
|
||||
|
||||
### 4. Present a numbered table
|
||||
|
||||
Create a markdown table with these columns:
|
||||
|
||||
| # | File | Folder | One-line Summary |
|
||||
| # | Time | Tags | Title | Summary |
|
||||
|
||||
- **#**: Sequential number (1, 2, 3...)
|
||||
- **File**: The `YYMMDD-HHMM` prefix plus the descriptive part of the filename (not the full path)
|
||||
- **Folder**: The subdirectory it was found in (e.g., `unprocessed`, `journal_box`, `zk`)
|
||||
- **One-line Summary**: A concise summary of what the voice note contains
|
||||
- **Time**: The `YYMMDD-HHMM` value from `created_at` (or "undated" if missing)
|
||||
- **Tags**: The document's `tags` list (comma-separated)
|
||||
- **Title**: The `title` field
|
||||
- **Summary**: A concise one-line summary (use the existing `summary` field, shortened if needed)
|
||||
|
||||
### 5. Wait for the user to pick
|
||||
|
||||
|
|
@ -51,18 +58,20 @@ After presenting the table, ask: "Which ones do you want me to act on?"
|
|||
|
||||
When the user gives you numbers, reduce the table to only those items and ask what they want done. Common actions:
|
||||
|
||||
- **Move/categorize**: Move a note from `unprocessed/` to the appropriate folder (`project_ideas/`, `zk/`, `journal_box/`, etc.)
|
||||
- **Extract action items**: Pull out tasks, follow-ups, or messages from the note
|
||||
- **Draft messages**: Write clean versions of dictated messages
|
||||
- **Create tasks**: Turn the note into Vikunja tasks or other task items
|
||||
- **Summarize**: Produce a polished summary for meeting notes or journal entries
|
||||
- **Combine**: Merge multiple related notes into a single document
|
||||
- **Retag**: Update the `tags` field on the document in MongoDB
|
||||
- **Delete**: Remove the document from the database (ask for confirmation first)
|
||||
|
||||
Do not act without the user specifying what to do. If they just give numbers, show the reduced table and ask what action they want.
|
||||
|
||||
## Constraints
|
||||
|
||||
- Never skip files. If `fd` returns 15 files, the table must have 15 rows.
|
||||
- Keep one-line summaries concise; the user can ask for detail on specific items.
|
||||
- Never skip documents. If the query returns 15 documents, the table must have 15 rows.
|
||||
- Keep summaries concise; the user can ask for detail on specific items (at which point read the full `content` field).
|
||||
- If the user asks to reduce the table to specific numbers (e.g., "reduce to 4, 6, 9"), show only those rows before asking what to do next.
|
||||
- Do not assume the date is today unless the user says "today" or similar.
|
||||
- Use the mongodb skill for all database operations (connection, querying, updates).
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue