Metadata-Version: 2.5
Name: contextgem
Version: 1.0.0
Summary: Extract structured data and insights from documents using LLMs and decision models
Project-URL: Homepage, https://github.com/shcherbak-ai/contextgem
Project-URL: Documentation, https://contextgem.shcherbak.ai/
Project-URL: Repository, https://github.com/shcherbak-ai/contextgem.git
Project-URL: Bug Tracker, https://github.com/shcherbak-ai/contextgem/issues
Project-URL: Changelog, https://github.com/shcherbak-ai/contextgem/blob/main/CHANGELOG.md
Project-URL: Shcherbak AI, https://shcherbak.ai/
Author-email: Sergii Shcherbak <sergii@shcherbak.ai>
Maintainer-email: Shcherbak AI <sergii@shcherbak.ai>
License: Apache-2.0
License-File: LICENSE
License-File: NOTICE
Keywords: artificial-intelligence,aspect-extraction,automated-prompting,concept-extraction,content-extraction,context-aware,contextgem,contract-analysis,contract-automation,contract-intelligence,contract-management,contract-parsing,contract-review,data-extraction,decision-models,document,document-analysis,document-extraction,document-intelligence,document-parsing,document-pipeline,document-processing,document-qa,document-understanding,entity-extraction,extraction-justifications,extraction-pipeline,fintech,generative-ai,information-extraction,insights-extraction,knowledge-extraction,large-language-models,legaltech,llm,llm-extraction,llm-framework,llm-library,llm-reasoning,low-code,machine-learning,model-routing,multilingual,multimodal,neural-segmentation,nlp,no-prompt-engineering,prompt-free,question-answering,reference-mapping,semantic-analysis,structured-data,structured-data-extraction,text-analysis,text-classification,text-processing,topic-extraction,unstructured-data,zero-shot
Classifier: Development Status :: 5 - Production/Stable
Classifier: Intended Audience :: Developers
Classifier: Intended Audience :: Education
Classifier: Intended Audience :: Financial and Insurance Industry
Classifier: Intended Audience :: Information Technology
Classifier: Intended Audience :: Legal Industry
Classifier: Intended Audience :: Science/Research
Classifier: License :: OSI Approved :: Apache Software License
Classifier: Operating System :: OS Independent
Classifier: Programming Language :: Python :: 3
Classifier: Programming Language :: Python :: 3.11
Classifier: Programming Language :: Python :: 3.12
Classifier: Programming Language :: Python :: 3.13
Classifier: Programming Language :: Python :: 3.14
Classifier: Topic :: Education
Classifier: Topic :: Office/Business
Classifier: Topic :: Scientific/Engineering :: Artificial Intelligence
Classifier: Topic :: Scientific/Engineering :: Image Recognition
Classifier: Topic :: Scientific/Engineering :: Information Analysis
Classifier: Topic :: Software Development :: Libraries :: Application Frameworks
Classifier: Topic :: Software Development :: Libraries :: Python Modules
Classifier: Topic :: Text Processing :: General
Classifier: Topic :: Text Processing :: Linguistic
Requires-Python: <3.15,>=3.11
Requires-Dist: aiolimiter<2.0.0,>=1.2.1
Requires-Dist: colorlog<7.0.0,>=6.9.0
Requires-Dist: docstring-parser<1.0.0,>=0.17.0
Requires-Dist: fastjsonschema<3.0.0,>=2.21.2
Requires-Dist: genai-prices==0.1.13
Requires-Dist: jinja2<4.0.0,>=3.1.5
Requires-Dist: litellm==1.105.1
Requires-Dist: onnxruntime>=1.24.0; python_version >= '3.14'
Requires-Dist: openai==2.54.0
Requires-Dist: pillow<13.0.0,>=11.3.0
Requires-Dist: pydantic<3.0.0,>=2.10.6
Requires-Dist: python-ulid<5.0.0,>=3.0.0
Requires-Dist: tenacity<10.0.0,>=9.1.2
Requires-Dist: wtpsplit-lite<0.3.0,>=0.2.0
Description-Content-Type: text/markdown

# ContextGem

Describe, don't prompt. ContextGem is a free, open-source framework that does the work around the models for you: you describe what to extract, and it handles the prompts, the data models, the source references and the justifications, with minimal code.

**Upgrading from 0.x?** ContextGem 1.0 renames and removes classes and parameters, changes some defaults and drops Python 3.10, so code and serialized data written for 0.x may need changes. Follow the [migration guide](https://contextgem.shcherbak.ai/migration_v1/).

```bash
uv add contextgem
```

Or, with pip: `pip install -U contextgem`.

- Generates the prompts from your descriptions of what to extract: there are no prompts to write.
- Returns typed, validated values: text, numbers, dates, booleans, labels, ratings and JSON objects.
- Maps each extracted item back to the paragraphs or sentences of the document that it came from, and can give the reasoning behind it.
- Extracts in context: aspects, sub-aspects and concepts focus the model on the text that matters.
- Runs as one declarative pipeline, reusable and serializable, with model routing, fallbacks and cost tracking.
- Uses the right model for each question: cloud and local LLMs through LiteLLM where it takes reasoning, and decision models where a fast, low-cost answer is enough.
- Gives the probability of each possible answer of a decision model, so that you set the threshold.
- Is built for in-depth analysis of individual documents, not for cross-document querying or corpus-wide retrieval.

See the [documentation](https://contextgem.shcherbak.ai) for the [quickstart](https://contextgem.shcherbak.ai/quickstart/), [how it works](https://contextgem.shcherbak.ai/how_it_works/) and [decision models](https://contextgem.shcherbak.ai/decision_models/decision_models/), the [repository](https://github.com/shcherbak-ai/contextgem#readme) for the overview and the source, and the [changelog](https://github.com/shcherbak-ai/contextgem/blob/main/CHANGELOG.md) for the version history.

Licensed under [Apache-2.0](https://github.com/shcherbak-ai/contextgem/blob/main/LICENSE).
