Hi @RohitR311 and @amhsirak,
This is Jesse from Piranavan CodeDay group and this is my proposal for my next contribution.
Background
Document extraction robots currently pass the user’s Extraction Prompt directly to the LLM. In practice, many LLMs — especially local models like Ollama — struggle with strict schemas, drift into conversational output, or hallucinate structure unless the prompt is extremely rigid. I ran into several of these issues myself while testing Ollama with the Document Extraction robot.
This proposal introduces a backend‑level wrapping pattern that enforces consistent, deterministic extraction across all supported LLMs, regardless of user prompt quality or model behavior.
Actual Result (current Behavior)
Here i fed a PDF to extraction bot and provided a simple extraction prompt mimicing the suggested format
provided in the extraction box Prompt e.g. "Extract invoice number, vendor name, total amount, and line items"
results were unsatisfactory.
Expected Result (Prompt Orchastration)
With a highly technical prompt wrapper I fed the same document/user instruction and recieved desierable results.
Proposed Fix
In-Scope
- Add backend prompt wrapper
- Add capability detection layer
- Add configurable schema enforcement toggle
- Add wrapped-prompt fallback mode
- Add minimal JSON-repair fallback
- Apply only to Document Extract robots
- Support all current extraction file types
Future Possibilities
- Multi-model auto-fallback chains.
- Automatic JSON repair logic.
Hi @RohitR311 and @amhsirak,
This is Jesse from Piranavan CodeDay group and this is my proposal for my next contribution.
Background
Document extraction robots currently pass the user’s Extraction Prompt directly to the LLM. In practice, many LLMs — especially local models like Ollama — struggle with strict schemas, drift into conversational output, or hallucinate structure unless the prompt is extremely rigid. I ran into several of these issues myself while testing Ollama with the Document Extraction robot.
This proposal introduces a backend‑level wrapping pattern that enforces consistent, deterministic extraction across all supported LLMs, regardless of user prompt quality or model behavior.
Actual Result (current Behavior)
Here i fed a PDF to extraction bot and provided a simple extraction prompt mimicing the suggested format
provided in the extraction box Prompt
e.g. "Extract invoice number, vendor name, total amount, and line items"results were unsatisfactory.
Expected Result (Prompt Orchastration)
With a highly technical prompt wrapper I fed the same document/user instruction and recieved desierable results.
Proposed Fix
In-Scope
Future Possibilities