textgraph-kg 3.3.0__tar.gz → 3.3.2__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.
Files changed (235) hide show
  1. {textgraph_kg-3.3.0 → textgraph_kg-3.3.2}/BENCHMARKS.md +18 -0
  2. {textgraph_kg-3.3.0 → textgraph_kg-3.3.2}/CHANGELOG.md +36 -0
  3. {textgraph_kg-3.3.0 → textgraph_kg-3.3.2}/PKG-INFO +16 -4
  4. {textgraph_kg-3.3.0 → textgraph_kg-3.3.2}/README.md +13 -1
  5. textgraph_kg-3.3.2/benchmarks/defaults.py +140 -0
  6. {textgraph_kg-3.3.0 → textgraph_kg-3.3.2}/docs/site/index.html +4 -2
  7. {textgraph_kg-3.3.0 → textgraph_kg-3.3.2}/pyproject.toml +2 -2
  8. textgraph_kg-3.3.2/tests/unit/test_defaults.py +58 -0
  9. {textgraph_kg-3.3.0 → textgraph_kg-3.3.2}/tests/unit/test_llm_augment.py +36 -0
  10. textgraph_kg-3.3.2/textgraph/__init__.py +8 -0
  11. {textgraph_kg-3.3.0 → textgraph_kg-3.3.2}/textgraph/cli.py +6 -1
  12. {textgraph_kg-3.3.0 → textgraph_kg-3.3.2}/textgraph/pipeline.py +4 -2
  13. {textgraph_kg-3.3.0 → textgraph_kg-3.3.2}/uv.lock +1 -1
  14. textgraph_kg-3.3.0/textgraph/__init__.py +0 -6
  15. {textgraph_kg-3.3.0 → textgraph_kg-3.3.2}/.gitattributes +0 -0
  16. {textgraph_kg-3.3.0 → textgraph_kg-3.3.2}/.github/workflows/benchmark.yml +0 -0
  17. {textgraph_kg-3.3.0 → textgraph_kg-3.3.2}/.github/workflows/determinism.yml +0 -0
  18. {textgraph_kg-3.3.0 → textgraph_kg-3.3.2}/.github/workflows/lint-and-typecheck.yml +0 -0
  19. {textgraph_kg-3.3.0 → textgraph_kg-3.3.2}/.github/workflows/pages.yml +0 -0
  20. {textgraph_kg-3.3.0 → textgraph_kg-3.3.2}/.github/workflows/pre-commit.yml +0 -0
  21. {textgraph_kg-3.3.0 → textgraph_kg-3.3.2}/.github/workflows/publish-pypi.yml +0 -0
  22. {textgraph_kg-3.3.0 → textgraph_kg-3.3.2}/.github/workflows/release.yml +0 -0
  23. {textgraph_kg-3.3.0 → textgraph_kg-3.3.2}/.github/workflows/test.yml +0 -0
  24. {textgraph_kg-3.3.0 → textgraph_kg-3.3.2}/.gitignore +0 -0
  25. {textgraph_kg-3.3.0 → textgraph_kg-3.3.2}/.pre-commit-config.yaml +0 -0
  26. {textgraph_kg-3.3.0 → textgraph_kg-3.3.2}/ARCHITECTURE.md +0 -0
  27. {textgraph_kg-3.3.0 → textgraph_kg-3.3.2}/LICENSE +0 -0
  28. {textgraph_kg-3.3.0 → textgraph_kg-3.3.2}/PLAN.md +0 -0
  29. {textgraph_kg-3.3.0 → textgraph_kg-3.3.2}/SECURITY.md +0 -0
  30. {textgraph_kg-3.3.0 → textgraph_kg-3.3.2}/TextGraph Architecture Gap Analysis.docx +0 -0
  31. {textgraph_kg-3.3.0 → textgraph_kg-3.3.2}/TextGraph_Engineering_Blueprint.pdf +0 -0
  32. {textgraph_kg-3.3.0 → textgraph_kg-3.3.2}/benchmarks/__init__.py +0 -0
  33. {textgraph_kg-3.3.0 → textgraph_kg-3.3.2}/benchmarks/quality.py +0 -0
  34. {textgraph_kg-3.3.0 → textgraph_kg-3.3.2}/benchmarks/reasoning.py +0 -0
  35. {textgraph_kg-3.3.0 → textgraph_kg-3.3.2}/benchmarks/retrieval.py +0 -0
  36. {textgraph_kg-3.3.0 → textgraph_kg-3.3.2}/benchmarks/run.py +0 -0
  37. {textgraph_kg-3.3.0 → textgraph_kg-3.3.2}/benchmarks/security.py +0 -0
  38. {textgraph_kg-3.3.0 → textgraph_kg-3.3.2}/docs/COMPARISON_SEMANTICA.md +0 -0
  39. {textgraph_kg-3.3.0 → textgraph_kg-3.3.2}/docs/RUNNING.md +0 -0
  40. {textgraph_kg-3.3.0 → textgraph_kg-3.3.2}/docs/SKILL.md +0 -0
  41. {textgraph_kg-3.3.0 → textgraph_kg-3.3.2}/docs/how-it-works.md +0 -0
  42. {textgraph_kg-3.3.0 → textgraph_kg-3.3.2}/docs/plans/chat-console.md +0 -0
  43. {textgraph_kg-3.3.0 → textgraph_kg-3.3.2}/docs/plans/neo4j-backend.md +0 -0
  44. {textgraph_kg-3.3.0 → textgraph_kg-3.3.2}/docs/retrieval-routing.md +0 -0
  45. {textgraph_kg-3.3.0 → textgraph_kg-3.3.2}/requirements-dev.txt +0 -0
  46. {textgraph_kg-3.3.0 → textgraph_kg-3.3.2}/requirements-full.txt +0 -0
  47. {textgraph_kg-3.3.0 → textgraph_kg-3.3.2}/requirements.txt +0 -0
  48. {textgraph_kg-3.3.0 → textgraph_kg-3.3.2}/schema/graph.schema.json +0 -0
  49. {textgraph_kg-3.3.0 → textgraph_kg-3.3.2}/schema/manifest.schema.json +0 -0
  50. {textgraph_kg-3.3.0 → textgraph_kg-3.3.2}/schema/schema.yaml +0 -0
  51. {textgraph_kg-3.3.0 → textgraph_kg-3.3.2}/schema/validate.py +0 -0
  52. {textgraph_kg-3.3.0 → textgraph_kg-3.3.2}/tests/__init__.py +0 -0
  53. {textgraph_kg-3.3.0 → textgraph_kg-3.3.2}/tests/determinism/test_byte_identical.py +0 -0
  54. {textgraph_kg-3.3.0 → textgraph_kg-3.3.2}/tests/fixtures/README.md +0 -0
  55. {textgraph_kg-3.3.0 → textgraph_kg-3.3.2}/tests/fixtures/corpora/adr/adr-0007-case-linking.md +0 -0
  56. {textgraph_kg-3.3.0 → textgraph_kg-3.3.2}/tests/fixtures/corpora/adr/adr-0008-retention.md +0 -0
  57. {textgraph_kg-3.3.0 → textgraph_kg-3.3.2}/tests/fixtures/corpora/chat/case-4471.chat +0 -0
  58. {textgraph_kg-3.3.0 → textgraph_kg-3.3.2}/tests/fixtures/corpora/conflict/filing-a.md +0 -0
  59. {textgraph_kg-3.3.0 → textgraph_kg-3.3.2}/tests/fixtures/corpora/conflict/filing-b.md +0 -0
  60. {textgraph_kg-3.3.0 → textgraph_kg-3.3.2}/tests/fixtures/corpora/contradiction/filing.md +0 -0
  61. {textgraph_kg-3.3.0 → textgraph_kg-3.3.2}/tests/fixtures/corpora/decision_chain/adr-0001-retention.md +0 -0
  62. {textgraph_kg-3.3.0 → textgraph_kg-3.3.2}/tests/fixtures/corpora/decision_chain/adr-0002-citations.md +0 -0
  63. {textgraph_kg-3.3.0 → textgraph_kg-3.3.2}/tests/fixtures/corpora/decision_chain/adr-0003-tooling.md +0 -0
  64. {textgraph_kg-3.3.0 → textgraph_kg-3.3.2}/tests/fixtures/corpora/docs/aml-overview.md +0 -0
  65. {textgraph_kg-3.3.0 → textgraph_kg-3.3.2}/tests/fixtures/corpora/docs/shell-company.md +0 -0
  66. {textgraph_kg-3.3.0 → textgraph_kg-3.3.2}/tests/fixtures/corpora/docs/wire-transfers.md +0 -0
  67. {textgraph_kg-3.3.0 → textgraph_kg-3.3.2}/tests/fixtures/corpora/secure/public.md +0 -0
  68. {textgraph_kg-3.3.0 → textgraph_kg-3.3.2}/tests/fixtures/corpora/secure/secret.md +0 -0
  69. {textgraph_kg-3.3.0 → textgraph_kg-3.3.2}/tests/fixtures/corpora/temporal/correction.md +0 -0
  70. {textgraph_kg-3.3.0 → textgraph_kg-3.3.2}/tests/fixtures/corpus_docs/adr-0001.md +0 -0
  71. {textgraph_kg-3.3.0 → textgraph_kg-3.3.2}/tests/fixtures/corpus_docs/mixed-encoding.log +0 -0
  72. {textgraph_kg-3.3.0 → textgraph_kg-3.3.2}/tests/fixtures/corpus_docs/notes.txt +0 -0
  73. {textgraph_kg-3.3.0 → textgraph_kg-3.3.2}/tests/fixtures/er/aliases.md +0 -0
  74. {textgraph_kg-3.3.0 → textgraph_kg-3.3.2}/tests/integration/test_agent_session.py +0 -0
  75. {textgraph_kg-3.3.0 → textgraph_kg-3.3.2}/tests/integration/test_artifacts.py +0 -0
  76. {textgraph_kg-3.3.0 → textgraph_kg-3.3.2}/tests/integration/test_duckdb_store.py +0 -0
  77. {textgraph_kg-3.3.0 → textgraph_kg-3.3.2}/tests/integration/test_edge_provenance.py +0 -0
  78. {textgraph_kg-3.3.0 → textgraph_kg-3.3.2}/tests/integration/test_er_pipeline.py +0 -0
  79. {textgraph_kg-3.3.0 → textgraph_kg-3.3.2}/tests/integration/test_ie_pipeline.py +0 -0
  80. {textgraph_kg-3.3.0 → textgraph_kg-3.3.2}/tests/integration/test_incremental.py +0 -0
  81. {textgraph_kg-3.3.0 → textgraph_kg-3.3.2}/tests/integration/test_incremental_stress.py +0 -0
  82. {textgraph_kg-3.3.0 → textgraph_kg-3.3.2}/tests/integration/test_provenance_integrity.py +0 -0
  83. {textgraph_kg-3.3.0 → textgraph_kg-3.3.2}/tests/integration/test_quality_benchmark.py +0 -0
  84. {textgraph_kg-3.3.0 → textgraph_kg-3.3.2}/tests/integration/test_report_corpora.py +0 -0
  85. {textgraph_kg-3.3.0 → textgraph_kg-3.3.2}/tests/integration/test_security_redteam.py +0 -0
  86. {textgraph_kg-3.3.0 → textgraph_kg-3.3.2}/tests/unit/test_canonical_doc.py +0 -0
  87. {textgraph_kg-3.3.0 → textgraph_kg-3.3.2}/tests/unit/test_canonical_json.py +0 -0
  88. {textgraph_kg-3.3.0 → textgraph_kg-3.3.2}/tests/unit/test_chat.py +0 -0
  89. {textgraph_kg-3.3.0 → textgraph_kg-3.3.2}/tests/unit/test_chat_decisions.py +0 -0
  90. {textgraph_kg-3.3.0 → textgraph_kg-3.3.2}/tests/unit/test_cli.py +0 -0
  91. {textgraph_kg-3.3.0 → textgraph_kg-3.3.2}/tests/unit/test_config.py +0 -0
  92. {textgraph_kg-3.3.0 → textgraph_kg-3.3.2}/tests/unit/test_conflicts.py +0 -0
  93. {textgraph_kg-3.3.0 → textgraph_kg-3.3.2}/tests/unit/test_console.py +0 -0
  94. {textgraph_kg-3.3.0 → textgraph_kg-3.3.2}/tests/unit/test_content_address.py +0 -0
  95. {textgraph_kg-3.3.0 → textgraph_kg-3.3.2}/tests/unit/test_decision_chain.py +0 -0
  96. {textgraph_kg-3.3.0 → textgraph_kg-3.3.2}/tests/unit/test_decisions.py +0 -0
  97. {textgraph_kg-3.3.0 → textgraph_kg-3.3.2}/tests/unit/test_dense.py +0 -0
  98. {textgraph_kg-3.3.0 → textgraph_kg-3.3.2}/tests/unit/test_doctor.py +0 -0
  99. {textgraph_kg-3.3.0 → textgraph_kg-3.3.2}/tests/unit/test_export_rdf.py +0 -0
  100. {textgraph_kg-3.3.0 → textgraph_kg-3.3.2}/tests/unit/test_gliner_backend.py +0 -0
  101. {textgraph_kg-3.3.0 → textgraph_kg-3.3.2}/tests/unit/test_got.py +0 -0
  102. {textgraph_kg-3.3.0 → textgraph_kg-3.3.2}/tests/unit/test_gql.py +0 -0
  103. {textgraph_kg-3.3.0 → textgraph_kg-3.3.2}/tests/unit/test_ingest.py +0 -0
  104. {textgraph_kg-3.3.0 → textgraph_kg-3.3.2}/tests/unit/test_integrations.py +0 -0
  105. {textgraph_kg-3.3.0 → textgraph_kg-3.3.2}/tests/unit/test_l0_ingest.py +0 -0
  106. {textgraph_kg-3.3.0 → textgraph_kg-3.3.2}/tests/unit/test_l1_structure.py +0 -0
  107. {textgraph_kg-3.3.0 → textgraph_kg-3.3.2}/tests/unit/test_l2_linguistic.py +0 -0
  108. {textgraph_kg-3.3.0 → textgraph_kg-3.3.2}/tests/unit/test_l3_encoder_ie.py +0 -0
  109. {textgraph_kg-3.3.0 → textgraph_kg-3.3.2}/tests/unit/test_l4_llm.py +0 -0
  110. {textgraph_kg-3.3.0 → textgraph_kg-3.3.2}/tests/unit/test_l5_resolution.py +0 -0
  111. {textgraph_kg-3.3.0 → textgraph_kg-3.3.2}/tests/unit/test_l6_claims.py +0 -0
  112. {textgraph_kg-3.3.0 → textgraph_kg-3.3.2}/tests/unit/test_l7_analytics.py +0 -0
  113. {textgraph_kg-3.3.0 → textgraph_kg-3.3.2}/tests/unit/test_l7_layout.py +0 -0
  114. {textgraph_kg-3.3.0 → textgraph_kg-3.3.2}/tests/unit/test_l8_retrieval.py +0 -0
  115. {textgraph_kg-3.3.0 → textgraph_kg-3.3.2}/tests/unit/test_mcp_tools.py +0 -0
  116. {textgraph_kg-3.3.0 → textgraph_kg-3.3.2}/tests/unit/test_offsets.py +0 -0
  117. {textgraph_kg-3.3.0 → textgraph_kg-3.3.2}/tests/unit/test_richdocs.py +0 -0
  118. {textgraph_kg-3.3.0 → textgraph_kg-3.3.2}/tests/unit/test_routing.py +0 -0
  119. {textgraph_kg-3.3.0 → textgraph_kg-3.3.2}/tests/unit/test_security.py +0 -0
  120. {textgraph_kg-3.3.0 → textgraph_kg-3.3.2}/tests/unit/test_vision.py +0 -0
  121. {textgraph_kg-3.3.0 → textgraph_kg-3.3.2}/textgraph/console/__init__.py +0 -0
  122. {textgraph_kg-3.3.0 → textgraph_kg-3.3.2}/textgraph/console/api.py +0 -0
  123. {textgraph_kg-3.3.0 → textgraph_kg-3.3.2}/textgraph/console/chat.py +0 -0
  124. {textgraph_kg-3.3.0 → textgraph_kg-3.3.2}/textgraph/console/ingest.py +0 -0
  125. {textgraph_kg-3.3.0 → textgraph_kg-3.3.2}/textgraph/console/page.py +0 -0
  126. {textgraph_kg-3.3.0 → textgraph_kg-3.3.2}/textgraph/console/renderer.py +0 -0
  127. {textgraph_kg-3.3.0 → textgraph_kg-3.3.2}/textgraph/console/server.py +0 -0
  128. {textgraph_kg-3.3.0 → textgraph_kg-3.3.2}/textgraph/core/__init__.py +0 -0
  129. {textgraph_kg-3.3.0 → textgraph_kg-3.3.2}/textgraph/core/canonical_doc.py +0 -0
  130. {textgraph_kg-3.3.0 → textgraph_kg-3.3.2}/textgraph/core/canonical_json.py +0 -0
  131. {textgraph_kg-3.3.0 → textgraph_kg-3.3.2}/textgraph/core/config.py +0 -0
  132. {textgraph_kg-3.3.0 → textgraph_kg-3.3.2}/textgraph/core/content_address.py +0 -0
  133. {textgraph_kg-3.3.0 → textgraph_kg-3.3.2}/textgraph/core/incremental.py +0 -0
  134. {textgraph_kg-3.3.0 → textgraph_kg-3.3.2}/textgraph/core/layout.py +0 -0
  135. {textgraph_kg-3.3.0 → textgraph_kg-3.3.2}/textgraph/core/offsets.py +0 -0
  136. {textgraph_kg-3.3.0 → textgraph_kg-3.3.2}/textgraph/doctor.py +0 -0
  137. {textgraph_kg-3.3.0 → textgraph_kg-3.3.2}/textgraph/got/__init__.py +0 -0
  138. {textgraph_kg-3.3.0 → textgraph_kg-3.3.2}/textgraph/got/reason.py +0 -0
  139. {textgraph_kg-3.3.0 → textgraph_kg-3.3.2}/textgraph/got/thought.py +0 -0
  140. {textgraph_kg-3.3.0 → textgraph_kg-3.3.2}/textgraph/gql/__init__.py +0 -0
  141. {textgraph_kg-3.3.0 → textgraph_kg-3.3.2}/textgraph/gql/ast.py +0 -0
  142. {textgraph_kg-3.3.0 → textgraph_kg-3.3.2}/textgraph/gql/engine.py +0 -0
  143. {textgraph_kg-3.3.0 → textgraph_kg-3.3.2}/textgraph/gql/errors.py +0 -0
  144. {textgraph_kg-3.3.0 → textgraph_kg-3.3.2}/textgraph/gql/parser.py +0 -0
  145. {textgraph_kg-3.3.0 → textgraph_kg-3.3.2}/textgraph/gql/tokenizer.py +0 -0
  146. {textgraph_kg-3.3.0 → textgraph_kg-3.3.2}/textgraph/integrations/__init__.py +0 -0
  147. {textgraph_kg-3.3.0 → textgraph_kg-3.3.2}/textgraph/integrations/adapters.py +0 -0
  148. {textgraph_kg-3.3.0 → textgraph_kg-3.3.2}/textgraph/l0_ingest/__init__.py +0 -0
  149. {textgraph_kg-3.3.0 → textgraph_kg-3.3.2}/textgraph/l0_ingest/base.py +0 -0
  150. {textgraph_kg-3.3.0 → textgraph_kg-3.3.2}/textgraph/l0_ingest/dispatch.py +0 -0
  151. {textgraph_kg-3.3.0 → textgraph_kg-3.3.2}/textgraph/l0_ingest/logs.py +0 -0
  152. {textgraph_kg-3.3.0 → textgraph_kg-3.3.2}/textgraph/l0_ingest/markdown.py +0 -0
  153. {textgraph_kg-3.3.0 → textgraph_kg-3.3.2}/textgraph/l0_ingest/plaintext.py +0 -0
  154. {textgraph_kg-3.3.0 → textgraph_kg-3.3.2}/textgraph/l0_ingest/richdocs.py +0 -0
  155. {textgraph_kg-3.3.0 → textgraph_kg-3.3.2}/textgraph/l0_ingest/structured.py +0 -0
  156. {textgraph_kg-3.3.0 → textgraph_kg-3.3.2}/textgraph/l0_ingest/transcript.py +0 -0
  157. {textgraph_kg-3.3.0 → textgraph_kg-3.3.2}/textgraph/l1_structure/__init__.py +0 -0
  158. {textgraph_kg-3.3.0 → textgraph_kg-3.3.2}/textgraph/l1_structure/decisions.py +0 -0
  159. {textgraph_kg-3.3.0 → textgraph_kg-3.3.2}/textgraph/l1_structure/emit.py +0 -0
  160. {textgraph_kg-3.3.0 → textgraph_kg-3.3.2}/textgraph/l1_structure/structure.py +0 -0
  161. {textgraph_kg-3.3.0 → textgraph_kg-3.3.2}/textgraph/l2_linguistic/__init__.py +0 -0
  162. {textgraph_kg-3.3.0 → textgraph_kg-3.3.2}/textgraph/l2_linguistic/negation.py +0 -0
  163. {textgraph_kg-3.3.0 → textgraph_kg-3.3.2}/textgraph/l2_linguistic/sentences.py +0 -0
  164. {textgraph_kg-3.3.0 → textgraph_kg-3.3.2}/textgraph/l3_encoder_ie/__init__.py +0 -0
  165. {textgraph_kg-3.3.0 → textgraph_kg-3.3.2}/textgraph/l3_encoder_ie/canonicalize.py +0 -0
  166. {textgraph_kg-3.3.0 → textgraph_kg-3.3.2}/textgraph/l3_encoder_ie/emit_ie.py +0 -0
  167. {textgraph_kg-3.3.0 → textgraph_kg-3.3.2}/textgraph/l3_encoder_ie/extract.py +0 -0
  168. {textgraph_kg-3.3.0 → textgraph_kg-3.3.2}/textgraph/l3_encoder_ie/gliner_backend.py +0 -0
  169. {textgraph_kg-3.3.0 → textgraph_kg-3.3.2}/textgraph/l3_encoder_ie/model.py +0 -0
  170. {textgraph_kg-3.3.0 → textgraph_kg-3.3.2}/textgraph/l3_encoder_ie/rules.py +0 -0
  171. {textgraph_kg-3.3.0 → textgraph_kg-3.3.2}/textgraph/l4_llm_optional/__init__.py +0 -0
  172. {textgraph_kg-3.3.0 → textgraph_kg-3.3.2}/textgraph/l4_llm_optional/cache.py +0 -0
  173. {textgraph_kg-3.3.0 → textgraph_kg-3.3.2}/textgraph/l4_llm_optional/client.py +0 -0
  174. {textgraph_kg-3.3.0 → textgraph_kg-3.3.2}/textgraph/l4_llm_optional/extract.py +0 -0
  175. {textgraph_kg-3.3.0 → textgraph_kg-3.3.2}/textgraph/l4_llm_optional/synthesize.py +0 -0
  176. {textgraph_kg-3.3.0 → textgraph_kg-3.3.2}/textgraph/l5_entity_resolution/__init__.py +0 -0
  177. {textgraph_kg-3.3.0 → textgraph_kg-3.3.2}/textgraph/l5_entity_resolution/audit.py +0 -0
  178. {textgraph_kg-3.3.0 → textgraph_kg-3.3.2}/textgraph/l5_entity_resolution/blocking.py +0 -0
  179. {textgraph_kg-3.3.0 → textgraph_kg-3.3.2}/textgraph/l5_entity_resolution/clustering.py +0 -0
  180. {textgraph_kg-3.3.0 → textgraph_kg-3.3.2}/textgraph/l5_entity_resolution/emit_er.py +0 -0
  181. {textgraph_kg-3.3.0 → textgraph_kg-3.3.2}/textgraph/l5_entity_resolution/metrics.py +0 -0
  182. {textgraph_kg-3.3.0 → textgraph_kg-3.3.2}/textgraph/l5_entity_resolution/model.py +0 -0
  183. {textgraph_kg-3.3.0 → textgraph_kg-3.3.2}/textgraph/l5_entity_resolution/resolve.py +0 -0
  184. {textgraph_kg-3.3.0 → textgraph_kg-3.3.2}/textgraph/l5_entity_resolution/scoring.py +0 -0
  185. {textgraph_kg-3.3.0 → textgraph_kg-3.3.2}/textgraph/l5_entity_resolution/similarity.py +0 -0
  186. {textgraph_kg-3.3.0 → textgraph_kg-3.3.2}/textgraph/l5_entity_resolution/splink_backend.py +0 -0
  187. {textgraph_kg-3.3.0 → textgraph_kg-3.3.2}/textgraph/l6_graph_model/__init__.py +0 -0
  188. {textgraph_kg-3.3.0 → textgraph_kg-3.3.2}/textgraph/l6_graph_model/claims.py +0 -0
  189. {textgraph_kg-3.3.0 → textgraph_kg-3.3.2}/textgraph/l6_graph_model/conflicts.py +0 -0
  190. {textgraph_kg-3.3.0 → textgraph_kg-3.3.2}/textgraph/l6_graph_model/temporal.py +0 -0
  191. {textgraph_kg-3.3.0 → textgraph_kg-3.3.2}/textgraph/l7_analytics/__init__.py +0 -0
  192. {textgraph_kg-3.3.0 → textgraph_kg-3.3.2}/textgraph/l7_analytics/algorithms.py +0 -0
  193. {textgraph_kg-3.3.0 → textgraph_kg-3.3.2}/textgraph/l7_analytics/analyze.py +0 -0
  194. {textgraph_kg-3.3.0 → textgraph_kg-3.3.2}/textgraph/l7_analytics/communities.py +0 -0
  195. {textgraph_kg-3.3.0 → textgraph_kg-3.3.2}/textgraph/l7_analytics/enrich.py +0 -0
  196. {textgraph_kg-3.3.0 → textgraph_kg-3.3.2}/textgraph/l7_analytics/layout.py +0 -0
  197. {textgraph_kg-3.3.0 → textgraph_kg-3.3.2}/textgraph/l8_retrieval/__init__.py +0 -0
  198. {textgraph_kg-3.3.0 → textgraph_kg-3.3.2}/textgraph/l8_retrieval/bm25.py +0 -0
  199. {textgraph_kg-3.3.0 → textgraph_kg-3.3.2}/textgraph/l8_retrieval/dense.py +0 -0
  200. {textgraph_kg-3.3.0 → textgraph_kg-3.3.2}/textgraph/l8_retrieval/emit_chunks.py +0 -0
  201. {textgraph_kg-3.3.0 → textgraph_kg-3.3.2}/textgraph/l8_retrieval/engine.py +0 -0
  202. {textgraph_kg-3.3.0 → textgraph_kg-3.3.2}/textgraph/l8_retrieval/grounding.py +0 -0
  203. {textgraph_kg-3.3.0 → textgraph_kg-3.3.2}/textgraph/l8_retrieval/model.py +0 -0
  204. {textgraph_kg-3.3.0 → textgraph_kg-3.3.2}/textgraph/l8_retrieval/narrate.py +0 -0
  205. {textgraph_kg-3.3.0 → textgraph_kg-3.3.2}/textgraph/l8_retrieval/rerank.py +0 -0
  206. {textgraph_kg-3.3.0 → textgraph_kg-3.3.2}/textgraph/l8_retrieval/routing.py +0 -0
  207. {textgraph_kg-3.3.0 → textgraph_kg-3.3.2}/textgraph/l8_retrieval/vision/__init__.py +0 -0
  208. {textgraph_kg-3.3.0 → textgraph_kg-3.3.2}/textgraph/l8_retrieval/vision/embed.py +0 -0
  209. {textgraph_kg-3.3.0 → textgraph_kg-3.3.2}/textgraph/l8_retrieval/vision/maxsim.py +0 -0
  210. {textgraph_kg-3.3.0 → textgraph_kg-3.3.2}/textgraph/l8_retrieval/vision/retriever.py +0 -0
  211. {textgraph_kg-3.3.0 → textgraph_kg-3.3.2}/textgraph/l9_artifacts/__init__.py +0 -0
  212. {textgraph_kg-3.3.0 → textgraph_kg-3.3.2}/textgraph/l9_artifacts/analytics_lite.py +0 -0
  213. {textgraph_kg-3.3.0 → textgraph_kg-3.3.2}/textgraph/l9_artifacts/artifacts.py +0 -0
  214. {textgraph_kg-3.3.0 → textgraph_kg-3.3.2}/textgraph/l9_artifacts/graph_html.py +0 -0
  215. {textgraph_kg-3.3.0 → textgraph_kg-3.3.2}/textgraph/l9_artifacts/graph_json.py +0 -0
  216. {textgraph_kg-3.3.0 → textgraph_kg-3.3.2}/textgraph/l9_artifacts/ontology.py +0 -0
  217. {textgraph_kg-3.3.0 → textgraph_kg-3.3.2}/textgraph/l9_artifacts/prov.py +0 -0
  218. {textgraph_kg-3.3.0 → textgraph_kg-3.3.2}/textgraph/l9_artifacts/rdf.py +0 -0
  219. {textgraph_kg-3.3.0 → textgraph_kg-3.3.2}/textgraph/l9_artifacts/report.py +0 -0
  220. {textgraph_kg-3.3.0 → textgraph_kg-3.3.2}/textgraph/mcp/__init__.py +0 -0
  221. {textgraph_kg-3.3.0 → textgraph_kg-3.3.2}/textgraph/mcp/server.py +0 -0
  222. {textgraph_kg-3.3.0 → textgraph_kg-3.3.2}/textgraph/mcp/tools.py +0 -0
  223. {textgraph_kg-3.3.0 → textgraph_kg-3.3.2}/textgraph/security/__init__.py +0 -0
  224. {textgraph_kg-3.3.0 → textgraph_kg-3.3.2}/textgraph/security/abac.py +0 -0
  225. {textgraph_kg-3.3.0 → textgraph_kg-3.3.2}/textgraph/security/context.py +0 -0
  226. {textgraph_kg-3.3.0 → textgraph_kg-3.3.2}/textgraph/security/policy.py +0 -0
  227. {textgraph_kg-3.3.0 → textgraph_kg-3.3.2}/textgraph/security/rebac.py +0 -0
  228. {textgraph_kg-3.3.0 → textgraph_kg-3.3.2}/textgraph/store/__init__.py +0 -0
  229. {textgraph_kg-3.3.0 → textgraph_kg-3.3.2}/textgraph/store/base.py +0 -0
  230. {textgraph_kg-3.3.0 → textgraph_kg-3.3.2}/textgraph/store/duckdb_store.py +0 -0
  231. {textgraph_kg-3.3.0 → textgraph_kg-3.3.2}/textgraph/store/memory.py +0 -0
  232. {textgraph_kg-3.3.0 → textgraph_kg-3.3.2}/textgraph/watch.py +0 -0
  233. {textgraph_kg-3.3.0 → textgraph_kg-3.3.2}/textgraph-engineering-research.md +0 -0
  234. {textgraph_kg-3.3.0 → textgraph_kg-3.3.2}/ui/graph_html/README.md +0 -0
  235. {textgraph_kg-3.3.0 → textgraph_kg-3.3.2}/ui/pipeline_console/README.md +0 -0
