# ContextGem 1.0 adds decision models for closed questions in document extraction

published: 2026-10-27T18:05:42.914Z
topic: frameworks
source: https://www.producthunt.com/products/contextgem
url: https://aiagentnews.io/stories/contextgem-1-0-adds-decision-models-for-closed-questions-in-document-extraction

ContextGem 1.0, an open-source Python framework for extracting data from documents, lets developers pair LLMs with decision models that answer closed questions. The release also adds Docling-based file handling and tools for agents.

ContextGem is a free Python framework released under Apache 2.0. Developers describe the data they want from a document in plain language, and the framework generates the prompts, validates the output into typed values and links each extracted fact to the paragraph or sentence it came from.

Version 1.0 introduces decision models alongside LLMs. A decision model answers closed questions such as yes-or-no, a label or a point on a scale, returning the probability of each possible answer without generating text. A model group routes open questions to an LLM and closed ones to a decision model, and any model can fall back on others.

Other additions include Docling support, which lets ContextGem start from PDFs, scanned PDFs, Office files, email, images, audio and video. Agent-facing features cover extracting metadata as documents arrive and calling an extraction from an agent's tool. The framework works with LLMs through LiteLLM and with decision models from TypeSafe, OpenAI, Microsoft Foundry or a self-hosted server.

## Why it matters if you build agents

Teams running high-volume classification can send yes-or-no and label questions to a decision model, which the maker describes as fast and low-cost, and keep an LLM for open-ended questions. Because every extracted fact is traced to its source passage, results are easier to check. ContextGem reads one document in depth and does not search across a corpus, so a retrieval layer is still needed for multi-document lookups.
