 # ContextGem: Effortless LLM extraction from documents | | | |----------|--------| | **Package** | [](https://pypi.org/project/contextgem/) [](https://pepy.tech/projects/contextgem) [](https://www.python.org/downloads/) [](https://opensource.org/licenses/Apache-2.0) | | **Quality** | [](https://github.com/shcherbak-ai/contextgem/actions/workflows/ci-tests.yml) [](https://github.com/shcherbak-ai/contextgem/actions) [](https://github.com/shcherbak-ai/contextgem/actions/workflows/codeql.yml) [](https://github.com/shcherbak-ai/contextgem/actions/workflows/licenseal.yml) [](https://github.com/PyCQA/bandit) [](https://www.bestpractices.dev/projects/10489) | | **Tools** | [](https://github.com/astral-sh/uv) [](https://github.com/astral-sh/ruff) [](https://pydantic.dev) [](https://github.com/astral-sh/ty) [](https://github.com/pre-commit/pre-commit) [](https://github.com/fpgmaas/deptry) [](https://github.com/shcherbak-ai/tethered) [](https://github.com/pypa/hatch) | | **Docs** | [](https://github.com/shcherbak-ai/contextgem/actions/workflows/docs.yml) [](https://shcherbak-ai.github.io/contextgem/)  [](https://deepwiki.com/shcherbak-ai/contextgem) | | **Community** | [](CODE_OF_CONDUCT.md) [](https://github.com/shcherbak-ai/contextgem/issues?q=is%3Aissue+is%3Aclosed) [](https://github.com/shcherbak-ai/contextgem/commits/main) |
| ✨ Automated dynamic prompts | 📐 Automated data modelling | 📍 Granular reference mapping |
| 💭 Built-in justifications | 🪆 Nested context extraction | 🔗 Unified declarative pipeline |
| 📄 Document |
|---|
| Create a Document that contains text and/or visual content representing your document (contract, invoice, report, CV, etc.), from which an LLM extracts information (aspects and/or concepts). Learn more |
| 🔍 Aspects | 💡 Concepts |
|---|---|
| Define Aspects to extract text segments from the document (sections, topics, themes). You can organize content hierarchically and combine with concepts for comprehensive analysis. Learn more | Define Concepts to extract specific data points with intelligent inference: entities, insights, structured objects, classifications, numerical calculations, dates, ratings, and assessments. Learn more |
| 🔄 Alternative: Configure Extraction Pipeline |
|---|
| Create a reusable collection of predefined aspects and concepts that enables consistent extraction across multiple documents. Learn more |
| 🤖 LLM | 🤖🤖 Alternative: LLM Group (advanced) |
|---|---|
| Configure a cloud or local LLM that will extract aspects and/or concepts from the document. DocumentLLM supports fallback models and role-based task routing for optimal performance. Learn more | Configure a group of LLMs with unique roles for complex extraction workflows. You can route different aspects and/or concepts to specialized LLMs (e.g., simple extraction vs. reasoning tasks). Learn more |