@@ -106,3 +106,21 @@ A fair *head-to-head* on a shared benchmark harness against Graphiti / LightRAG
106
106
  | Recall ceiling on hard multi-hop QA | lower (rules default) | higher (LLM extraction) |
107
107
 
108
108
  **Honest weaknesses:** the deterministic default trades peak recall for determinism + provenance — an LLM extractor will find edges our rules miss (see the coref error above), which is exactly why the `[ie]` GLiNER and opt-in L4 LLM paths exist. Where we win is *trust*: reproducibility and re-verifiable citations, which the peers largely do not offer. A shared-harness QA comparison is tracked as future work and will be added here only when it can be run fairly.
109
+
110
+
111
+ ## Zero-config defaults (PDF + entity resolution)
112
+
113
+ A default install (`pip install textgraph-kg`, no flags, no extras) already ingests PDFs and resolves entity aliases. Proof:
114
+
115
+ - **PDF ingestion, default:** a generated `.pdf` ingests as `format=pdf` (OK) -- `pypdf` is a core dependency, no `[ingest]` extra required.
116
+
117
+ - **Entity resolution, default** (rules backend) -- before/after on a fixed 3-doc corpus where one org appears as *Acme Corporation / Acme Corp / ACME*. Resolution is non-destructive (aliases are kept and linked, not deleted), so the win is *unified identity*, not fewer nodes:
118
+
119
+ | | Acme surface forms | SAME_AS links | canonical identities |
120
+ |---|---|---|---|
121
+ | ER off (`resolve_entities=False`) | 2 | 0 | 0 |
122
+ | **ER on (default)** | 2 | 2 | 1 |
123
+
124
+ With ER on, the 2 surface forms are unified under 1 canonical identity via 2 cited `SAME_AS` link(s) -- so a query for `ACME` reaches facts filed under `Acme Corporation`, and PageRank/paths treat them as one node. Zero configuration.
125
+
126
+ - **Latency** (machine-dependent): build 38 ms (ER on) vs 29 ms (ER off); a hybrid `search` over the resolved graph in 1.0 ms.
@@ -6,6 +6,42 @@ to Semantic Versioning.
6
6
 
