Clean up agent catalog and improve extraction agent prompts

- Remove unused config_schema from AgentCatalogItem (schema + route)
- Fix agent_setup system prompt: add extraction agent base behaviour
  context so journey LLM knows what is already handled and focuses on
  field mappings only; remove redundant data-types question (already
  known from user selection); derive data types list dynamically
- Rewrite processing base prompt to use actual tool names
  (list_tasks, update_task, add_task_comment, list_notes, update_note,
  list_timelines, update_timeline, list_all_projects, create_project)
  and enforce update-first strategy before falling back to creation

Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
This commit is contained in:
Roberto Musso
2026-03-17 23:52:54 +01:00
parent 87b7a1c6c9
commit 5a03bd1cfb
4 changed files with 47 additions and 34 deletions

View File

@@ -89,6 +89,14 @@ Your job is to understand exactly what data the user wants to extract from their
local directory and produce a detailed prompt_template that a separate AI will use
as its instruction set.
The extraction agent already has this base behaviour built in:
- Reads each file using file-system tools.
- Creates records (tasks, notes, timelines, projects) via CRUD tools.
- Sets isAiSuggested=1 and isApproved=0 on every record.
- Only extracts data explicitly present in the files — it never invents information.
The user's custom prompt is appended AFTER this base behaviour, so focus on
what to look for and how to map it — not on the general extraction mechanics.
You have access to file-system tools to explore the user's directory:
- list_directory: to see folder structure
- read_file_content: to peek at file contents
@@ -100,10 +108,9 @@ Target data types: {data_types}
Start by exploring the directory to understand its structure. Then ask concise,
focused questions one at a time. Cover these topics (not necessarily in this order):
1. The type and format of the source content (confirmed by your exploration).
2. Which data types to extract: tasks, notes, timelines, and/or projects.
3. How fields should be mapped (e.g. filename → task title).
4. Priority or status rules (e.g. "urgent" keyword → high priority).
5. Any special handling, date extraction, or exclusions.
2. How fields should be mapped (e.g. filename → task title).
3. Priority or status rules (e.g. "urgent" keyword → high priority).
4. Any special handling, date extraction, or exclusions.
After 3-5 questions (when you have enough information), output the final prompt_template
between these exact markers on their own lines:

View File

@@ -121,24 +121,6 @@ async def get_agent_catalog(
type="local_directory",
name="Local Directory Monitor",
description="Watches local directories, extracts data from files using AI",
config_schema={
"directory": {"type": "string", "required": True},
"what_to_extract": {
"type": "array",
"items": ["task", "note", "timeline", "project"],
"required": True,
},
"actions_by_type": {
"type": "object",
"example": {
"task": ["add", "update"],
"note": ["add", "update"],
},
"required": False,
},
"batch_interval": {"type": "string", "required": True},
"custom_agent_prompt": {"type": "string", "required": True},
},
),
AgentCatalogItem(
type="gmail",