Execute research workflow orchestration - processes pending research tasks sequentially
Execute the research workflow end-to-end, processing pending research tasks sequentially.
This orchestrator command:
/bookstrap-research-path
/bookstrap-research-path --max-tasks 5
/bookstrap-research-path --priority high
/bookstrap-research-path --gap-id gap_123
SELECT * FROM task
WHERE type = 'research'
AND status = 'pending'
ORDER BY priority DESC, created_at ASC
LIMIT $max_tasks;
TaskUpdate: {taskId: "[task-id]", status: "in_progress"}
Skill: {skill: "researcher", args: "--task-id [task-id]"}
The researcher agent will:
After researcher completes, verify the gap was adequately resolved:
from scripts.researcher_methods import ResearcherMethods
verification_queries = [
{
'query': "SELECT * FROM source WHERE id = $source_id",
'min_results': 1,
'description': 'Source was created'
},
{
'query': "SELECT * FROM chunk WHERE source = $source_id",
'min_results': 3,
'description': 'Sufficient chunks created'
},
{
'query': "SELECT * FROM [character, location, event, concept] WHERE ->supports<-source.id = $source_id",
'min_results': 1,
'description': 'Entities extracted'
}
]
is_resolved, issues = researcher.verify_gap_resolution(gap_id, verification_queries)
If verification passes:
TaskUpdate: {taskId: "[task-id]", status: "completed"}
If verification fails:
TaskUpdate: {taskId: "[task-id]", status: "blocked", metadata: {issues: [...]}}
After processing all tasks, report:
RESEARCH PATH COMPLETE
======================
Tasks processed: [count]
Tasks completed: [count]
Tasks blocked: [count]
Total sources ingested: [count]
Total entities extracted: [count]
Knowledge gaps resolved: [count]
NEXT STEPS
----------
- Run /bookstrap-status to see updated project state
- Run /bookstrap-plan-write to generate writing tasks
- Run /bookstrap-write to begin writing grounded in new research
If a research task cannot be completed:
blocked with reasonIf search API rate limit hit:
If no reliable sources found after thorough search:
Respects settings from bookstrap.config.json:
{
"orchestration": {
"research_path": {
"max_tasks_per_run": 10,
"require_verification": true,
"continue_on_error": true,
"min_source_reliability": "medium"
}
}
}
Starting research path orchestration...
Processing task 1 of 3: "SOE training protocols 1943"
āā Searching for sources...
āā Found 3 candidate sources
āā Evaluating reliability...
āā Ingesting: "The Secret History of SOE" (high reliability)
āā Extracting entities... 12 entities found
āā Creating relationships... 8 relationships created
āā Verifying gap resolution... PASSED
āā Task completed ā
Processing task 2 of 3: "Wireless operator equipment specifications"
āā Searching for sources...
āā Found 1 candidate source
āā Evaluating reliability...
āā Ingesting: "SOE Equipment Manual 1943" (high reliability)
āā Extracting entities... 5 entities found
āā Creating relationships... 3 relationships created
āā Verifying gap resolution... PASSED
āā Task completed ā
Processing task 3 of 3: "French resistance network structure Lyon"
āā Searching for sources...
āā Found 0 reliable sources
āā Task marked as BLOCKED
āā Reason: No sources found meeting reliability threshold
RESEARCH PATH COMPLETE
======================
Tasks processed: 3
Tasks completed: 2
Tasks blocked: 1
Total sources ingested: 2
Total entities extracted: 17
Knowledge gaps resolved: 2
BLOCKED TASKS
-------------
- Task 3: "French resistance network structure Lyon"
Reason: No sources found meeting reliability threshold
Suggestion: Try more specific search terms or lower reliability threshold
NEXT STEPS
----------
Run /bookstrap-plan-write to generate writing tasks using new research
/bookstrap-plan-research - Generate research tasks to feed this orchestrator/bookstrap-status - Check updated corpus state/bookstrap-query - Verify specific knowledge is now available/bookstrap-plan-write - Generate writing tasks grounded in research/bookstrap-write - Begin writing with full knowledge coverageThis orchestrator is implemented as a skill that:
TaskList to find pending research tasksresearcher agent skill for each taskresearcher_methods.py for verificationTaskUpdateThe orchestrator does NOT run research itself - it coordinates the researcher agent.