7
7
  ## [Unreleased]
8
8
 
9
+ ## [3.3.2] - 2026-08-08
10
+
11
+ **Prove & guard the investigator defaults.** PDF ingestion and entity resolution have run
12
+ by default since 3.0 — this release makes that *visible and regression-proof*, per the
13
+ "do users know it does?" gap in the market review.
14
+
15
+ ### Added
16
+ - **`benchmarks/defaults.py`** — a zero-config-defaults benchmark: proves a *default* install
17
+ (no flags, no extras) ingests PDFs (`pypdf` core) and resolves entity aliases (rules ER),
18
+ with a **before/after** table (Acme surface forms unified under one canonical via `SAME_AS`)
19
+ and build/query latency. Written into [BENCHMARKS.md](BENCHMARKS.md).
20
+ - **Regression guard** (`tests/unit/test_defaults.py`) — locks in: PDF ingests on the default
21
+ install, `pypdf` stays a *core* dependency (not the `[ingest]` extra), entity resolution is
22
+ on by default (`resolve_entities=True`, `er_backend="rules"`), and a default build resolves
23
+ aliases into a canonical identity — so these defaults can never silently regress.
24
+ - **README "Works out of the box" section** — makes the zero-config defaults (PDF, entity
25
+ resolution, hybrid retrieval, opt-in LLM) explicit up front.
26
+
27
+ ### Fixed
28
+ - **`--llm-extract` no longer silently runs L4 community summaries.** It was coupled to
29
+ `llm_enabled`, so `build --llm-extract` also produced `SUMMARIZES` (GENERATED) edges — the
30
+ build summary reported only the extraction count (e.g. "24 LLM relations") while the graph
31
+ held more GENERATED edges (e.g. 33), which read as a miscount. Extraction is now gated on
32
+ `llm_extract` alone (independent of the summaries switch), so `--llm-extract` adds only
33
+ cited extraction relations and the reported count **equals** the GENERATED edges it added.
34
+ Community summaries stay on `--llm`; the build summary now reports both counts separately.
35
+
36
+ ## [3.3.1] - 2026-08-08
37
+
38
+ ### Changed
39
+ - **Positioning/description refreshed** across PyPI summary, `README`, `__init__`, and the
40
+ demo landing page: leads with **deterministic & local-first by default**, now explicitly
41
+ naming the **opt-in LLM extraction, grounded answer synthesis, and semantic (embedding)
42
+ search** added in 3.2 (all `GENERATED`-quarantined). Replaces the outdated
43
+ "zero-LLM-by-default" phrasing that under-sold the LLM capabilities. No code changes.
44
+
9
45
  ## [3.3.0] - 2026-08-08
