groundworkers 0.11.0__tar.gz → 0.12.0__tar.gz
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- {groundworkers-0.11.0 → groundworkers-0.12.0}/PKG-INFO +1 -2
- {groundworkers-0.11.0 → groundworkers-0.12.0}/config/groundworkers.example.toml +0 -3
- {groundworkers-0.11.0 → groundworkers-0.12.0}/docs/architecture.md +0 -4
- {groundworkers-0.11.0 → groundworkers-0.12.0}/docs/concepts.md +2 -10
- {groundworkers-0.11.0 → groundworkers-0.12.0}/docs/development/integration.md +14 -0
- {groundworkers-0.11.0 → groundworkers-0.12.0}/docs/from-scratch.md +1 -1
- {groundworkers-0.11.0 → groundworkers-0.12.0}/docs/index.md +1 -1
- {groundworkers-0.11.0 → groundworkers-0.12.0}/docs/reference/ref_services.md +0 -6
- {groundworkers-0.11.0 → groundworkers-0.12.0}/docs/reference/ref_tools.md +0 -4
- {groundworkers-0.11.0 → groundworkers-0.12.0}/docs/services/grounding.md +5 -1
- {groundworkers-0.11.0 → groundworkers-0.12.0}/docs/services/vocab.md +6 -0
- {groundworkers-0.11.0 → groundworkers-0.12.0}/docs/tools/overview.md +3 -5
- {groundworkers-0.11.0 → groundworkers-0.12.0}/docs/tools/search.md +23 -0
- {groundworkers-0.11.0 → groundworkers-0.12.0}/docs/usage/configuration.md +1 -20
- {groundworkers-0.11.0 → groundworkers-0.12.0}/docs/usage/integrations.md +1 -9
- {groundworkers-0.11.0 → groundworkers-0.12.0}/mkdocs.yaml +0 -2
- {groundworkers-0.11.0 → groundworkers-0.12.0}/pyproject.toml +0 -1
- {groundworkers-0.11.0 → groundworkers-0.12.0}/src/groundworkers/adapters/_omop_graph_ancestry.py +12 -0
- {groundworkers-0.11.0 → groundworkers-0.12.0}/src/groundworkers/adapters/omop_emb.py +56 -0
- {groundworkers-0.11.0 → groundworkers-0.12.0}/src/groundworkers/adapters/omop_graph.py +9 -0
- {groundworkers-0.11.0 → groundworkers-0.12.0}/src/groundworkers/app.py +9 -2
- {groundworkers-0.11.0 → groundworkers-0.12.0}/src/groundworkers/base/ancestry.py +2 -1
- groundworkers-0.12.0/src/groundworkers/base/concept_ids.py +3 -0
- {groundworkers-0.11.0 → groundworkers-0.12.0}/src/groundworkers/config.py +0 -11
- {groundworkers-0.11.0 → groundworkers-0.12.0}/src/groundworkers/server.py +0 -6
- groundworkers-0.12.0/src/groundworkers/services/answer_grounding.py +167 -0
- {groundworkers-0.11.0 → groundworkers-0.12.0}/src/groundworkers/services/domain.py +1 -4
- {groundworkers-0.11.0 → groundworkers-0.12.0}/src/groundworkers/services/graph.py +4 -0
- {groundworkers-0.11.0 → groundworkers-0.12.0}/src/groundworkers/services/grounding.py +94 -92
- {groundworkers-0.11.0 → groundworkers-0.12.0}/src/groundworkers/services/mapping.py +10 -4
- {groundworkers-0.11.0 → groundworkers-0.12.0}/src/groundworkers/services/vocab.py +204 -1
- {groundworkers-0.11.0 → groundworkers-0.12.0}/src/groundworkers/tools/concept_tools.py +10 -9
- {groundworkers-0.11.0 → groundworkers-0.12.0}/src/groundworkers/tools/embedding_tools.py +2 -1
- {groundworkers-0.11.0 → groundworkers-0.12.0}/src/groundworkers/tools/resolver_tools.py +19 -4
- {groundworkers-0.11.0 → groundworkers-0.12.0}/src/groundworkers/tools/search_tools.py +2 -1
- {groundworkers-0.11.0 → groundworkers-0.12.0}/src/groundworkers/toolsets.py +0 -2
- {groundworkers-0.11.0 → groundworkers-0.12.0}/tests/conftest.py +33 -0
- {groundworkers-0.11.0 → groundworkers-0.12.0}/tests/support/agent_surface_reference.json +39 -22
- {groundworkers-0.11.0 → groundworkers-0.12.0}/tests/support/toolset_profiles.json +1 -2
- {groundworkers-0.11.0 → groundworkers-0.12.0}/tests/support/toolsets.json +0 -4
- {groundworkers-0.11.0 → groundworkers-0.12.0}/tests/test_agent_surface.py +0 -1
- {groundworkers-0.11.0 → groundworkers-0.12.0}/tests/unit/test_ancestry_mcp_contract.py +2 -0
- groundworkers-0.12.0/tests/unit/test_answer_grounding.py +324 -0
- {groundworkers-0.11.0 → groundworkers-0.12.0}/tests/unit/test_concept_tools.py +18 -4
- {groundworkers-0.11.0 → groundworkers-0.12.0}/tests/unit/test_grounding_constraints.py +8 -8
- {groundworkers-0.11.0 → groundworkers-0.12.0}/tests/unit/test_toolsets.py +1 -6
- {groundworkers-0.11.0 → groundworkers-0.12.0}/tests/unit/test_vocab_service.py +22 -1
- groundworkers-0.12.0/tests/unit/test_vocabulary_facts.py +75 -0
- {groundworkers-0.11.0 → groundworkers-0.12.0}/uv.lock +0 -174
- groundworkers-0.11.0/docs/services/semantic_projection.md +0 -153
- groundworkers-0.11.0/docs/tools/semantic_projection.md +0 -127
- groundworkers-0.11.0/src/groundworkers/services/semantic_projection/__init__.py +0 -25
- groundworkers-0.11.0/src/groundworkers/services/semantic_projection/definitions.py +0 -319
- groundworkers-0.11.0/src/groundworkers/services/semantic_projection/models.py +0 -80
- groundworkers-0.11.0/src/groundworkers/services/semantic_projection/service.py +0 -147
- groundworkers-0.11.0/src/groundworkers/tools/semantic_projection_tools.py +0 -79
- groundworkers-0.11.0/tests/unit/test_semantic_projection_service.py +0 -333
- groundworkers-0.11.0/tests/unit/test_semantic_projection_tools.py +0 -119
- {groundworkers-0.11.0 → groundworkers-0.12.0}/.githooks/pre-commit +0 -0
- {groundworkers-0.11.0 → groundworkers-0.12.0}/.github/CONTRIBUTING.md +0 -0
- {groundworkers-0.11.0 → groundworkers-0.12.0}/.github/ISSUE_TEMPLATE/bug_report.yml +0 -0
- {groundworkers-0.11.0 → groundworkers-0.12.0}/.github/ISSUE_TEMPLATE/config.yml +0 -0
- {groundworkers-0.11.0 → groundworkers-0.12.0}/.github/ISSUE_TEMPLATE/feature_request.yml +0 -0
- {groundworkers-0.11.0 → groundworkers-0.12.0}/.github/ISSUE_TEMPLATE/not_working.yml +0 -0
- {groundworkers-0.11.0 → groundworkers-0.12.0}/.github/PULL_REQUEST_TEMPLATE.md +0 -0
- {groundworkers-0.11.0 → groundworkers-0.12.0}/.github/release-drafter.yml +0 -0
- {groundworkers-0.11.0 → groundworkers-0.12.0}/.github/workflows/ci.yml +0 -0
- {groundworkers-0.11.0 → groundworkers-0.12.0}/.github/workflows/docs.yml +0 -0
- {groundworkers-0.11.0 → groundworkers-0.12.0}/.github/workflows/merge.yml +0 -0
- {groundworkers-0.11.0 → groundworkers-0.12.0}/.github/workflows/publish.yml +0 -0
- {groundworkers-0.11.0 → groundworkers-0.12.0}/.gitignore +0 -0
- {groundworkers-0.11.0 → groundworkers-0.12.0}/.python-version +0 -0
- {groundworkers-0.11.0 → groundworkers-0.12.0}/CHANGELOG.md +0 -0
- {groundworkers-0.11.0 → groundworkers-0.12.0}/Makefile +0 -0
- {groundworkers-0.11.0 → groundworkers-0.12.0}/README.md +0 -0
- {groundworkers-0.11.0 → groundworkers-0.12.0}/config/docker-compose.yaml +0 -0
- {groundworkers-0.11.0 → groundworkers-0.12.0}/config/groundworkers.duckdb.example.toml +0 -0
- {groundworkers-0.11.0 → groundworkers-0.12.0}/config/groundworkers_db.env +0 -0
- {groundworkers-0.11.0 → groundworkers-0.12.0}/docs/adapters/ancestry.md +0 -0
- {groundworkers-0.11.0 → groundworkers-0.12.0}/docs/adapters/cdm.md +0 -0
- {groundworkers-0.11.0 → groundworkers-0.12.0}/docs/adapters/omop_emb.md +0 -0
- {groundworkers-0.11.0 → groundworkers-0.12.0}/docs/adapters/omop_graph.md +0 -0
- {groundworkers-0.11.0 → groundworkers-0.12.0}/docs/demo.md +0 -0
- {groundworkers-0.11.0 → groundworkers-0.12.0}/docs/development/extending.md +0 -0
- {groundworkers-0.11.0 → groundworkers-0.12.0}/docs/development/plugins.md +0 -0
- {groundworkers-0.11.0 → groundworkers-0.12.0}/docs/js/asciinema-init.js +0 -0
- {groundworkers-0.11.0 → groundworkers-0.12.0}/docs/js/mermaid-init.js +0 -0
- {groundworkers-0.11.0 → groundworkers-0.12.0}/docs/plugins.md +0 -0
- {groundworkers-0.11.0 → groundworkers-0.12.0}/docs/reference/ref_adapters.md +0 -0
- {groundworkers-0.11.0 → groundworkers-0.12.0}/docs/reference/ref_base.md +0 -0
- {groundworkers-0.11.0 → groundworkers-0.12.0}/docs/reference/ref_config.md +0 -0
- {groundworkers-0.11.0 → groundworkers-0.12.0}/docs/services/domain.md +0 -0
- {groundworkers-0.11.0 → groundworkers-0.12.0}/docs/services/graph.md +0 -0
- {groundworkers-0.11.0 → groundworkers-0.12.0}/docs/services/mapping.md +0 -0
- {groundworkers-0.11.0 → groundworkers-0.12.0}/docs/services/source_planning.md +0 -0
- {groundworkers-0.11.0 → groundworkers-0.12.0}/docs/services/text.md +0 -0
- {groundworkers-0.11.0 → groundworkers-0.12.0}/docs/static/01_create_config.png +0 -0
- {groundworkers-0.11.0 → groundworkers-0.12.0}/docs/static/02_empty_config.png +0 -0
- {groundworkers-0.11.0 → groundworkers-0.12.0}/docs/static/03_config_wizard.png +0 -0
- {groundworkers-0.11.0 → groundworkers-0.12.0}/docs/static/04_test_cnx.png +0 -0
- {groundworkers-0.11.0 → groundworkers-0.12.0}/docs/static/04_warnings.png +0 -0
- {groundworkers-0.11.0 → groundworkers-0.12.0}/docs/static/05_graph_setup.png +0 -0
- {groundworkers-0.11.0 → groundworkers-0.12.0}/docs/static/06_load_predicates.png +0 -0
- {groundworkers-0.11.0 → groundworkers-0.12.0}/docs/static/07_vector_store.png +0 -0
- {groundworkers-0.11.0 → groundworkers-0.12.0}/docs/static/08_register_embedding.png +0 -0
- {groundworkers-0.11.0 → groundworkers-0.12.0}/docs/static/10_setup_complete.png +0 -0
- {groundworkers-0.11.0 → groundworkers-0.12.0}/docs/static/demo.cast +0 -0
- {groundworkers-0.11.0 → groundworkers-0.12.0}/docs/static/demo.short.cast +0 -0
- {groundworkers-0.11.0 → groundworkers-0.12.0}/docs/tools/concept.md +0 -0
- {groundworkers-0.11.0 → groundworkers-0.12.0}/docs/tools/domain.md +0 -0
- {groundworkers-0.11.0 → groundworkers-0.12.0}/docs/tools/embedding.md +0 -0
- {groundworkers-0.11.0 → groundworkers-0.12.0}/docs/tools/knowledge.md +0 -0
- {groundworkers-0.11.0 → groundworkers-0.12.0}/docs/tools/mapping.md +0 -0
- {groundworkers-0.11.0 → groundworkers-0.12.0}/docs/tools/resolver.md +0 -0
- {groundworkers-0.11.0 → groundworkers-0.12.0}/docs/tools/source_planning.md +0 -0
- {groundworkers-0.11.0 → groundworkers-0.12.0}/docs/tools/system.md +0 -0
- {groundworkers-0.11.0 → groundworkers-0.12.0}/docs/tools/text.md +0 -0
- {groundworkers-0.11.0 → groundworkers-0.12.0}/docs/usage/installation.md +0 -0
- {groundworkers-0.11.0 → groundworkers-0.12.0}/docs/usage/prompt-handling.md +0 -0
- {groundworkers-0.11.0 → groundworkers-0.12.0}/docs/usage/setup_journey.md +0 -0
- {groundworkers-0.11.0 → groundworkers-0.12.0}/docs/usage/testing.md +0 -0
- {groundworkers-0.11.0 → groundworkers-0.12.0}/docs/usage/upgrading-from-0.6.md +0 -0
- {groundworkers-0.11.0 → groundworkers-0.12.0}/src/groundworkers/__init__.py +0 -0
- {groundworkers-0.11.0 → groundworkers-0.12.0}/src/groundworkers/_env.py +0 -0
- {groundworkers-0.11.0 → groundworkers-0.12.0}/src/groundworkers/adapters/__init__.py +0 -0
- {groundworkers-0.11.0 → groundworkers-0.12.0}/src/groundworkers/adapters/cdm.py +0 -0
- {groundworkers-0.11.0 → groundworkers-0.12.0}/src/groundworkers/adapters/llm.py +0 -0
- {groundworkers-0.11.0 → groundworkers-0.12.0}/src/groundworkers/application/__init__.py +0 -0
- {groundworkers-0.11.0 → groundworkers-0.12.0}/src/groundworkers/application/setup/__init__.py +0 -0
- {groundworkers-0.11.0 → groundworkers-0.12.0}/src/groundworkers/application/setup/configuration.py +0 -0
- {groundworkers-0.11.0 → groundworkers-0.12.0}/src/groundworkers/application/setup/configuration_provider.py +0 -0
- {groundworkers-0.11.0 → groundworkers-0.12.0}/src/groundworkers/application/setup/databases.py +0 -0
- {groundworkers-0.11.0 → groundworkers-0.12.0}/src/groundworkers/application/setup/embedding_artifacts.py +0 -0
- {groundworkers-0.11.0 → groundworkers-0.12.0}/src/groundworkers/application/setup/embedding_capability.py +0 -0
- {groundworkers-0.11.0 → groundworkers-0.12.0}/src/groundworkers/application/setup/embedding_coverage.py +0 -0
- {groundworkers-0.11.0 → groundworkers-0.12.0}/src/groundworkers/application/setup/embedding_population.py +0 -0
- {groundworkers-0.11.0 → groundworkers-0.12.0}/src/groundworkers/application/setup/embedding_reconciliation.py +0 -0
- {groundworkers-0.11.0 → groundworkers-0.12.0}/src/groundworkers/application/setup/embedding_registry.py +0 -0
- {groundworkers-0.11.0 → groundworkers-0.12.0}/src/groundworkers/application/setup/embedding_setup.py +0 -0
- {groundworkers-0.11.0 → groundworkers-0.12.0}/src/groundworkers/application/setup/graph_maintenance.py +0 -0
- {groundworkers-0.11.0 → groundworkers-0.12.0}/src/groundworkers/application/setup/integration.py +0 -0
- {groundworkers-0.11.0 → groundworkers-0.12.0}/src/groundworkers/application/setup/maintenance_runs.py +0 -0
- {groundworkers-0.11.0 → groundworkers-0.12.0}/src/groundworkers/application/setup/model_inventory.py +0 -0
- {groundworkers-0.11.0 → groundworkers-0.12.0}/src/groundworkers/application/setup/models.py +0 -0
- {groundworkers-0.11.0 → groundworkers-0.12.0}/src/groundworkers/application/setup/performance_maintenance.py +0 -0
- {groundworkers-0.11.0 → groundworkers-0.12.0}/src/groundworkers/application/setup/plugin_configuration.py +0 -0
- {groundworkers-0.11.0 → groundworkers-0.12.0}/src/groundworkers/application/setup/runtime_setup.py +0 -0
- {groundworkers-0.11.0 → groundworkers-0.12.0}/src/groundworkers/base/__init__.py +0 -0
- {groundworkers-0.11.0 → groundworkers-0.12.0}/src/groundworkers/base/concept_payload.py +0 -0
- {groundworkers-0.11.0 → groundworkers-0.12.0}/src/groundworkers/base/database.py +0 -0
- {groundworkers-0.11.0 → groundworkers-0.12.0}/src/groundworkers/base/domain_names.py +0 -0
- {groundworkers-0.11.0 → groundworkers-0.12.0}/src/groundworkers/base/errors.py +0 -0
- {groundworkers-0.11.0 → groundworkers-0.12.0}/src/groundworkers/base/results.py +0 -0
- {groundworkers-0.11.0 → groundworkers-0.12.0}/src/groundworkers/base/server.py +0 -0
- {groundworkers-0.11.0 → groundworkers-0.12.0}/src/groundworkers/base/sql.py +0 -0
- {groundworkers-0.11.0 → groundworkers-0.12.0}/src/groundworkers/bootstrap.py +0 -0
- {groundworkers-0.11.0 → groundworkers-0.12.0}/src/groundworkers/knowledge/packs/core/criteria-gate-yesno/guidance.md +0 -0
- {groundworkers-0.11.0 → groundworkers-0.12.0}/src/groundworkers/knowledge/packs/core/criteria-gate-yesno/manifest.yaml +0 -0
- {groundworkers-0.11.0 → groundworkers-0.12.0}/src/groundworkers/knowledge/packs/core/diagnosis-role-modifier/guidance.md +0 -0
- {groundworkers-0.11.0 → groundworkers-0.12.0}/src/groundworkers/knowledge/packs/core/diagnosis-role-modifier/manifest.yaml +0 -0
- {groundworkers-0.11.0 → groundworkers-0.12.0}/src/groundworkers/knowledge/packs/core/domain-routing/guidance.md +0 -0
- {groundworkers-0.11.0 → groundworkers-0.12.0}/src/groundworkers/knowledge/packs/core/domain-routing/manifest.yaml +0 -0
- {groundworkers-0.11.0 → groundworkers-0.12.0}/src/groundworkers/knowledge/packs/core/domain-routing/rules.yaml +0 -0
- {groundworkers-0.11.0 → groundworkers-0.12.0}/src/groundworkers/knowledge/packs/core/drug-concept-granularity/guidance.md +0 -0
- {groundworkers-0.11.0 → groundworkers-0.12.0}/src/groundworkers/knowledge/packs/core/drug-concept-granularity/manifest.yaml +0 -0
- {groundworkers-0.11.0 → groundworkers-0.12.0}/src/groundworkers/knowledge/packs/core/drug-concept-granularity/rules.yaml +0 -0
- {groundworkers-0.11.0 → groundworkers-0.12.0}/src/groundworkers/knowledge/packs/core/history-of-event/guidance.md +0 -0
- {groundworkers-0.11.0 → groundworkers-0.12.0}/src/groundworkers/knowledge/packs/core/history-of-event/manifest.yaml +0 -0
- {groundworkers-0.11.0 → groundworkers-0.12.0}/src/groundworkers/knowledge/packs/core/measurement-concept-granularity/guidance.md +0 -0
- {groundworkers-0.11.0 → groundworkers-0.12.0}/src/groundworkers/knowledge/packs/core/measurement-concept-granularity/manifest.yaml +0 -0
- {groundworkers-0.11.0 → groundworkers-0.12.0}/src/groundworkers/knowledge/packs/core/measurement-concept-granularity/rules.yaml +0 -0
- {groundworkers-0.11.0 → groundworkers-0.12.0}/src/groundworkers/knowledge/packs/core/standard-concept-preference/guidance.md +0 -0
- {groundworkers-0.11.0 → groundworkers-0.12.0}/src/groundworkers/knowledge/packs/core/standard-concept-preference/manifest.yaml +0 -0
- {groundworkers-0.11.0 → groundworkers-0.12.0}/src/groundworkers/knowledge/packs/core/standard-concept-preference/rules.yaml +0 -0
- {groundworkers-0.11.0 → groundworkers-0.12.0}/src/groundworkers/omop_domains.py +0 -0
- {groundworkers-0.11.0 → groundworkers-0.12.0}/src/groundworkers/plugins.py +0 -0
- {groundworkers-0.11.0 → groundworkers-0.12.0}/src/groundworkers/prompt_packs/__init__.py +0 -0
- {groundworkers-0.11.0 → groundworkers-0.12.0}/src/groundworkers/prompt_packs/groundcrew-source-column-classification/classification-request.schema.json +0 -0
- {groundworkers-0.11.0 → groundworkers-0.12.0}/src/groundworkers/prompt_packs/groundcrew-source-column-classification/classification-result.schema.json +0 -0
- {groundworkers-0.11.0 → groundworkers-0.12.0}/src/groundworkers/prompt_packs/groundcrew-source-column-classification/examples.yaml +0 -0
- {groundworkers-0.11.0 → groundworkers-0.12.0}/src/groundworkers/prompt_packs/groundcrew-source-column-classification/instructions.md +0 -0
- {groundworkers-0.11.0 → groundworkers-0.12.0}/src/groundworkers/prompt_packs/groundcrew-source-column-classification/manifest.yaml +0 -0
- {groundworkers-0.11.0 → groundworkers-0.12.0}/src/groundworkers/prompt_packs/groundcrew-source-column-classification/role-catalogue.yaml +0 -0
- {groundworkers-0.11.0 → groundworkers-0.12.0}/src/groundworkers/server_instructions.py +0 -0
- {groundworkers-0.11.0 → groundworkers-0.12.0}/src/groundworkers/services/__init__.py +0 -0
- {groundworkers-0.11.0 → groundworkers-0.12.0}/src/groundworkers/services/ancestry.py +0 -0
- {groundworkers-0.11.0 → groundworkers-0.12.0}/src/groundworkers/services/knowledge/__init__.py +0 -0
- {groundworkers-0.11.0 → groundworkers-0.12.0}/src/groundworkers/services/knowledge/catalogue.py +0 -0
- {groundworkers-0.11.0 → groundworkers-0.12.0}/src/groundworkers/services/knowledge/models.py +0 -0
- {groundworkers-0.11.0 → groundworkers-0.12.0}/src/groundworkers/services/relationship_neighborhood.py +0 -0
- {groundworkers-0.11.0 → groundworkers-0.12.0}/src/groundworkers/services/source_planning/__init__.py +0 -0
- {groundworkers-0.11.0 → groundworkers-0.12.0}/src/groundworkers/services/source_planning/assisted.py +0 -0
- {groundworkers-0.11.0 → groundworkers-0.12.0}/src/groundworkers/services/source_planning/canonical_headers.py +0 -0
- {groundworkers-0.11.0 → groundworkers-0.12.0}/src/groundworkers/services/source_planning/classifier.py +0 -0
- {groundworkers-0.11.0 → groundworkers-0.12.0}/src/groundworkers/services/source_planning/decomposer.py +0 -0
- {groundworkers-0.11.0 → groundworkers-0.12.0}/src/groundworkers/services/source_planning/decomposers/__init__.py +0 -0
- {groundworkers-0.11.0 → groundworkers-0.12.0}/src/groundworkers/services/source_planning/decomposers/csv_.py +0 -0
- {groundworkers-0.11.0 → groundworkers-0.12.0}/src/groundworkers/services/source_planning/decomposers/ddl_.py +0 -0
- {groundworkers-0.11.0 → groundworkers-0.12.0}/src/groundworkers/services/source_planning/decomposers/docx_.py +0 -0
- {groundworkers-0.11.0 → groundworkers-0.12.0}/src/groundworkers/services/source_planning/decomposers/json_.py +0 -0
- {groundworkers-0.11.0 → groundworkers-0.12.0}/src/groundworkers/services/source_planning/decomposers/pdf_.py +0 -0
- {groundworkers-0.11.0 → groundworkers-0.12.0}/src/groundworkers/services/source_planning/decomposers/xlsx_.py +0 -0
- {groundworkers-0.11.0 → groundworkers-0.12.0}/src/groundworkers/services/source_planning/decomposers/xml_.py +0 -0
- {groundworkers-0.11.0 → groundworkers-0.12.0}/src/groundworkers/services/source_planning/detector.py +0 -0
- {groundworkers-0.11.0 → groundworkers-0.12.0}/src/groundworkers/services/source_planning/models.py +0 -0
- {groundworkers-0.11.0 → groundworkers-0.12.0}/src/groundworkers/services/source_planning/normalisation.py +0 -0
- {groundworkers-0.11.0 → groundworkers-0.12.0}/src/groundworkers/services/source_planning/provenance.py +0 -0
- {groundworkers-0.11.0 → groundworkers-0.12.0}/src/groundworkers/services/source_planning/router.py +0 -0
- {groundworkers-0.11.0 → groundworkers-0.12.0}/src/groundworkers/services/source_planning/serialisation.py +0 -0
- {groundworkers-0.11.0 → groundworkers-0.12.0}/src/groundworkers/services/source_planning/service.py +0 -0
- {groundworkers-0.11.0 → groundworkers-0.12.0}/src/groundworkers/services/source_planning/source_profiles/__init__.py +0 -0
- {groundworkers-0.11.0 → groundworkers-0.12.0}/src/groundworkers/services/source_planning/source_profiles/base.py +0 -0
- {groundworkers-0.11.0 → groundworkers-0.12.0}/src/groundworkers/services/source_planning/source_profiles/redcap.py +0 -0
- {groundworkers-0.11.0 → groundworkers-0.12.0}/src/groundworkers/services/source_planning/source_profiles/registry.py +0 -0
- {groundworkers-0.11.0 → groundworkers-0.12.0}/src/groundworkers/services/source_planning/warnings.py +0 -0
- {groundworkers-0.11.0 → groundworkers-0.12.0}/src/groundworkers/services/text/__init__.py +0 -0
- {groundworkers-0.11.0 → groundworkers-0.12.0}/src/groundworkers/services/text/models.py +0 -0
- {groundworkers-0.11.0 → groundworkers-0.12.0}/src/groundworkers/services/text/prompts.py +0 -0
- {groundworkers-0.11.0 → groundworkers-0.12.0}/src/groundworkers/services/text/service.py +0 -0
- {groundworkers-0.11.0 → groundworkers-0.12.0}/src/groundworkers/tools/__init__.py +0 -0
- {groundworkers-0.11.0 → groundworkers-0.12.0}/src/groundworkers/tools/domain_tools.py +0 -0
- {groundworkers-0.11.0 → groundworkers-0.12.0}/src/groundworkers/tools/knowledge_tools.py +0 -0
- {groundworkers-0.11.0 → groundworkers-0.12.0}/src/groundworkers/tools/mapping_tools.py +0 -0
- {groundworkers-0.11.0 → groundworkers-0.12.0}/src/groundworkers/tools/source_planning_tools.py +0 -0
- {groundworkers-0.11.0 → groundworkers-0.12.0}/src/groundworkers/tools/system_tools.py +0 -0
- {groundworkers-0.11.0 → groundworkers-0.12.0}/src/groundworkers/tools/text_tools.py +0 -0
- {groundworkers-0.11.0 → groundworkers-0.12.0}/src/groundworkers/transports/__init__.py +0 -0
- {groundworkers-0.11.0 → groundworkers-0.12.0}/src/groundworkers/transports/rest/__init__.py +0 -0
- {groundworkers-0.11.0 → groundworkers-0.12.0}/src/groundworkers/transports/rest/api.py +0 -0
- {groundworkers-0.11.0 → groundworkers-0.12.0}/src/groundworkers/transports/rest/models.py +0 -0
- {groundworkers-0.11.0 → groundworkers-0.12.0}/src/groundworkers/tui/__init__.py +0 -0
- {groundworkers-0.11.0 → groundworkers-0.12.0}/src/groundworkers/tui/app.py +0 -0
- {groundworkers-0.11.0 → groundworkers-0.12.0}/src/groundworkers/tui/pages/__init__.py +0 -0
- {groundworkers-0.11.0 → groundworkers-0.12.0}/src/groundworkers/tui/pages/base.py +0 -0
- {groundworkers-0.11.0 → groundworkers-0.12.0}/src/groundworkers/tui/pages/plugin_config.py +0 -0
- {groundworkers-0.11.0 → groundworkers-0.12.0}/src/groundworkers/tui/pages/plugin_setup.py +0 -0
- {groundworkers-0.11.0 → groundworkers-0.12.0}/src/groundworkers/tui/pages/setup.py +0 -0
- {groundworkers-0.11.0 → groundworkers-0.12.0}/src/groundworkers/tui/presenters/__init__.py +0 -0
- {groundworkers-0.11.0 → groundworkers-0.12.0}/src/groundworkers/tui/presenters/base.py +0 -0
- {groundworkers-0.11.0 → groundworkers-0.12.0}/src/groundworkers/tui/presenters/chat.py +0 -0
- {groundworkers-0.11.0 → groundworkers-0.12.0}/src/groundworkers/tui/presenters/configuration.py +0 -0
- {groundworkers-0.11.0 → groundworkers-0.12.0}/src/groundworkers/tui/presenters/database.py +0 -0
- {groundworkers-0.11.0 → groundworkers-0.12.0}/src/groundworkers/tui/presenters/embeddings.py +0 -0
- {groundworkers-0.11.0 → groundworkers-0.12.0}/src/groundworkers/tui/presenters/graph.py +0 -0
- {groundworkers-0.11.0 → groundworkers-0.12.0}/src/groundworkers/tui/presenters/llm_provider.py +0 -0
- {groundworkers-0.11.0 → groundworkers-0.12.0}/src/groundworkers/tui/presenters/overview.py +0 -0
- {groundworkers-0.11.0 → groundworkers-0.12.0}/src/groundworkers/tui/presenters/performance.py +0 -0
- {groundworkers-0.11.0 → groundworkers-0.12.0}/src/groundworkers/tui/presenters/runs.py +0 -0
- {groundworkers-0.11.0 → groundworkers-0.12.0}/src/groundworkers/tui/routes.py +0 -0
- {groundworkers-0.11.0 → groundworkers-0.12.0}/src/groundworkers/tui/state.py +0 -0
- {groundworkers-0.11.0 → groundworkers-0.12.0}/src/groundworkers/tui/wizards/__init__.py +0 -0
- {groundworkers-0.11.0 → groundworkers-0.12.0}/src/groundworkers/tui/wizards/config_location.py +0 -0
- {groundworkers-0.11.0 → groundworkers-0.12.0}/src/groundworkers/tui/wizards/embedding_store.py +0 -0
- {groundworkers-0.11.0 → groundworkers-0.12.0}/src/groundworkers/tui/wizards/embeddings.py +0 -0
- {groundworkers-0.11.0 → groundworkers-0.12.0}/src/groundworkers/tui/wizards/graph_maintenance.py +0 -0
- {groundworkers-0.11.0 → groundworkers-0.12.0}/src/groundworkers/tui/wizards/performance_maintenance.py +0 -0
- {groundworkers-0.11.0 → groundworkers-0.12.0}/src/groundworkers/tui/wizards/plugin_setup.py +0 -0
- {groundworkers-0.11.0 → groundworkers-0.12.0}/tests/__init__.py +0 -0
- {groundworkers-0.11.0 → groundworkers-0.12.0}/tests/integration/__init__.py +0 -0
- {groundworkers-0.11.0 → groundworkers-0.12.0}/tests/integration/test_omop_duckdb_runtime.py +0 -0
- {groundworkers-0.11.0 → groundworkers-0.12.0}/tests/integration/test_omop_emb_adapter.py +0 -0
- {groundworkers-0.11.0 → groundworkers-0.12.0}/tests/integration/test_omop_emb_contract.py +0 -0
- {groundworkers-0.11.0 → groundworkers-0.12.0}/tests/integration/test_omop_graph_adapter.py +0 -0
- {groundworkers-0.11.0 → groundworkers-0.12.0}/tests/integration/test_omop_postgres_runtime.py +0 -0
- {groundworkers-0.11.0 → groundworkers-0.12.0}/tests/support/__init__.py +0 -0
- {groundworkers-0.11.0 → groundworkers-0.12.0}/tests/support/agent_surface.py +0 -0
- {groundworkers-0.11.0 → groundworkers-0.12.0}/tests/support/agent_surface_budget.json +0 -0
- {groundworkers-0.11.0 → groundworkers-0.12.0}/tests/support/embedding_contract_fixture.py +0 -0
- {groundworkers-0.11.0 → groundworkers-0.12.0}/tests/support/omop.py +0 -0
- {groundworkers-0.11.0 → groundworkers-0.12.0}/tests/support/postgres_ci_config.toml +0 -0
- {groundworkers-0.11.0 → groundworkers-0.12.0}/tests/support/seed_postgres_fixture.py +0 -0
- {groundworkers-0.11.0 → groundworkers-0.12.0}/tests/support/stack_config.py +0 -0
- {groundworkers-0.11.0 → groundworkers-0.12.0}/tests/support/wheel_smoke.py +0 -0
- {groundworkers-0.11.0 → groundworkers-0.12.0}/tests/test_bootstrap_config.py +0 -0
- {groundworkers-0.11.0 → groundworkers-0.12.0}/tests/test_rest_api.py +0 -0
- {groundworkers-0.11.0 → groundworkers-0.12.0}/tests/test_server_registry.py +0 -0
- {groundworkers-0.11.0 → groundworkers-0.12.0}/tests/unit/__init__.py +0 -0
- {groundworkers-0.11.0 → groundworkers-0.12.0}/tests/unit/test_concept_payload.py +0 -0
- {groundworkers-0.11.0 → groundworkers-0.12.0}/tests/unit/test_config_location_wizard.py +0 -0
- {groundworkers-0.11.0 → groundworkers-0.12.0}/tests/unit/test_configuration_provider.py +0 -0
- {groundworkers-0.11.0 → groundworkers-0.12.0}/tests/unit/test_domain_names.py +0 -0
- {groundworkers-0.11.0 → groundworkers-0.12.0}/tests/unit/test_domain_tools.py +0 -0
- {groundworkers-0.11.0 → groundworkers-0.12.0}/tests/unit/test_embedding_population_scope.py +0 -0
- {groundworkers-0.11.0 → groundworkers-0.12.0}/tests/unit/test_embedding_reconciliation.py +0 -0
- {groundworkers-0.11.0 → groundworkers-0.12.0}/tests/unit/test_embedding_registry_step.py +0 -0
- {groundworkers-0.11.0 → groundworkers-0.12.0}/tests/unit/test_embedding_tools.py +0 -0
- {groundworkers-0.11.0 → groundworkers-0.12.0}/tests/unit/test_env_bootstrap.py +0 -0
- {groundworkers-0.11.0 → groundworkers-0.12.0}/tests/unit/test_error_boundary.py +0 -0
- {groundworkers-0.11.0 → groundworkers-0.12.0}/tests/unit/test_graph_maintenance.py +0 -0
- {groundworkers-0.11.0 → groundworkers-0.12.0}/tests/unit/test_graph_maintenance_wizard.py +0 -0
- {groundworkers-0.11.0 → groundworkers-0.12.0}/tests/unit/test_graph_service.py +0 -0
- {groundworkers-0.11.0 → groundworkers-0.12.0}/tests/unit/test_graph_status.py +0 -0
- {groundworkers-0.11.0 → groundworkers-0.12.0}/tests/unit/test_grounding_service.py +0 -0
- {groundworkers-0.11.0 → groundworkers-0.12.0}/tests/unit/test_knowledge_catalogue.py +0 -0
- {groundworkers-0.11.0 → groundworkers-0.12.0}/tests/unit/test_llm_adapter.py +0 -0
- {groundworkers-0.11.0 → groundworkers-0.12.0}/tests/unit/test_maintenance_runs_phase2.py +0 -0
- {groundworkers-0.11.0 → groundworkers-0.12.0}/tests/unit/test_mapping_context.py +0 -0
- {groundworkers-0.11.0 → groundworkers-0.12.0}/tests/unit/test_mapping_service.py +0 -0
- {groundworkers-0.11.0 → groundworkers-0.12.0}/tests/unit/test_mapping_tools.py +0 -0
- {groundworkers-0.11.0 → groundworkers-0.12.0}/tests/unit/test_migration_boundaries.py +0 -0
- {groundworkers-0.11.0 → groundworkers-0.12.0}/tests/unit/test_normalized_index.py +0 -0
- {groundworkers-0.11.0 → groundworkers-0.12.0}/tests/unit/test_omop_domains.py +0 -0
- {groundworkers-0.11.0 → groundworkers-0.12.0}/tests/unit/test_omop_emb_adapter.py +0 -0
- {groundworkers-0.11.0 → groundworkers-0.12.0}/tests/unit/test_omop_emb_setup_config.py +0 -0
- {groundworkers-0.11.0 → groundworkers-0.12.0}/tests/unit/test_omop_graph_adapter.py +0 -0
- {groundworkers-0.11.0 → groundworkers-0.12.0}/tests/unit/test_performance.py +0 -0
- {groundworkers-0.11.0 → groundworkers-0.12.0}/tests/unit/test_performance_maintenance_wizard.py +0 -0
- {groundworkers-0.11.0 → groundworkers-0.12.0}/tests/unit/test_phase3_overview.py +0 -0
- {groundworkers-0.11.0 → groundworkers-0.12.0}/tests/unit/test_plugin_configuration.py +0 -0
- {groundworkers-0.11.0 → groundworkers-0.12.0}/tests/unit/test_plugin_lint_cli.py +0 -0
- {groundworkers-0.11.0 → groundworkers-0.12.0}/tests/unit/test_plugins.py +0 -0
- {groundworkers-0.11.0 → groundworkers-0.12.0}/tests/unit/test_predicate_mapping_classification.py +0 -0
- {groundworkers-0.11.0 → groundworkers-0.12.0}/tests/unit/test_prompt_packs.py +0 -0
- {groundworkers-0.11.0 → groundworkers-0.12.0}/tests/unit/test_provider_fields.py +0 -0
- {groundworkers-0.11.0 → groundworkers-0.12.0}/tests/unit/test_relationship_edges.py +0 -0
- {groundworkers-0.11.0 → groundworkers-0.12.0}/tests/unit/test_required_integration_preflight.py +0 -0
- {groundworkers-0.11.0 → groundworkers-0.12.0}/tests/unit/test_required_test_gate.py +0 -0
- {groundworkers-0.11.0 → groundworkers-0.12.0}/tests/unit/test_schema_resolution.py +0 -0
- {groundworkers-0.11.0 → groundworkers-0.12.0}/tests/unit/test_server_instructions.py +0 -0
- {groundworkers-0.11.0 → groundworkers-0.12.0}/tests/unit/test_setup_artifacts_and_coverage.py +0 -0
- {groundworkers-0.11.0 → groundworkers-0.12.0}/tests/unit/test_setup_configuration.py +0 -0
- {groundworkers-0.11.0 → groundworkers-0.12.0}/tests/unit/test_setup_configuration_section.py +0 -0
- {groundworkers-0.11.0 → groundworkers-0.12.0}/tests/unit/test_setup_databases.py +0 -0
- {groundworkers-0.11.0 → groundworkers-0.12.0}/tests/unit/test_setup_embeddings.py +0 -0
- {groundworkers-0.11.0 → groundworkers-0.12.0}/tests/unit/test_setup_provider_conformance.py +0 -0
- {groundworkers-0.11.0 → groundworkers-0.12.0}/tests/unit/test_setup_runtime.py +0 -0
- {groundworkers-0.11.0 → groundworkers-0.12.0}/tests/unit/test_setup_truth.py +0 -0
- {groundworkers-0.11.0 → groundworkers-0.12.0}/tests/unit/test_setup_write_flows.py +0 -0
- {groundworkers-0.11.0 → groundworkers-0.12.0}/tests/unit/test_source_planning_assisted_classifier.py +0 -0
- {groundworkers-0.11.0 → groundworkers-0.12.0}/tests/unit/test_source_planning_classifier.py +0 -0
- {groundworkers-0.11.0 → groundworkers-0.12.0}/tests/unit/test_source_planning_decomposer.py +0 -0
- {groundworkers-0.11.0 → groundworkers-0.12.0}/tests/unit/test_source_planning_detector.py +0 -0
- {groundworkers-0.11.0 → groundworkers-0.12.0}/tests/unit/test_source_planning_document_formats.py +0 -0
- {groundworkers-0.11.0 → groundworkers-0.12.0}/tests/unit/test_source_planning_models.py +0 -0
- {groundworkers-0.11.0 → groundworkers-0.12.0}/tests/unit/test_source_planning_normalisation.py +0 -0
- {groundworkers-0.11.0 → groundworkers-0.12.0}/tests/unit/test_source_planning_router.py +0 -0
- {groundworkers-0.11.0 → groundworkers-0.12.0}/tests/unit/test_source_planning_service.py +0 -0
- {groundworkers-0.11.0 → groundworkers-0.12.0}/tests/unit/test_source_planning_tools.py +0 -0
- {groundworkers-0.11.0 → groundworkers-0.12.0}/tests/unit/test_split_classified_edges.py +0 -0
- {groundworkers-0.11.0 → groundworkers-0.12.0}/tests/unit/test_stack_config_fixtures.py +0 -0
- {groundworkers-0.11.0 → groundworkers-0.12.0}/tests/unit/test_stored_ancestry.py +0 -0
- {groundworkers-0.11.0 → groundworkers-0.12.0}/tests/unit/test_system_tools.py +0 -0
- {groundworkers-0.11.0 → groundworkers-0.12.0}/tests/unit/test_text_service.py +0 -0
- {groundworkers-0.11.0 → groundworkers-0.12.0}/tests/unit/test_text_tools.py +0 -0
- {groundworkers-0.11.0 → groundworkers-0.12.0}/tests/unit/test_tui_app.py +0 -0
- {groundworkers-0.11.0 → groundworkers-0.12.0}/tests/unit/test_tui_state.py +0 -0
- {groundworkers-0.11.0 → groundworkers-0.12.0}/tests/unit/test_vector_store_setup.py +0 -0
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
Metadata-Version: 2.5
|
|
2
2
|
Name: groundworkers
|
|
3
|
-
Version: 0.
|
|
3
|
+
Version: 0.12.0
|
|
4
4
|
Summary: Groundworkers MCP server — read-only agentive access to OMOP vocabularies, concept graphs, and embeddings.
|
|
5
5
|
Requires-Python: >=3.12
|
|
6
6
|
Requires-Dist: fastapi<1.0,>=0.110
|
|
@@ -11,7 +11,6 @@ Requires-Dist: omop-alchemy<4,>=3.0.0
|
|
|
11
11
|
Requires-Dist: omop-emb<4,>=3.2.0
|
|
12
12
|
Requires-Dist: omop-graph<5,>=4.0.0
|
|
13
13
|
Requires-Dist: omop-llm<2,>=1.0.2
|
|
14
|
-
Requires-Dist: omop-semantics<1,>=0.6
|
|
15
14
|
Requires-Dist: psutil<8,>=5.9
|
|
16
15
|
Requires-Dist: psycopg[binary]<4,>=3.1
|
|
17
16
|
Requires-Dist: pydantic<3,>=2
|
|
@@ -120,9 +120,6 @@ source_planning_llm_assisted_enabled = true
|
|
|
120
120
|
# Knowledge packs: unset uses the packs shipped in the installed package.
|
|
121
121
|
# knowledge_packs_root = "/absolute/path/to/packs"
|
|
122
122
|
|
|
123
|
-
# Semantic projection tools are opt-in.
|
|
124
|
-
semantic_projection_enabled = false
|
|
125
|
-
|
|
126
123
|
# Groundworkers launches omop-emb for managed population runs. oa-configurator
|
|
127
124
|
# gives each package its own typed tool section; both packages share the actual
|
|
128
125
|
# CDM, model, and vector-store entries by naming the same resources here.
|
|
@@ -108,8 +108,6 @@ Services contain reusable domain logic that should work the same regardless of t
|
|
|
108
108
|
- `TextService` for LLM-backed text preprocessing
|
|
109
109
|
- `DomainService` for LLM-backed structured-field domain hints
|
|
110
110
|
- `SourcePlanningService` for stateless source-planning pipelines
|
|
111
|
-
- `SemanticProjectionService` for deterministic output-definition projection
|
|
112
|
-
over `omop-semantics` — grounded concept in, one or more CDM rows out
|
|
113
111
|
|
|
114
112
|
If the logic is something a Python caller would reasonably want without going through MCP, it probably belongs in a service.
|
|
115
113
|
|
|
@@ -121,8 +119,6 @@ Some services also depend on other services or optional adapters as part of the
|
|
|
121
119
|
- `SourcePlanningService` is always present and can be LLM-assisted when that
|
|
122
120
|
adapter is configured
|
|
123
121
|
|
|
124
|
-
`SemanticProjectionService` is the one exception to the `Services`/adapter composition described above: it needs no adapter (no database, no LLM — the same properties that make `omop-semantics` itself portable), so it is not part of `app.services`. It's constructed directly and registered behind its own config flag, the same way `KnowledgeCatalogue` is. See [SemanticProjectionService](services/semantic_projection.md).
|
|
125
|
-
|
|
126
122
|
### Transport layers
|
|
127
123
|
|
|
128
124
|
`groundworkers` exposes two transport styles over the same runtime:
|
|
@@ -6,14 +6,12 @@ MCP, REST, and Python are different ways to call the same runtime. Where a servi
|
|
|
6
6
|
|
|
7
7
|
## The main workflow
|
|
8
8
|
|
|
9
|
-
Mapping usually starts with source text or fields. Text preparation or domain classification can help narrow the search. Retrieval finds candidate concepts
|
|
9
|
+
Mapping usually starts with source text or fields. Text preparation or domain classification can help narrow the search. Retrieval finds candidate concepts, and grounding tries to resolve the input using ranked rules. Mapping brings the candidates, evidence, and graph context together for a caller or reviewer to choose a mapping.
|
|
10
10
|
|
|
11
11
|
```mermaid
|
|
12
12
|
flowchart TD
|
|
13
13
|
SOURCE["Source text or fields"] -->|Retrieval and grounding| CANDIDATES["Candidate concepts and evidence"]
|
|
14
14
|
CANDIDATES -->|Caller or reviewer chooses| SELECTED["Selected concept or concepts"]
|
|
15
|
-
SELECTED -. Optional semantic projection .-> ROWS["CDM rows"]
|
|
16
|
-
SOURCE -. Source context .-> ROWS
|
|
17
15
|
```
|
|
18
16
|
|
|
19
17
|
## Grounding, mapping, and retrieval
|
|
@@ -72,7 +70,6 @@ Most vocabulary and graph operations run without an LLM. Some text preparation a
|
|
|
72
70
|
| Structured-field domain classification | No | Configured chat model |
|
|
73
71
|
| Assisted source planning | Deterministic pipeline plus optional model fallback | LLM only when the assisted path is selected and configured |
|
|
74
72
|
| Source planning without assistance | Yes | Source content and any format-specific optional extra |
|
|
75
|
-
| Semantic projection | Yes | No database, embedding model, or LLM |
|
|
76
73
|
|
|
77
74
|
An embedding model and a chat model are separate configuration references. A deployment can use embeddings without enabling chat, chat without embeddings, or neither.
|
|
78
75
|
|
|
@@ -90,10 +87,6 @@ An agent can use workflow prompts to organise a task and elicitation prompts to
|
|
|
90
87
|
|
|
91
88
|
See [Working with prompts](usage/prompt-handling.md) for choosing guidance, handling unanswered questions, and requesting more explanation when needed.
|
|
92
89
|
|
|
93
|
-
## Semantic projection
|
|
94
|
-
|
|
95
|
-
Grounding answers “which concept does this source item refer to?” Projection answers “given that concept and this source context, which CDM row or rows should be emitted?” It is useful for sibling-field modifiers, value-carried family history, deterministic suppression, and multi-row output definitions. Projection never chooses the concept and never calls an LLM. It must be enabled explicitly to expose the definition catalogue.
|
|
96
|
-
|
|
97
90
|
## Choose an interface
|
|
98
91
|
|
|
99
92
|
| Choose | When it fits |
|
|
@@ -102,7 +95,7 @@ Grounding answers “which concept does this source item refer to?” Projection
|
|
|
102
95
|
| REST | An application wants a conventional HTTP contract for the curated candidate-bundle and assisted source-planning workflows. REST is not a mirror of every MCP tool. |
|
|
103
96
|
| Direct Python | A Python process already owns orchestration, batching, evaluation, or review logic and should call services without a transport hop. |
|
|
104
97
|
|
|
105
|
-
Use `groundworkers --describe` to inspect the active MCP tools, prompts, resources, and redacted runtime description.
|
|
98
|
+
Use `groundworkers --describe` to inspect the active MCP tools, prompts, resources, and redacted runtime description.
|
|
106
99
|
|
|
107
100
|
## Relationship to companion packages
|
|
108
101
|
|
|
@@ -111,7 +104,6 @@ Groundworkers uses these packages:
|
|
|
111
104
|
- `omop-alchemy` provides OMOP CDM models and database configuration;
|
|
112
105
|
- `omop-graph` provides graph-backed concept traversal and resolver primitives;
|
|
113
106
|
- `omop-emb` provides embedding stores, indexes, and model-backed query encoding;
|
|
114
|
-
- `omop-semantics` provides the generic output-definition runtime used by semantic projection;
|
|
115
107
|
- `omop-llm` provides provider-neutral model backends;
|
|
116
108
|
- `oa-configurator` resolves the shared stack configuration;
|
|
117
109
|
- `groundcrew` owns stateful orchestration and job lifecycle, while Groundworkers provides reusable stateless capabilities.
|
|
@@ -104,6 +104,20 @@ Messages are safe to log and surface: provider and database failures are transla
|
|
|
104
104
|
|
|
105
105
|
Do not derive standardness from omop-graph's `ConceptView.standard_concept`: that field is a single boolean covering both `'S'` and `'C'`. Groundworkers reads the raw flag at its adapter boundary so callers get the distinction.
|
|
106
106
|
|
|
107
|
+
## Read vocabulary facts
|
|
108
|
+
|
|
109
|
+
These methods query the configured vocabulary role on PostgreSQL or DuckDB. They perform exact, read-only lookups.
|
|
110
|
+
|
|
111
|
+
| Method | Result |
|
|
112
|
+
| --- | --- |
|
|
113
|
+
| `services.vocab.concept_facts(concept_ids)` | A dictionary keyed by concept ID with the recorded domain, active flag, and standard flag. Unknown IDs are absent. Inactive IDs retain their recorded facts. |
|
|
114
|
+
| `services.vocab.reverse_relationship_concept_id(concept_id)` | The reverse relationship's concept ID from `relationship`, or `None` when it is missing. |
|
|
115
|
+
| `services.vocab.domain_concept_id(domain_id)` | The concept ID from `domain`, or `None` when it is missing. |
|
|
116
|
+
| `services.vocab.answer_concept_ids(question_concept_id)` | All targets of active outbound `Has Answer` relationships, as a frozen set. An empty set means the lookup found no such relationships. It does not determine whether the answer list is closed. |
|
|
117
|
+
| `services.graph.has_ancestor(concept_id, ancestor_id)` | Whether the pair is stored in `concept_ancestor`, including a self-pair when present. |
|
|
118
|
+
|
|
119
|
+
A failed vocabulary query raises `GroundworkersError`. The `omop_semantic_projection` adapter in the separate `gw-plugins/omop-semantic-projection` repository uses these methods for projection checks and reports an unavailable answer-list lookup as deferred. Its `build_projection_oracle` factory always audits the registry, using the default registry unless the caller passes one. It logs the audit summary at WARNING and each affected ID at INFO.
|
|
120
|
+
|
|
107
121
|
## Writing configuration
|
|
108
122
|
|
|
109
123
|
Configuration writes are a local console concern, not part of the integration surface. If you are embedding the setup console in another host application, drive `GroundworkersConfigMutationService` through Groundskeeping's `ConfigWizardController`:
|
|
@@ -139,7 +139,7 @@ These HTTP examples listen on the local machine. See [Integrations](usage/integr
|
|
|
139
139
|
|
|
140
140
|
Installed Groundworkers plugins can add tools, prompts, resources, and setup pages. Install them into the same Python environment as Groundworkers, then reopen the console or restart the service. Use `--describe` to check what was registered; plugins with readiness support also report configuration or dependency problems in the console.
|
|
141
141
|
|
|
142
|
-
For prompt packs, see [Working with prompts](usage/prompt-handling.md).
|
|
142
|
+
For prompt packs, see [Working with prompts](usage/prompt-handling.md). Groundworkers includes bundled knowledge packs. See [Configuration](usage/configuration.md) to add local knowledge packs.
|
|
143
143
|
|
|
144
144
|
## Configuration managed elsewhere
|
|
145
145
|
|
|
@@ -56,7 +56,7 @@ flowchart TD
|
|
|
56
56
|
|
|
57
57
|
## Before assuming a capability is available
|
|
58
58
|
|
|
59
|
-
Availability follows configuration. A CDM database enables the core vocabulary and mapping services. An embedding model plus vector store enables embedding operations. A chat model enables text preprocessing, domain classification, and assisted source planning.
|
|
59
|
+
Availability follows configuration. A CDM database enables the core vocabulary and mapping services. An embedding model plus vector store enables embedding operations. A chat model enables text preprocessing, domain classification, and assisted source planning.
|
|
60
60
|
|
|
61
61
|
Run this before integrating against an environment:
|
|
62
62
|
|
|
@@ -53,9 +53,3 @@
|
|
|
53
53
|
The catalogue is a standalone discovery service rather than an entry in `app.services`. It reads bundled and configured packs and returns applicable manifest/content objects.
|
|
54
54
|
|
|
55
55
|
::: groundworkers.services.knowledge.catalogue
|
|
56
|
-
|
|
57
|
-
## SemanticProjectionService
|
|
58
|
-
|
|
59
|
-
`SemanticProjectionService` deterministically projects a grounded concept into one or more CDM rows via `omop-semantics`. Not part of `app.services` — see [SemanticProjectionService](../services/semantic_projection.md) for why.
|
|
60
|
-
|
|
61
|
-
::: groundworkers.services.semantic_projection
|
|
@@ -44,7 +44,11 @@ Resolver tiers are tried in this order:
|
|
|
44
44
|
3. embedding retrieval, when an embedding client is wired into `OmopGraphAdapter`
|
|
45
45
|
4. partial label and synonym matches, when the search space is already constrained enough to keep them practical
|
|
46
46
|
|
|
47
|
-
|
|
47
|
+
Omit `parent_ids` or pass an empty sequence to ground without an ancestry constraint. Domain and vocabulary constraints still apply. With a non-empty `parent_ids`, results must be descendants of at least one listed concept.
|
|
48
|
+
|
|
49
|
+
### Ground a coded answer
|
|
50
|
+
|
|
51
|
+
Pass `question_concept_id` to `ground()` or `async_ground()` with the answer as the query. The service checks the question's vocabulary answer list and returns the listed concepts with their own vocabulary flags. Use `grounding_explanation.answer_status` to distinguish a match from candidates returned for review. See [Ground an answer](../tools/search.md#ground-an-answer) for the statuses and lookup rules.
|
|
48
52
|
|
|
49
53
|
## Relationship to transports
|
|
50
54
|
|
|
@@ -38,6 +38,12 @@ Case-insensitive exact match of `query` against `concept_name` and (when `includ
|
|
|
38
38
|
|
|
39
39
|
`standard_only` defaults to `False`. Non-standard concepts often have better lexical coverage (trade names, source codes, regional synonyms) than their standard equivalents; filtering them out in the search step loses those signals. Use `navigate_to_standard` afterward to resolve non-standard results.
|
|
40
40
|
|
|
41
|
+
### `match_within`
|
|
42
|
+
|
|
43
|
+
Pass an explicit set of concept IDs in `ConceptFilter.concept_ids`. The service reads the eligible concepts and their synonyms in one query, then checks for an exact code, an exact name, an exact synonym, and a normalised name or synonym in that order. The result gives the first matching step and its matched terms. It also carries the full eligible set for callers that need to show the available choices.
|
|
44
|
+
|
|
45
|
+
`normalize_label_for_matching()` is the normaliser for names and synonyms. Compared with the default `NormalizationProfile.VERBATIM` settings, it keeps words such as Unknown and Other, joins letters separated by punctuation, and preserves signs and numbers. For example, `Non-reactive` becomes `nonreactive` and `-1.25` stays `-1.25`. Codes are compared as written.
|
|
46
|
+
|
|
41
47
|
### `search_normalized`
|
|
42
48
|
|
|
43
49
|
```python
|
|
@@ -4,7 +4,7 @@ Text tools document model-requested limits and model-reported fields; mapping to
|
|
|
4
4
|
|
|
5
5
|
MCP mapping tools provide parameter guidance, concise candidate-channel counts and a recovery hint for missing vocabulary codes.
|
|
6
6
|
|
|
7
|
-
The MCP surface is organized by the job a caller is trying to do.
|
|
7
|
+
The MCP surface is organized by the job a caller is trying to do. Core vocabulary and graph tools require the CDM runtime. Embedding, chat, and knowledge-pack tools appear when their prerequisites are available.
|
|
8
8
|
|
|
9
9
|
## Choose a workflow
|
|
10
10
|
|
|
@@ -13,12 +13,12 @@ The MCP surface is organized by the job a caller is trying to do. Tool registrat
|
|
|
13
13
|
| Inspect a known concept or relationship | Concept tools | Deterministic concept records, hierarchy, paths, edges, and standard mappings |
|
|
14
14
|
| Search with a specific retrieval signal | Search tools or embedding tools | Candidate records plus the signal used to retrieve them |
|
|
15
15
|
| Resolve free text with a ranked policy | `concept_ground` | First successful resolver tier, ranked results, and grounding explanation |
|
|
16
|
+
| Resolve an answer within its question's list | [`concept_ground`](search.md#ground-an-answer) with `question_concept_id` | A lexical match or eligible answers for review |
|
|
16
17
|
| Preserve evidence for mapping review | Mapping tools | A candidate union, standard targets, hierarchy, relationships, and evaluation helpers |
|
|
17
18
|
| Prepare noisy clinical text | Text tools | Normalized, decomposed, cleaned, or disambiguated search phrases |
|
|
18
19
|
| Classify structured fields | `domain_classify` | Best-effort OMOP domain hints for later retrieval |
|
|
19
20
|
| Analyze a source artifact before ingest | Source planning tools | Neutral tables, column roles, route decisions, warnings, and provenance |
|
|
20
21
|
| Find reusable operational guidance | Knowledge tools | Applicable knowledge-pack manifests and pack content |
|
|
21
|
-
| Turn a grounded concept into CDM rows | `semantic_project` | Deterministic output rows, links, unresolved fields, or suppression reasons |
|
|
22
22
|
| Check what this deployment can do | System tools and `--describe` | Backend availability, vocabulary catalogue, and registered MCP surfaces |
|
|
23
23
|
|
|
24
24
|
## Tool groups
|
|
@@ -35,7 +35,6 @@ The MCP surface is organized by the job a caller is trying to do. Tool registrat
|
|
|
35
35
|
| Source planning | `source_plan`, `source_plan_assisted` | Source-planning service; assisted path also needs chat |
|
|
36
36
|
| Knowledge | `knowledge_catalogue`, `knowledge_pack` | Bundled or configured packs available |
|
|
37
37
|
| System | `system_status`, `system_vocabulary_catalogue` | Always registered |
|
|
38
|
-
| Semantic projection | `semantic_project` | `semantic_projection_enabled = true` |
|
|
39
38
|
|
|
40
39
|
The source-planning resources `source-planning://canonical-headers`, `source-planning://column-roles`, and `source-planning://ingestion-strategies` are also registered independently of the tool table. Text preprocessing prompts are available through MCP prompt discovery when the server starts.
|
|
41
40
|
|
|
@@ -55,7 +54,6 @@ Tools can belong to several toolsets. `groundworkers --describe` lists each tool
|
|
|
55
54
|
| `llm` | Language-model text helpers. |
|
|
56
55
|
| `source` | Source-file planning. |
|
|
57
56
|
| `knowledge` | Convention packs. |
|
|
58
|
-
| `semantic` | Semantic projection (optional). |
|
|
59
57
|
| `offline` | Evaluation and diagnostics, not intended for agents. |
|
|
60
58
|
|
|
61
59
|
Usage instructions follow the available tools.
|
|
@@ -65,7 +63,7 @@ Selection can exclude toolsets; exclusion wins when a tool also belongs to an in
|
|
|
65
63
|
|
|
66
64
|
MCP is the broad, discovery-oriented surface. REST intentionally exposes only curated workflow operations: candidate bundles and assisted source planning, plus `/healthz`. Direct Python callers should use `app.services.*` for domain workflows and should not import MCP tool modules to avoid a transport-shaped API.
|
|
67
65
|
|
|
68
|
-
|
|
66
|
+
See the [integration guide](../usage/integrations.md) for the three entry points and the [concepts guide](../concepts.md) for when to use each one.
|
|
69
67
|
|
|
70
68
|
## Availability and errors
|
|
71
69
|
|
|
@@ -4,6 +4,29 @@ These tools expose lexical concept search with its retrieval signals. They are b
|
|
|
4
4
|
|
|
5
5
|
Unlike `concept_ground`, which runs a tiered pipeline and stops at the first tier with results, these tools let the client choose a strategy, inspect its signals, and handle non-standard candidates explicitly.
|
|
6
6
|
|
|
7
|
+
## Ground an answer
|
|
8
|
+
|
|
9
|
+
In a structured instrument, the question and answer carry meaning together. “No” means something different in a question about pain than in a question about medication use. When the vocabulary defines an answer list for a question, grounding uses that list to find the OMOP concept for the recorded response. Use it for questionnaire choices, categorical test results such as “non-reactive”, and vocabulary answer codes such as `LA15256-3`.
|
|
10
|
+
|
|
11
|
+
Call `concept_ground` with the answer text or vocabulary code in `query` and the question's OMOP concept ID in `question_concept_id`. Eligible answers come from the question's active outbound `Has Answer` relationships. Use an empty `parent_ids` list or omit it when supplying a question. The `domain`, `vocabulary_id`, `standard_only`, and `active_only` filters still apply to the listed answers.
|
|
12
|
+
|
|
13
|
+
```json
|
|
14
|
+
{
|
|
15
|
+
"query": "non-reactive",
|
|
16
|
+
"question_concept_id": 586515
|
|
17
|
+
}
|
|
18
|
+
```
|
|
19
|
+
|
|
20
|
+
Check `grounding_explanation.answer_status` before using a result. The `eligible_answer_count` field counts all list members that pass the filters, including those outside the returned results.
|
|
21
|
+
|
|
22
|
+
| Status | What it means |
|
|
23
|
+
| --- | --- |
|
|
24
|
+
| `ok` | One answer matched by exact code, exact name, exact synonym, or normalised name or synonym. See `match_step` for the step that matched. |
|
|
25
|
+
| `ambiguous` | Multiple answers tied at the best matching step. The results are suggestions for review. |
|
|
26
|
+
| `no_match` | See `reason`. `unknown_question` and `no_answer_list` return no candidates. `no_matching_answer` returns eligible list members for review, up to `limit`. Results are empty when the filters leave no eligible answers. |
|
|
27
|
+
|
|
28
|
+
Embeddings can order tied answers or eligible members returned for review. They do not change `answer_status` or add candidates from outside the list. Without usable embeddings, review candidates appear in concept ID order, with no ranking implied. A failed vocabulary lookup returns a query error.
|
|
29
|
+
|
|
7
30
|
---
|
|
8
31
|
|
|
9
32
|
## `concept_search_exact`
|
|
@@ -49,7 +49,7 @@ Shared resources have their own entries so several packages can use the same con
|
|
|
49
49
|
| Model provider endpoints and credentials | `[providers.*]` |
|
|
50
50
|
| Model identity and capabilities | `[models.*]` |
|
|
51
51
|
| Vector-store backend and its database | `[vector_stores.*]` |
|
|
52
|
-
| Which of those entries Groundworkers uses, plus MCP/REST defaults
|
|
52
|
+
| Which of those entries Groundworkers uses, plus MCP/REST defaults and settings for grounding, source planning, and knowledge packs | `[tools.groundworkers]` |
|
|
53
53
|
|
|
54
54
|
Groundworkers references these entries **by name** and resolves them through `oa-configurator`. Its core runtime reads `[tools.groundworkers]` and the shared entries it names. Maintenance commands and installed plugins use their own package sections, as described below.
|
|
55
55
|
|
|
@@ -323,21 +323,6 @@ my-knowledge/
|
|
|
323
323
|
|
|
324
324
|
Relative paths resolve against the TOML file's directory; `~` is expanded. A configured pack with the same `layer` and `name` replaces the bundled copy. Other bundled packs remain available. These knowledge packs are separate from prompt workflows supplied by plugins; see [Working with prompts](prompt-handling.md).
|
|
325
325
|
|
|
326
|
-
<a id="semantic_projection"></a>
|
|
327
|
-
|
|
328
|
-
### Semantic projection (`semantic_projection_*`)
|
|
329
|
-
|
|
330
|
-
| Field | Type | Default |
|
|
331
|
-
|---|---|---|
|
|
332
|
-
| `semantic_projection_enabled` | `bool` | `false` |
|
|
333
|
-
|
|
334
|
-
Enable this to expose the `semantic_project` MCP tool. Projection uses a grounded concept and source context to produce CDM rows; it needs no embedding or chat model.
|
|
335
|
-
|
|
336
|
-
```toml
|
|
337
|
-
[tools.groundworkers]
|
|
338
|
-
semantic_projection_enabled = true
|
|
339
|
-
```
|
|
340
|
-
|
|
341
326
|
## What becomes available at runtime
|
|
342
327
|
|
|
343
328
|
Configuration determines which tools are registered. Registration does not establish that a database, model endpoint, or store is ready: check connections, model compatibility, and coverage separately in the console.
|
|
@@ -377,10 +362,6 @@ A `LEGACY_REGISTRY` error means the store layout is incompatible. Groundworkers
|
|
|
377
362
|
|
|
378
363
|
Text preparation and domain classification tools are registered. Assisted source planning is also available when `source_planning_llm_assisted_enabled = true`. The embedding model is independent of this choice.
|
|
379
364
|
|
|
380
|
-
### With `semantic_projection_enabled = true`
|
|
381
|
-
|
|
382
|
-
The `semantic_project` MCP tool is registered. Projection is deterministic and uses no model. See [Semantic projection](../tools/semantic_projection.md) for its inputs and results.
|
|
383
|
-
|
|
384
365
|
## Plugin configuration
|
|
385
366
|
|
|
386
367
|
Installed plugins can have their own `[tools.<plugin_name>]` settings and references to shared resources. They may provide console configuration pages or additional setup steps. Install plugins in the Groundworkers environment, follow their configuration guide, and restart the host after installation or configuration changes.
|
|
@@ -35,7 +35,7 @@ The older `sse` transport is also accepted. `--describe` loads the selected conf
|
|
|
35
35
|
groundworkers --describe
|
|
36
36
|
```
|
|
37
37
|
|
|
38
|
-
The available
|
|
38
|
+
The available tools depend on configuration. Embedding tools need an embedding store, text and domain tools need a chat model, and knowledge tools use the bundled or configured packs.
|
|
39
39
|
|
|
40
40
|
### Call a tool
|
|
41
41
|
|
|
@@ -123,14 +123,6 @@ Use `app.services.vocab` for lexical retrieval, `app.services.graph` for determi
|
|
|
123
123
|
|
|
124
124
|
Direct services return normal Python values or typed models. They raise `GroundworkersError` or `ValueError`; they do not return MCP error dictionaries. The transport boundary is responsible for serialization and error translation.
|
|
125
125
|
|
|
126
|
-
`SemanticProjectionService` is constructed directly because it needs no database, embedding store, or model:
|
|
127
|
-
|
|
128
|
-
```python
|
|
129
|
-
from groundworkers.services.semantic_projection import SemanticProjectionService
|
|
130
|
-
|
|
131
|
-
projector = SemanticProjectionService()
|
|
132
|
-
```
|
|
133
|
-
|
|
134
126
|
Build the runtime once and reuse it. Adapters own connection pools and lazy backend state; repeatedly constructing applications can create unnecessary resources.
|
|
135
127
|
|
|
136
128
|
## Relationship to groundcrew
|
|
@@ -52,7 +52,6 @@ nav:
|
|
|
52
52
|
- Knowledge Tools: tools/knowledge.md
|
|
53
53
|
- Source Planning Tools: tools/source_planning.md
|
|
54
54
|
- System Tools: tools/system.md
|
|
55
|
-
- Semantic Projection Tools: tools/semantic_projection.md
|
|
56
55
|
- Services:
|
|
57
56
|
- Graph Service: services/graph.md
|
|
58
57
|
- Grounding Service: services/grounding.md
|
|
@@ -61,7 +60,6 @@ nav:
|
|
|
61
60
|
- Source Planning Service: services/source_planning.md
|
|
62
61
|
- Text Service: services/text.md
|
|
63
62
|
- Domain Service: services/domain.md
|
|
64
|
-
- Semantic Projection Service: services/semantic_projection.md
|
|
65
63
|
- Development and architecture:
|
|
66
64
|
- Architecture: architecture.md
|
|
67
65
|
- Python integration details: development/integration.md
|
{groundworkers-0.11.0 → groundworkers-0.12.0}/src/groundworkers/adapters/_omop_graph_ancestry.py
RENAMED
|
@@ -24,6 +24,18 @@ class DescendantRow(TypedDict):
|
|
|
24
24
|
min_levels_of_separation: int
|
|
25
25
|
|
|
26
26
|
|
|
27
|
+
def q_has_ancestor(concept_id: int, ancestor_id: int) -> Select:
|
|
28
|
+
"""Select a single stored ancestor pair, including self if stored."""
|
|
29
|
+
return select(
|
|
30
|
+
select(Concept_Ancestor.ancestor_concept_id)
|
|
31
|
+
.where(
|
|
32
|
+
Concept_Ancestor.descendant_concept_id == concept_id,
|
|
33
|
+
Concept_Ancestor.ancestor_concept_id == ancestor_id,
|
|
34
|
+
)
|
|
35
|
+
.exists()
|
|
36
|
+
)
|
|
37
|
+
|
|
38
|
+
|
|
27
39
|
def q_ancestor_rows(
|
|
28
40
|
descendant_ids: Sequence[int],
|
|
29
41
|
*,
|
|
@@ -493,6 +493,62 @@ class OmopEmbAdapter:
|
|
|
493
493
|
"vector": row.tolist(),
|
|
494
494
|
}
|
|
495
495
|
|
|
496
|
+
def score_concept_vectors(
|
|
497
|
+
self, query: str, concept_ids: tuple[int, ...]
|
|
498
|
+
) -> dict[int, float]:
|
|
499
|
+
"""Score requested stored vectors without querying the neighbour index."""
|
|
500
|
+
try:
|
|
501
|
+
record = self._resolve_model_record(None)
|
|
502
|
+
array = EmbeddingReaderInterface.generate_embeddings(
|
|
503
|
+
self._model_backend_for(record), query, role=EmbeddingRole.QUERY
|
|
504
|
+
)
|
|
505
|
+
return self._score_concept_vectors(record, array[0], concept_ids)
|
|
506
|
+
except GroundworkersError:
|
|
507
|
+
raise
|
|
508
|
+
except Exception as exc:
|
|
509
|
+
raise GroundworkersError(
|
|
510
|
+
"BACKEND_UNAVAIL", "Could not rank answers with the configured embeddings."
|
|
511
|
+
) from exc
|
|
512
|
+
|
|
513
|
+
async def async_score_concept_vectors(
|
|
514
|
+
self, query: str, concept_ids: tuple[int, ...]
|
|
515
|
+
) -> dict[int, float]:
|
|
516
|
+
"""Use native async query encoding before comparing the requested vectors."""
|
|
517
|
+
try:
|
|
518
|
+
record = self._resolve_model_record(None)
|
|
519
|
+
vectors = await self._model_backend_for(record).async_embed_texts(
|
|
520
|
+
[query], role=EmbeddingRole.QUERY
|
|
521
|
+
)
|
|
522
|
+
query_vector = _embedding_array(vectors, expected_rows=1)[0]
|
|
523
|
+
return self._score_concept_vectors(record, query_vector, concept_ids)
|
|
524
|
+
except GroundworkersError:
|
|
525
|
+
raise
|
|
526
|
+
except Exception as exc:
|
|
527
|
+
raise GroundworkersError(
|
|
528
|
+
"BACKEND_UNAVAIL", "Could not rank answers with the configured embeddings."
|
|
529
|
+
) from exc
|
|
530
|
+
|
|
531
|
+
def _score_concept_vectors(
|
|
532
|
+
self,
|
|
533
|
+
record: EmbeddingModelRecord,
|
|
534
|
+
query_vector: np.ndarray,
|
|
535
|
+
concept_ids: tuple[int, ...],
|
|
536
|
+
) -> dict[int, float]:
|
|
537
|
+
reader = self._build_reader(record)
|
|
538
|
+
stored = reader.get_embeddings_by_concept_ids(concept_ids)
|
|
539
|
+
query_norm = np.linalg.norm(query_vector)
|
|
540
|
+
scores: dict[int, float] = {}
|
|
541
|
+
for concept_id in concept_ids:
|
|
542
|
+
vector = stored.get(concept_id)
|
|
543
|
+
if vector is None or vector.shape != query_vector.shape:
|
|
544
|
+
continue
|
|
545
|
+
scale = query_norm * np.linalg.norm(vector)
|
|
546
|
+
if scale:
|
|
547
|
+
score = float(np.dot(query_vector, vector) / scale)
|
|
548
|
+
if np.isfinite(score):
|
|
549
|
+
scores[concept_id] = score
|
|
550
|
+
return scores
|
|
551
|
+
|
|
496
552
|
def _get_backend(self) -> EmbeddingStoreReader:
|
|
497
553
|
if self._backend is None:
|
|
498
554
|
try:
|
|
@@ -31,6 +31,7 @@ from groundworkers.adapters._omop_graph_ancestry import (
|
|
|
31
31
|
q_ancestor_rows,
|
|
32
32
|
q_descendant_count,
|
|
33
33
|
q_descendant_rows,
|
|
34
|
+
q_has_ancestor,
|
|
34
35
|
)
|
|
35
36
|
from groundworkers.base.concept_payload import serialise_concept_view
|
|
36
37
|
from groundworkers.base.domain_names import DomainNameResolver
|
|
@@ -198,6 +199,14 @@ class OmopGraphAdapter:
|
|
|
198
199
|
# Hierarchy primitives
|
|
199
200
|
# ------------------------------------------------------------------
|
|
200
201
|
|
|
202
|
+
def has_ancestor(self, concept_id: int, ancestor_id: int) -> bool:
|
|
203
|
+
"""Check a single pair in the vocabulary's stored ancestry."""
|
|
204
|
+
try:
|
|
205
|
+
with self._cdm_session_factory() as session:
|
|
206
|
+
return bool(session.scalar(q_has_ancestor(concept_id, ancestor_id)))
|
|
207
|
+
except Exception as exc:
|
|
208
|
+
raise self._wrap_graph_error(exc, default_code="QUERY_ERROR") from exc
|
|
209
|
+
|
|
201
210
|
def validate_ancestor_constraints(
|
|
202
211
|
self,
|
|
203
212
|
concept_class_ids: list[str] | None,
|
|
@@ -31,6 +31,7 @@ from groundworkers.services import (
|
|
|
31
31
|
TextService,
|
|
32
32
|
VocabService,
|
|
33
33
|
)
|
|
34
|
+
from groundworkers.services.answer_grounding import AnswerGrounding
|
|
34
35
|
from groundworkers.services.source_planning import (
|
|
35
36
|
AssistedColumnRoleClassifier,
|
|
36
37
|
SourcePlanningService,
|
|
@@ -204,17 +205,23 @@ def build_services(config: AppConfig, adapters: Adapters) -> Services:
|
|
|
204
205
|
services.source_planning = SourcePlanningService(
|
|
205
206
|
assisted_classifier=assisted_classifier
|
|
206
207
|
)
|
|
208
|
+
if adapters.cdm is not None:
|
|
209
|
+
services.vocab = VocabService(adapters.cdm)
|
|
207
210
|
if adapters.omop_graph is not None:
|
|
208
211
|
# cdm is optional; only the classified-edge traversals
|
|
209
212
|
# (concept_associations / concept_extended_inheritance) require it.
|
|
210
213
|
services.graph = GraphService(adapters.omop_graph, adapters.cdm)
|
|
211
214
|
services.grounding = ConceptGroundingService(
|
|
212
215
|
services.graph,
|
|
216
|
+
answers=(
|
|
217
|
+
AnswerGrounding(services.vocab, adapters.omop_emb)
|
|
218
|
+
if services.vocab is not None
|
|
219
|
+
else None
|
|
220
|
+
),
|
|
213
221
|
min_fulltext_overlap=config.groundworkers.grounding_min_fulltext_overlap,
|
|
214
222
|
max_depth=config.groundworkers.grounding_max_depth,
|
|
215
223
|
)
|
|
216
|
-
if
|
|
217
|
-
services.vocab = VocabService(adapters.cdm)
|
|
224
|
+
if services.vocab is not None:
|
|
218
225
|
services.mapping = MappingService(
|
|
219
226
|
services.vocab,
|
|
220
227
|
graph_service=services.graph,
|
|
@@ -11,9 +11,10 @@ from pydantic import (
|
|
|
11
11
|
model_validator,
|
|
12
12
|
)
|
|
13
13
|
|
|
14
|
+
from groundworkers.base.concept_ids import MAX_OMOP_CONCEPT_ID
|
|
14
15
|
from groundworkers.base.errors import ErrorCode
|
|
15
16
|
|
|
16
|
-
PositiveConceptId = Annotated[int, Field(strict=True, gt=0)]
|
|
17
|
+
PositiveConceptId = Annotated[int, Field(strict=True, gt=0, le=MAX_OMOP_CONCEPT_ID)]
|
|
17
18
|
ConceptIds = Annotated[list[PositiveConceptId], Field(min_length=2, max_length=200)]
|
|
18
19
|
AncestorDepth = Annotated[int, Field(strict=True, ge=0, le=20)]
|
|
19
20
|
AncestorLimit = Annotated[int, Field(strict=True, ge=1, le=50)]
|
|
@@ -167,17 +167,6 @@ class GroundworkersConfig(PackageConfigBase):
|
|
|
167
167
|
),
|
|
168
168
|
)
|
|
169
169
|
|
|
170
|
-
# -- Semantic projection -------------------------------------------------
|
|
171
|
-
|
|
172
|
-
semantic_projection_enabled: bool = Field(
|
|
173
|
-
default=False,
|
|
174
|
-
description=(
|
|
175
|
-
"Whether the semantic projection tools are registered. Deterministic "
|
|
176
|
-
"and dependency-free, but opt-in while downstream review and export "
|
|
177
|
-
"surfaces adopt semantic projections."
|
|
178
|
-
),
|
|
179
|
-
)
|
|
180
|
-
|
|
181
170
|
@field_validator("rest_base_path")
|
|
182
171
|
@classmethod
|
|
183
172
|
def validate_rest_base_path(cls, value: str) -> str:
|
|
@@ -29,7 +29,6 @@ from groundworkers.base.errors import scrub_error_message
|
|
|
29
29
|
from groundworkers.base.server import GroundworkersMCPServer
|
|
30
30
|
from groundworkers.bootstrap import DatabaseUnavailableError, build_app_config
|
|
31
31
|
from groundworkers.config import AppConfig, GroundworkersConfig
|
|
32
|
-
from groundworkers.services.semantic_projection.service import SemanticProjectionService
|
|
33
32
|
from groundworkers.tools.concept_tools import register_concept_tools
|
|
34
33
|
from groundworkers.tools.domain_tools import register_domain_tools
|
|
35
34
|
from groundworkers.tools.embedding_tools import (
|
|
@@ -40,9 +39,6 @@ from groundworkers.tools.knowledge_tools import register_knowledge_tools
|
|
|
40
39
|
from groundworkers.tools.mapping_tools import register_mapping_tools
|
|
41
40
|
from groundworkers.tools.resolver_tools import register_resolver_tools
|
|
42
41
|
from groundworkers.tools.search_tools import register_search_tools
|
|
43
|
-
from groundworkers.tools.semantic_projection_tools import (
|
|
44
|
-
register_semantic_projection_tools,
|
|
45
|
-
)
|
|
46
42
|
from groundworkers.tools.source_planning_tools import (
|
|
47
43
|
register_source_planning_resources,
|
|
48
44
|
register_source_planning_tools,
|
|
@@ -88,8 +84,6 @@ def create_server(
|
|
|
88
84
|
register_source_planning_tools(server, app.services.source_planning)
|
|
89
85
|
register_source_planning_resources(server)
|
|
90
86
|
register_knowledge_tools(server, packs_root=config.knowledge_root)
|
|
91
|
-
if config.groundworkers.semantic_projection_enabled:
|
|
92
|
-
register_semantic_projection_tools(server, SemanticProjectionService())
|
|
93
87
|
register_text_prompts(server)
|
|
94
88
|
register_system_tools(
|
|
95
89
|
server,
|