Replace Arbitrator Workflow with Agentic Badgerdoc Agent Workflow
- Dominant language
- Python
- Stars
- 44
- Forks
- 52
- PR merge metrics
- No merged PRs in 30d
Description
Current Badgerdoc functionality relies on the Arbitrator workflow where a user manually selects and executes predefined operations on extractions.
The target architecture is to introduce a new Badgerdoc Agent workflow that acts as an intelligent orchestration layer and is fully compatible with agentic execution patterns. The workflow should analyze user intent, identify suitable registered workflows (agents), create an execution plan, delegate work, monitor execution, and generate resulting extractions.
The Badgerdoc Agent becomes the single entry point for all document-processing tasks.
The implementation should follow an Orchestrator → Worker Agent architecture where the Badgerdoc Agent acts as the orchestrator and existing workflows become specialized worker agents. This approach aligns with established agentic workflow patterns where an orchestrator plans and delegates work to independent execution agents.
### Provide a unified AI-driven workflow that
- Accepts natural language instructions from users.
- Understands task intent without requiring manual workflow selection.
- Automatically discovers and executes appropriate Badgerdoc workflows.
- Supports multi-step execution plans.
- Produces new extractions as workflow outputs.
- Enables future expansion with new agent types without UI or orchestration changes.
## Functional Requirements
### Unified Agent Workflow
The workflow must accept:
- User prompt
- Document context (optional)
- Page context (optional)
- Extraction context (optional)
- Extraction block context (optional)
### Intent Understanding
The Badgerdoc Agent must analyze the user request and determine:
- What the user wants to do
- Which workflows are required
- What execution steps are needed
**Examples:**
- Extract data
- Validate extraction
- Summarize content
- Compare information
- Perform calculations
### Workflow Discovery
- Badgerdoc Agent must automatically discover available workflows registered in the system.
- Every workflow must expose description.
- Workflow selection should be based on descriptions and capabilities, without hardcoded mappings.
### Planning and Delegation
Before execution, the Badgerdoc Agent should:
- Analyze the request
- Build an execution plan
- Select required workflows
- Define execution order
- Delegate tasks to selected workflows
### Workflow Execution
The Badgerdoc Agent must:
- Execute selected workflows
- Pass outputs between workflows when needed
- Wait for execution completion
- Handle execution errors
### Result Generation
After execution:
- Collect workflow outputs
- Generate a final response
- Create a new extraction with the result
## UI Changes
**Replace Arbitrator UI**
- Remove Arbitrator-specific tabs
- Introduce a single Badgerdoc Agent tab
**Extraction Selector**
Replace extraction tabs with a dropdown selector that allows users to:
- Select extraction
- Switch between extractions
- View extraction details
**Execution Progress**
Provide execution visibility during workflow execution:
- Loading spinner
- Progress bar
- Current execution stage
- Success/failure status
Example:
- Planning...
- Running Extraction Agent...
- Running Validation Agent...
- Completed
## Python code execution
Add support for generating and executing Python code in a secure sandbox environment.
Use cases:
- Calculations
- Data transformations
- Table processing
- Custom document analysis
**Requirements**
- Sandboxed execution
- Timeouts
- Resource limits
- Error handling
Contributor guide
No contributing guide indexed for this repository
Research direction
The issue names the Arbitrator workflow and UI, the Badgerdoc Agent, existing workflows, and a secure Python execution sandbox, but no files, tests, or entry points. Start by locating the current Arbitrator workflow and its UI, then map how workflows are registered and executed. Done means the unified agent can plan and delegate work, produce extractions, replace the Arbitrator UI, and run sandboxed Python with limits and error handling.
Written by the indexing model from the issue text.
Assessment
- Tech stack
- python
- Domain
- ai, backend-api-design, frontend, security
- Issue type
- Feature
- Difficulty
- 5/5
- Estimated time
- Over a week
- Activity status
- Quiet
- Clarity
- Mostly clear
- Newbie friendliness
- 25/100