10
46
 
11
47
  **Semantic-web interop — closing the RDF / ontology gap with polyglot peers.** New
@@ -1,7 +1,7 @@
1
- Metadata-Version: 2.4
1
+ Metadata-Version: 2.5
2
2
  Name: textgraph-kg
3
- Version: 3.3.0
4
- Summary: Turn any textual corpus into a queryable knowledge graph with byte-level provenance on every claim. Local-first, deterministic, zero-LLM-by-default.
3
+ Version: 3.3.2
4
+ Summary: Turn any textual corpus into a queryable, byte-cited knowledge graph. Deterministic & local-first by default, with opt-in LLM extraction, grounded answer synthesis, and semantic (embedding) search.
5
5
  Project-URL: Homepage, https://krishddd.github.io/Wiki_textgraph/
6
6
  Project-URL: Repository, https://github.com/krishddd/Wiki_textgraph
7
7
  Project-URL: Documentation, https://github.com/krishddd/Wiki_textgraph/blob/main/docs/RUNNING.md
@@ -99,7 +99,7 @@ Description-Content-Type: text/markdown
99
99
  [![Live demo](https://img.shields.io/badge/demo-graph.html-3b5bdb?logo=googlechrome&logoColor=white)](https://krishddd.github.io/Wiki_textgraph/)
100
100
  [![License: MIT](https://img.shields.io/badge/license-MIT-green)](LICENSE)
101
101
 
102
- > Turn a pile of case documents into a **queryable knowledge graph with byte-level provenance on every claim** — local-first, deterministic, and agent-legible.
102
+ > Turn a pile of case documents into a **queryable, byte-cited knowledge graph** — **deterministic & local-first by default**, with **opt-in LLM extraction, grounded answer synthesis, and semantic search** layered on top (always `GENERATED`-quarantined, never masquerading as ground truth).
103
103
  >
104
104
  > **`pip install textgraph-kg`** · **[Live demo →](https://krishddd.github.io/Wiki_textgraph/)** · **[vs. Semantica →](docs/COMPARISON_SEMANTICA.md)**
105
105
 
@@ -107,6 +107,18 @@ TextGraph is built to help investigators make sense of **financial-crime and tec
107
107
 
108
108
  It is the natural-language successor to [**llm-wiki**](https://github.com/krishddd/llm-wiki): where `llm-wiki` gave an agent cited, streaming answers over Wikipedia, TextGraph generalizes that to **any textual corpus** and produces a graph an agent can traverse — multi-hop relationship discovery, contradiction detection, temporal reasoning, and provenance-backed retrieval — not just a stream of prose.
109
109
 
110
+ ## Works out of the box (zero config)
111
+
112
+ `pip install textgraph-kg` → `textgraph build ./docs` already does the investigator happy
113
+ path — **no flags, no extras, no API key, no server:**
114
+
115
+ - 📄 **PDFs ingest by default** — `pypdf` is a *core* dependency (investigators live in PDFs). `.docx`/`.html`/`.epub`/logs/chat too. (Docling layout/table/OCR is the only opt-in, in `[ingest]`.)
116
+ - 🔗 **Entity resolution is on by default** — `Acme Corporation` / `Acme Corp` / `ACME` collapse to one canonical identity via cited `SAME_AS`, so a query for one reaches facts filed under the others. Deterministic rules backend; Splink stays optional in `[er]`.
117
+ - 🔎 **Hybrid retrieval by default** — BM25 + Personalized-PageRank + RRF, every hit cited.
118
+ - 🧠 **LLM & embeddings are opt-in** — `--llm-extract`, `--narrate`, `--embed` layer on top, always `GENERATED`-quarantined; the default stays deterministic and offline.
119
+
120
+ Numbers for the PDF + entity-resolution defaults (before/after) are in [BENCHMARKS.md](BENCHMARKS.md#zero-config-defaults-pdf--entity-resolution).
121
+
110
122
  ## Why it's different (vs "GraphRAG")
111
123
 
112
124
  Most GraphRAG tools build the graph *with an LLM*: extraction is non-deterministic, edges arrive without verifiable sources, and you can't reproduce or audit the result. TextGraph inverts that. The edge is **trust**, not just recall:
@@ -7,7 +7,7 @@
7
7
  [![Live demo](https://img.shields.io/badge/demo-graph.html-3b5bdb?logo=googlechrome&logoColor=white)](https://krishddd.github.io/Wiki_textgraph/)
8
8
  [![License: MIT](https://img.shields.io/badge/license-MIT-green)](LICENSE)
9
9
 
10
- > Turn a pile of case documents into a **queryable knowledge graph with byte-level provenance on every claim** — local-first, deterministic, and agent-legible.
10
+ > Turn a pile of case documents into a **queryable, byte-cited knowledge graph** — **deterministic & local-first by default**, with **opt-in LLM extraction, grounded answer synthesis, and semantic search** layered on top (always `GENERATED`-quarantined, never masquerading as ground truth).
11
11
  >
12
12
  > **`pip install textgraph-kg`** · **[Live demo →](https://krishddd.github.io/Wiki_textgraph/)** · **[vs. Semantica →](docs/COMPARISON_SEMANTICA.md)**
13
13
 
@@ -15,6 +15,18 @@ TextGraph is built to help investigators make sense of **financial-crime and tec
15
15
 
16
16
  It is the natural-language successor to [**llm-wiki**](https://github.com/krishddd/llm-wiki): where `llm-wiki` gave an agent cited, streaming answers over Wikipedia, TextGraph generalizes that to **any textual corpus** and produces a graph an agent can traverse — multi-hop relationship discovery, contradiction detection, temporal reasoning, and provenance-backed retrieval — not just a stream of prose.
17
17
 
18
+ ## Works out of the box (zero config)
19
+
20
+ `pip install textgraph-kg` → `textgraph build ./docs` already does the investigator happy
21
+ path — **no flags, no extras, no API key, no server:**
22
+
23
+ - 📄 **PDFs ingest by default** — `pypdf` is a *core* dependency (investigators live in PDFs). `.docx`/`.html`/`.epub`/logs/chat too. (Docling layout/table/OCR is the only opt-in, in `[ingest]`.)
24
+ - 🔗 **Entity resolution is on by default** — `Acme Corporation` / `Acme Corp` / `ACME` collapse to one canonical identity via cited `SAME_AS`, so a query for one reaches facts filed under the others. Deterministic rules backend; Splink stays optional in `[er]`.
25
+ - 🔎 **Hybrid retrieval by default** — BM25 + Personalized-PageRank + RRF, every hit cited.
26
+ - 🧠 **LLM & embeddings are opt-in** — `--llm-extract`, `--narrate`, `--embed` layer on top, always `GENERATED`-quarantined; the default stays deterministic and offline.
27
+
28
+ Numbers for the PDF + entity-resolution defaults (before/after) are in [BENCHMARKS.md](BENCHMARKS.md#zero-config-defaults-pdf--entity-resolution).
29
+
18
30
  ## Why it's different (vs "GraphRAG")
19
31
 
20
32
  Most GraphRAG tools build the graph *with an LLM*: extraction is non-deterministic, edges arrive without verifiable sources, and you can't reproduce or audit the result. TextGraph inverts that. The edge is **trust**, not just recall:
@@ -0,0 +1,140 @@
1
+ """Zero-config defaults benchmark — PDF ingestion + entity resolution run out of the box.
2
+
3
+ Investigators shouldn't have to configure the happy path. This proves, with numbers, that a
4
+ **default install** (no flags, no extras) already:
5
+
6
+ 1. **ingests PDFs** — ``pypdf`` is a core dependency, so a ``.pdf`` is read out of the box
7
+ (Docling stays opt-in in ``[ingest]`` for layout/table/OCR fidelity only); and
8
+ 2. **resolves entity aliases** — the rules entity-resolution backend is on by default, so
9
+ ``Acme Corporation`` / ``Acme Corp`` / ``ACME`` collapse to one canonical node.
10
+
11
+ It also reports the **before/after** quality lift from entity resolution (distinct
12
+ organizations before vs after) — the "clean before/after story" — plus build and query
13
+ latency. Correctness counts are deterministic; wall-clock latency is reported separately (G7).
14
+
15
+ Usage:
16
+ python -m benchmarks.defaults # print the report
17
+ python -m benchmarks.defaults --write # also append the block to BENCHMARKS.md
18
+ """
19
+
20
+ from __future__ import annotations
21
+
22
+ import argparse
23
+ import sys
24
+ import tempfile
25
+ import time
26
+ from pathlib import Path
27
+
28
+ from textgraph.core.config import Config
29
+ from textgraph.l8_retrieval import QueryEngine
30
+ from textgraph.pipeline import build
31
+
32
+ REPO = Path(__file__).resolve().parent.parent
33
+
34
+ # A tiny fixed corpus where one organization appears under three surface forms.
35
+ _ALIAS_CORPUS = {
36
+ "filing-a.md": "Acme Corporation controls Beta Ltd. Acme Corporation owns Delta Trust.",
37
+ "filing-b.md": "Acme Corp transferred funds to Beta Ltd on 2020-03-01.",
38
+ "filing-c.md": "ACME is the beneficial owner of Beta Ltd.",
39
+ }
40
+
41
+
42
+ def _acme_aliases(nodes: list) -> int:
43
+ """Distinct extracted 'Acme' surface forms (alias entity nodes, not the canonical)."""
44
+ return sum(
45
+ 1
46
+ for n in nodes
47
+ if n.properties.get("etype") == "Organization"
48
+ and "acme" in str(n.properties.get("name", "")).lower()
49
+ and "Canonical" not in n.labels
50
+ )
51
+
52
+
53
+ def _pdf_default() -> tuple[bool, str]:
54
+ """Ingest a generated PDF with the default install; return (ok, format)."""
55
+ try:
56
+ from pypdf import PdfWriter
57
+ from textgraph.l0_ingest import ingest_path
58
+ except ImportError: # pragma: no cover - pypdf is a core dep
59
+ return False, "pypdf-missing"
60
+ with tempfile.TemporaryDirectory() as d:
61
+ p = Path(d) / "note.pdf"
62
+ w = PdfWriter()
63
+ w.add_blank_page(width=200, height=200)
64
+ with open(p, "wb") as fh:
65
+ w.write(fh)
66
+ ir = ingest_path(p)
67
+ return ir.format == "pdf", ir.format
68
+
69
+
70
+ def _build_alias(resolve: bool) -> tuple[object, float]:
71
+ with tempfile.TemporaryDirectory() as d:
72
+ root = Path(d)
73
+ for name, text in _ALIAS_CORPUS.items():
74
+ (root / name).write_text(text, encoding="utf-8")
75
+ t0 = time.perf_counter()
76
+ result = build(root, config=Config(resolve_entities=resolve))
77
+ return result, (time.perf_counter() - t0) * 1000
78
+
79
+
80
+ def report() -> str:
81
+ pdf_ok, pdf_fmt = _pdf_default()
82
+
83
+ off, off_ms = _build_alias(resolve=False)
84
+ on, on_ms = _build_alias(resolve=True)
85
+ aliases_off = _acme_aliases(off.nodes) # type: ignore[attr-defined]
86
+ aliases_on = _acme_aliases(on.nodes) # type: ignore[attr-defined]
87
+ same_as = sum(1 for e in on.edges if e.predicate == "SAME_AS") # type: ignore[attr-defined]
88
+ canon = sum(1 for n in on.nodes if "Canonical" in n.labels) # type: ignore[attr-defined]
89
+
90
+ engine = QueryEngine(on.nodes, on.edges) # type: ignore[attr-defined]
91
+ t0 = time.perf_counter()
92
+ engine.search("who controls Beta Ltd", k=5)
93
+ query_ms = (time.perf_counter() - t0) * 1000
94
+
95
+ lines = [
96
+ "## Zero-config defaults (PDF + entity resolution)",
97
+ "",
98
+ "A default install (`pip install textgraph-kg`, no flags, no extras) already ingests "
99
+ "PDFs and resolves entity aliases. Proof:",
100
+ "",
101
+ f"- **PDF ingestion, default:** a generated `.pdf` ingests as `format={pdf_fmt}` "
102
+ f"({'OK' if pdf_ok else 'FAILED'}) -- `pypdf` is a core dependency, no `[ingest]` "
103
+ "extra required.",
104
+ "",
105
+ "- **Entity resolution, default** (rules backend) -- before/after on a fixed 3-doc "
106
+ "corpus where one org appears as *Acme Corporation / Acme Corp / ACME*. Resolution is "
107
+ "non-destructive (aliases are kept and linked, not deleted), so the win is *unified "
108
+ "identity*, not fewer nodes:",
109
+ "",
110
+ "| | Acme surface forms | SAME_AS links | canonical identities |",
111
+ "|---|---|---|---|",
112
+ f"| ER off (`resolve_entities=False`) | {aliases_off} | 0 | 0 |",
113
+ f"| **ER on (default)** | {aliases_on} | {same_as} | {canon} |",
114
+ "",
115
+ f"With ER on, the {aliases_on} surface forms are unified under {canon} canonical "
116
+ f"identity via {same_as} cited `SAME_AS` link(s) -- so a query for `ACME` reaches "
117
+ "facts filed under `Acme Corporation`, and PageRank/paths treat them as one node. "
118
+ "Zero configuration.",
119
+ "",
120
+ f"- **Latency** (machine-dependent): build {on_ms:.0f} ms (ER on) vs {off_ms:.0f} ms "
121
+ f"(ER off); a hybrid `search` over the resolved graph in {query_ms:.1f} ms.",
122
+ ]
123
+ return "\n".join(lines)
124
+
125
+
126
+ def main(argv: list[str] | None = None) -> int:
127
+ ap = argparse.ArgumentParser(description=__doc__)
128
+ ap.add_argument("--write", action="store_true", help="append the block to BENCHMARKS.md")
129
+ args = ap.parse_args(argv)
130
+ block = report()
131
+ print(block)
132
+ if args.write:
133
+ path = REPO / "BENCHMARKS.md"
134
+ path.write_text(path.read_text(encoding="utf-8") + "\n\n" + block + "\n", encoding="utf-8")
135
+ print(f"\n-> appended to {path}", file=sys.stderr)
136
+ return 0
137
+
138
+
139
+ if __name__ == "__main__":
140
+ raise SystemExit(main())
@@ -52,8 +52,10 @@
52
52
  </header>
53
53
 
54
54
  <h1>Deterministic, cited knowledge graphs from your documents.</h1>
55
- <p class="tag">Local-first. Byte-level provenance on every edge. Zero LLM by default — so the
56
- same corpus always yields a <strong>byte-identical</strong> graph you can audit and re-verify.</p>
55
+ <p class="tag">Local-first, with byte-level provenance on every edge. <strong>Deterministic by
56
+ default</strong> — the same corpus always yields a byte-identical graph you can audit and
57
+ re-verify — with <strong>opt-in LLM extraction, grounded answer synthesis, and semantic
58
+ search</strong> layered on top, always quarantined so model output never poses as ground truth.</p>
57
59
 
58
60
  <div class="cta">
59
61
  <a class="btn primary" href="./graph.html">Open the interactive demo →</a>
@@ -1,7 +1,7 @@
1
1
  [project]
2
2
  name = "textgraph-kg"
3
- version = "3.3.0"
4
- description = "Turn any textual corpus into a queryable knowledge graph with byte-level provenance on every claim. Local-first, deterministic, zero-LLM-by-default."
3
+ version = "3.3.2"
4
+ description = "Turn any textual corpus into a queryable, byte-cited knowledge graph. Deterministic & local-first by default, with opt-in LLM extraction, grounded answer synthesis, and semantic (embedding) search."
5
5
  readme = "README.md"
6
6
  requires-python = ">=3.11"
7
7
  license = { text = "MIT" }
@@ -0,0 +1,58 @@
1
+ """Investigator zero-config defaults — regression guard.
2
+
3
+ The moat is that the *default* install (no flags, no extras) already does the investigator
4
+ happy path: ingest PDFs and resolve entity aliases. These tests lock that in so it can never
5
+ silently regress behind an extra or a config flag again.
6
+ """
7
+
8
+ import tempfile
9
+ from pathlib import Path
10
+
11
+ from textgraph.core.config import Config
12
+ from textgraph.l0_ingest import ingest_path
13
+ from textgraph.pipeline import build
14
+
15
+
16
+ def test_pdf_ingests_on_the_default_install() -> None:
17
+ # pypdf is a CORE dependency (not the [ingest] extra), so a .pdf reads out of the box.
18
+ from pypdf import PdfWriter
19
+
20
+ with tempfile.TemporaryDirectory() as d:
21
+ pdf = Path(d) / "note.pdf"
22
+ writer = PdfWriter()
23
+ writer.add_blank_page(width=200, height=200)
24
+ with open(pdf, "wb") as fh:
25
+ writer.write(fh)
26
+ ir = ingest_path(pdf)
27
+ assert ir.format == "pdf"
28
+ assert ir.doc_id # content-addressed id assigned
29
+
30
+
31
+ def test_entity_resolution_is_on_by_default() -> None:
32
+ cfg = Config()
33
+ assert cfg.resolve_entities is True
34
+ assert cfg.er_backend == "rules" # deterministic, dependency-free default (not Splink)
35
+
36
+
37
+ def test_default_build_resolves_aliases_without_flags() -> None:
38
+ with tempfile.TemporaryDirectory() as d:
39
+ root = Path(d)
40
+ (root / "a.md").write_text("Acme Corporation controls Beta Ltd.", encoding="utf-8")
41
+ (root / "b.md").write_text("Acme Corp transferred funds to Beta Ltd.", encoding="utf-8")
42
+ (root / "c.md").write_text("ACME is the beneficial owner of Beta Ltd.", encoding="utf-8")
43
+ r = build(root) # DEFAULT config — no --er, no extras
44
+ same_as = [e for e in r.edges if e.predicate == "SAME_AS"]
45
+ canonical = [n for n in r.nodes if "Canonical" in n.labels]
46
+ assert same_as, "default build must resolve the Acme aliases (SAME_AS)"
47
+ assert canonical, "default build must produce a canonical identity"
48
+ assert r.er_stats.get("same_as_edges", 0) == len(same_as)
49
+
50
+
51
+ def test_pdf_is_a_core_dependency_not_an_extra() -> None:
52
+ # Guard the packaging: pypdf must stay in [project.dependencies], never behind [ingest].
53
+ import tomllib
54
+
55
+ root = Path(__file__).resolve().parent.parent.parent
56
+ pyproject = tomllib.loads((root / "pyproject.toml").read_text(encoding="utf-8"))
57
+ core = " ".join(pyproject["project"]["dependencies"])
58
+ assert "pypdf" in core, "pypdf must be a core dependency (PDF ingestion is default)"
@@ -7,6 +7,8 @@ separately.
7
7
 
8
8
  from pathlib import Path
9
9
 
10
+ import pytest
11
+ from textgraph.core.config import Config
10
12
  from textgraph.l4_llm_optional.cache import PromptCache
11
13
  from textgraph.l4_llm_optional.extract import _parse_triples, extract_llm_relations
12
14
  from textgraph.l8_retrieval.model import Citation
@@ -98,6 +100,40 @@ def test_llm_extract_off_by_default() -> None:
98
100
  assert all(str(e.tag) != "GENERATED" for e in r.edges) # no GENERATED edges by default
99
101
 
100
102
 
103
+ class _TripleClient:
104
+ """Stub whose completion parses as one extraction triple (and doubles as summary text)."""
105
+
106
+ model = "stub-model"
107
+ temperature = 0.0
108
+ max_tokens = 256
109
+
110
+ def complete(self, system: str, user: str) -> str:
111
+ return '[{"subject":"Alpha","predicate":"relates to","object":"Beta"}]'
112
+
113
+
114
+ def test_llm_extract_count_matches_generated_edges(monkeypatch: pytest.MonkeyPatch) -> None:
115
+ # The reported `llm_relations` must equal the GENERATED edges added — no hidden summary
116
+ # edges inflating the graph (the count-bug fix): --llm-extract does extraction ONLY.
117
+ import textgraph.l4_llm_optional as l4
118
+
119
+ monkeypatch.setattr(l4, "resolve_client", lambda config: _TripleClient())
120
+ r = build(DOCS, config=Config(llm_extract=True)) # llm_enabled defaults False
121
+ generated = [e for e in r.edges if str(e.tag) == "GENERATED"]
122
+ assert r.graph_stats["llm_relations"] == len(generated) > 0 # count is exact
123
+ assert r.graph_stats.get("summaries", 0) == 0 # extraction did NOT trigger summaries
124
+ assert not [n for n in r.nodes if "Summary" in n.labels]
125
+ assert all(e.properties.get("source") == "llm" for e in generated)
126
+
127
+
128
+ def test_summaries_are_decoupled_from_extraction(monkeypatch: pytest.MonkeyPatch) -> None:
129
+ import textgraph.l4_llm_optional as l4
130
+
131
+ monkeypatch.setattr(l4, "resolve_client", lambda config: _TripleClient())
132
+ r = build(DOCS, config=Config(llm_enabled=True)) # summaries switch only
133
+ assert r.graph_stats["summaries"] >= 1
134
+ assert r.graph_stats.get("llm_relations", 0) == 0 # extraction did NOT run
135
+
136
+
101
137
  # --- synthesis (output) ------------------------------------------------------
102
138
 
103
139
 
@@ -0,0 +1,8 @@
1
+ """TextGraph: any textual corpus -> queryable knowledge graph with byte-level provenance.
2
+
3
+ Deterministic & local-first by default; opt-in LLM extraction, grounded answer synthesis,
4
+ and semantic (embedding) search layer on top, always GENERATED-quarantined. See
5
+ ARCHITECTURE.md for the L0-L9 stack.
6
+ """
7
+
8
+ __version__ = "3.3.2"
@@ -614,8 +614,11 @@ def _cmd_build(args: argparse.Namespace) -> int:
614
614
  from textgraph.core.config import Config
615
615
 
616
616
  cred = json.loads(Path(args.credibility).read_text("utf-8")) if args.credibility else {}
617
+ # `--llm` drives L4 community summaries; `--llm-extract` drives relation extraction.
618
+ # They are independent — extraction reads the LLM env directly, so it doesn't need the
619
+ # summaries switch (and enabling it would silently add summary edges to the count).
617
620
  config = Config(
618
- llm_enabled=bool(args.llm) or bool(args.llm_extract),
621
+ llm_enabled=bool(args.llm),
619
622
  llm_extract=bool(args.llm_extract),
620
623
  resolve_conflicts_strategy=args.resolve_conflicts or "",
621
624
  source_credibility=cred,
@@ -655,6 +658,8 @@ def _cmd_build(args: argparse.Namespace) -> int:
655
658
  )
656
659
  if gs.get("llm_relations"):
657
660
  print(f" + {gs['llm_relations']} LLM relations (GENERATED, cited, quarantined)")
661
+ if gs.get("summaries"):
662
+ print(f" + {gs['summaries']} LLM community summaries (GENERATED)")
658
663
  print(f" {paths.graph_json}")
659
664
  print(f" {paths.report}")
660
665
  print(f" {paths.graph_html}")
@@ -370,9 +370,11 @@ def build(
370
370
  l8_ms = (time.perf_counter() - t6) * 1000
371
371
 
372
372
  # LLM relation enrichment (opt-in, GENERATED). Runs the LLM over chunks to add relations
373
- # the deterministic extractors missed; quarantined by tag, bounded by budget (G7).
373
+ # the deterministic extractors missed; quarantined by tag, bounded by budget (G7). Gated
374
+ # on `llm_extract` alone (independent of `llm_enabled`, which drives L4 summaries) so
375
+ # `--llm-extract` adds only extraction relations — not community summaries.
374
376
  gen_relation_count = 0
375
- if config.llm_enabled and config.llm_extract and config.emit_chunks:
377
+ if config.llm_extract and config.emit_chunks:
376
378
  gen_nodes, gen_edges = _run_llm_extract(nodes, edges, config, cache_dir)
377
379
  gen_relation_count = len(gen_edges)
378
380
  if gen_edges:
@@ -5169,7 +5169,7 @@ wheels = [
5169
5169
 
5170
5170
  [[package]]
5171
5171
  name = "textgraph-kg"
5172
- version = "3.3.0"
5172
+ version = "3.3.2"
5173
5173
  source = { editable = "." }
5174
5174
  dependencies = [
5175
5175
  { name = "blake3" },
@@ -1,6 +0,0 @@
1
- """TextGraph: any textual corpus -> queryable knowledge graph with byte-level provenance.
2
-
3
- Local-first, deterministic, zero-LLM-by-default. See ARCHITECTURE.md for the L0-L9 stack.
4
- """
5
-
6
- __version__ = "3.3.0"
File without changes
File without changes
File without changes
File without changes
File without changes