Source: www.producthunt.com/products/contextgem
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.
Get stories like this every weekday
One short email with the day's agent tooling news.