You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Copy file name to clipboardExpand all lines: README.md
+129Lines changed: 129 additions & 0 deletions
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -123,6 +123,135 @@ And force a re-index:
123
123
Meadow.Data.Indexer.reindex_all()
124
124
```
125
125
126
+
### AI Agent Plans
127
+
128
+
Meadow supports AI agent-generated plans for batch modifications to works. The system uses a two-table structure that allows agents to propose work-specific changes based on high-level prompts.
129
+
130
+
#### Data Model
131
+
132
+
**Plans** - High-level task definitions
133
+
-`prompt`: Natural language instruction (e.g., "Add a date_created EDTF string for the work based on the work's existing description, creator, and temporal subjects")
134
+
-`query`: OpenSearch query string identifying target works
135
+
- Collection query: `"collection.id:abc-123"`
136
+
- Specific works: `"id:(work-id-1 OR work-id-2 OR work-id-3)"`
137
+
-`status`: `:pending`, `:approved`, `:rejected`, `:executed`, or `:error`
138
+
139
+
**PlanChanges** - Work-specific modifications
140
+
-`plan_id`: Foreign key to parent plan
141
+
-`work_id`: Specific work being modified
142
+
-`add`: Map of values to append to existing work data
143
+
-`delete`: Map of values to remove from existing work data
144
+
-`replace`: Map of values to fully replace in work data
145
+
-`status`: Individual approval/rejection tracking
146
+
147
+
Each PlanChange must specify at least one operation (`add`, `delete`, or `replace`).
148
+
149
+
#### PlanChange payloads
150
+
151
+
-`add` merges values into existing metadata. For lists (like subjects or notes) the values are appended when they are not already present. Scalar fields (e.g., `title`) are merged according to the context (`:append` for `add`, `:replace` for `replace`).
152
+
-`delete` removes the provided values verbatim. For controlled vocabularies this means the JSON structure must match what is stored in the database (role/term maps). The planner normalizes structs and string-keyed maps automatically when executing changes.
153
+
-`replace` overwrites existing values for the provided keys. Use this when the existing content should be replaced entirely instead of appended or removed.
154
+
155
+
Controlled metadata entries (subjects, creators, contributors, etc.) follow the shape below. For subjects you must supply both the `role` (with at least `id`/`scheme`) and the `term.id`; extra fields such as `label` or `variants` are ignored during execution but can be included when working with structs in IEx:
When constructing PlanChanges you can mix-and-match operations as needed. For example, to remove an outdated subject and add a new one in a single change:
### Doing development on the Meadow Pipeline lambdas
127
256
128
257
In the AWS developer environment, the lambdas associated with the pipeline are shared amongst developers. In order to do development and see whether it's working you can override the configuration to use your local files instead of the deployed lambdas. Example below (you don't have to override them all. Just the ones you need).
0 commit comments