ennoia 0.1.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.
Files changed (102) hide show
  1. ennoia-0.1.0/.github/workflows/ci.yml +53 -0
  2. ennoia-0.1.0/.github/workflows/release.yml +45 -0
  3. ennoia-0.1.0/.gitignore +43 -0
  4. ennoia-0.1.0/.pre-commit-config.yaml +16 -0
  5. ennoia-0.1.0/CHANGELOG.md +49 -0
  6. ennoia-0.1.0/CONTRIBUTING.md +62 -0
  7. ennoia-0.1.0/LICENSE.txt +202 -0
  8. ennoia-0.1.0/NOTICE +17 -0
  9. ennoia-0.1.0/PKG-INFO +164 -0
  10. ennoia-0.1.0/README.md +107 -0
  11. ennoia-0.1.0/docs/adapters.md +58 -0
  12. ennoia-0.1.0/docs/cli.md +81 -0
  13. ennoia-0.1.0/docs/concepts.md +89 -0
  14. ennoia-0.1.0/docs/filters.md +148 -0
  15. ennoia-0.1.0/docs/quickstart.md +77 -0
  16. ennoia-0.1.0/docs/schemas.md +135 -0
  17. ennoia-0.1.0/docs/stores.md +83 -0
  18. ennoia-0.1.0/ennoia/__init__.py +29 -0
  19. ennoia-0.1.0/ennoia/__main__.py +6 -0
  20. ennoia-0.1.0/ennoia/adapters/__init__.py +1 -0
  21. ennoia-0.1.0/ennoia/adapters/embedding/__init__.py +5 -0
  22. ennoia-0.1.0/ennoia/adapters/embedding/openai.py +53 -0
  23. ennoia-0.1.0/ennoia/adapters/embedding/protocols.py +14 -0
  24. ennoia-0.1.0/ennoia/adapters/embedding/sentence_transformers.py +39 -0
  25. ennoia-0.1.0/ennoia/adapters/llm/__init__.py +5 -0
  26. ennoia-0.1.0/ennoia/adapters/llm/anthropic.py +81 -0
  27. ennoia-0.1.0/ennoia/adapters/llm/ollama.py +64 -0
  28. ennoia-0.1.0/ennoia/adapters/llm/openai.py +71 -0
  29. ennoia-0.1.0/ennoia/adapters/llm/protocols.py +14 -0
  30. ennoia-0.1.0/ennoia/cli/__init__.py +5 -0
  31. ennoia-0.1.0/ennoia/cli/factories.py +72 -0
  32. ennoia-0.1.0/ennoia/cli/main.py +225 -0
  33. ennoia-0.1.0/ennoia/events/__init__.py +20 -0
  34. ennoia-0.1.0/ennoia/events/emitter.py +46 -0
  35. ennoia-0.1.0/ennoia/events/types.py +41 -0
  36. ennoia-0.1.0/ennoia/index/__init__.py +14 -0
  37. ennoia-0.1.0/ennoia/index/dag.py +34 -0
  38. ennoia-0.1.0/ennoia/index/exceptions.py +50 -0
  39. ennoia-0.1.0/ennoia/index/executor.py +149 -0
  40. ennoia-0.1.0/ennoia/index/extractor.py +216 -0
  41. ennoia-0.1.0/ennoia/index/pipeline.py +189 -0
  42. ennoia-0.1.0/ennoia/index/query.py +38 -0
  43. ennoia-0.1.0/ennoia/index/result.py +62 -0
  44. ennoia-0.1.0/ennoia/index/validation.py +79 -0
  45. ennoia-0.1.0/ennoia/py.typed +0 -0
  46. ennoia-0.1.0/ennoia/schema/__init__.py +56 -0
  47. ennoia-0.1.0/ennoia/schema/base.py +85 -0
  48. ennoia-0.1.0/ennoia/schema/fields.py +63 -0
  49. ennoia-0.1.0/ennoia/schema/operators.py +158 -0
  50. ennoia-0.1.0/ennoia/store/__init__.py +15 -0
  51. ennoia-0.1.0/ennoia/store/base.py +74 -0
  52. ennoia-0.1.0/ennoia/store/composite.py +42 -0
  53. ennoia-0.1.0/ennoia/store/hybrid/__init__.py +1 -0
  54. ennoia-0.1.0/ennoia/store/structured/__init__.py +5 -0
  55. ennoia-0.1.0/ennoia/store/structured/memory.py +25 -0
  56. ennoia-0.1.0/ennoia/store/structured/parquet.py +61 -0
  57. ennoia-0.1.0/ennoia/store/structured/sqlite.py +157 -0
  58. ennoia-0.1.0/ennoia/store/vector/__init__.py +5 -0
  59. ennoia-0.1.0/ennoia/store/vector/_numpy.py +48 -0
  60. ennoia-0.1.0/ennoia/store/vector/filesystem.py +80 -0
  61. ennoia-0.1.0/ennoia/store/vector/memory.py +31 -0
  62. ennoia-0.1.0/ennoia/utils/__init__.py +29 -0
  63. ennoia-0.1.0/ennoia/utils/filters.py +166 -0
  64. ennoia-0.1.0/ennoia/utils/ids.py +40 -0
  65. ennoia-0.1.0/ennoia/utils/imports.py +22 -0
  66. ennoia-0.1.0/examples/README.md +34 -0
  67. ennoia-0.1.0/examples/cli_walkthrough.sh +44 -0
  68. ennoia-0.1.0/examples/describe_schema.py +42 -0
  69. ennoia-0.1.0/examples/extend_branching.py +66 -0
  70. ennoia-0.1.0/examples/filter_miss.py +60 -0
  71. ennoia-0.1.0/examples/fixtures/case_001.txt +5 -0
  72. ennoia-0.1.0/examples/fixtures/filing_003.txt +4 -0
  73. ennoia-0.1.0/examples/fixtures/note_002.txt +3 -0
  74. ennoia-0.1.0/examples/hello_world.py +72 -0
  75. ennoia-0.1.0/examples/multi_schema.py +74 -0
  76. ennoia-0.1.0/examples/schemas.py +23 -0
  77. ennoia-0.1.0/pyproject.toml +103 -0
  78. ennoia-0.1.0/tests/__init__.py +0 -0
  79. ennoia-0.1.0/tests/test_adapter_anthropic.py +83 -0
  80. ennoia-0.1.0/tests/test_adapter_loop_lifecycle.py +136 -0
  81. ennoia-0.1.0/tests/test_adapter_openai.py +78 -0
  82. ennoia-0.1.0/tests/test_adapter_openai_embedding.py +53 -0
  83. ennoia-0.1.0/tests/test_cli_commands.py +167 -0
  84. ennoia-0.1.0/tests/test_cli_factories.py +54 -0
  85. ennoia-0.1.0/tests/test_confidence_and_extend_context.py +104 -0
  86. ennoia-0.1.0/tests/test_dag.py +46 -0
  87. ennoia-0.1.0/tests/test_events.py +86 -0
  88. ennoia-0.1.0/tests/test_extractor_prompt.py +96 -0
  89. ennoia-0.1.0/tests/test_filter_validation.py +79 -0
  90. ennoia-0.1.0/tests/test_memory_stores.py +76 -0
  91. ennoia-0.1.0/tests/test_operators_inference.py +94 -0
  92. ennoia-0.1.0/tests/test_parallel_executor.py +69 -0
  93. ennoia-0.1.0/tests/test_pipeline_with_fakes.py +178 -0
  94. ennoia-0.1.0/tests/test_schema.py +49 -0
  95. ennoia-0.1.0/tests/test_store_abc.py +47 -0
  96. ennoia-0.1.0/tests/test_store_filesystem.py +52 -0
  97. ennoia-0.1.0/tests/test_store_sqlite.py +57 -0
  98. ennoia-0.1.0/tests/test_utils_filters.py +296 -0
  99. ennoia-0.1.0/tests/test_utils_filters_extended.py +54 -0
  100. ennoia-0.1.0/tests/test_utils_ids.py +64 -0
  101. ennoia-0.1.0/tests/test_utils_imports.py +30 -0
  102. ennoia-0.1.0/uv.lock +1932 -0
@@ -0,0 +1,53 @@
1
+ name: CI
2
+
3
+ on:
4
+ push:
5
+ branches: [main]
6
+ pull_request:
7
+
8
+ concurrency:
9
+ group: ci-${{ github.ref }}
10
+ cancel-in-progress: true
11
+
12
+ jobs:
13
+ test:
14
+ name: Run tests and collect coverage (Python ${{ matrix.python-version }})
15
+ runs-on: ubuntu-latest
16
+ strategy:
17
+ fail-fast: false
18
+ matrix:
19
+ python-version: ["3.11", "3.12", "3.13"]
20
+ steps:
21
+ - name: Checkout
22
+ uses: actions/checkout@v4
23
+ with:
24
+ fetch-depth: 2
25
+
26
+ - name: Set up Python
27
+ uses: actions/setup-python@v5
28
+ with:
29
+ python-version: ${{ matrix.python-version }}
30
+ cache: pip
31
+
32
+ - name: Install dependencies
33
+ run: |
34
+ python -m pip install --upgrade pip
35
+ pip install -e ".[all,dev]"
36
+
37
+ - name: Lint (ruff check)
38
+ run: ruff check .
39
+
40
+ - name: Format (ruff format --check)
41
+ run: ruff format --check .
42
+
43
+ - name: Type-check (pyright strict)
44
+ run: pyright
45
+
46
+ - name: Run tests
47
+ run: pytest --cov --cov-branch --cov-report=xml
48
+
49
+ - name: Upload results to Codecov
50
+ if: matrix.python-version == '3.12'
51
+ uses: codecov/codecov-action@v5
52
+ with:
53
+ token: ${{ secrets.CODECOV_TOKEN }}
@@ -0,0 +1,45 @@
1
+ name: Release
2
+
3
+ on:
4
+ push:
5
+ tags: ["v*"]
6
+
7
+ jobs:
8
+ build:
9
+ name: Build sdist + wheel
10
+ runs-on: ubuntu-latest
11
+ steps:
12
+ - uses: actions/checkout@v4
13
+
14
+ - uses: actions/setup-python@v5
15
+ with:
16
+ python-version: "3.12"
17
+
18
+ - name: Install build tooling
19
+ run: python -m pip install --upgrade pip build
20
+
21
+ - name: Build
22
+ run: python -m build
23
+
24
+ - uses: actions/upload-artifact@v4
25
+ with:
26
+ name: dist
27
+ path: dist/
28
+
29
+ publish:
30
+ name: Publish to PyPI
31
+ needs: build
32
+ runs-on: ubuntu-latest
33
+ # PyPI trusted publisher (OIDC) — no API token required.
34
+ permissions:
35
+ id-token: write
36
+ environment:
37
+ name: pypi
38
+ url: https://pypi.org/p/ennoia
39
+ steps:
40
+ - uses: actions/download-artifact@v4
41
+ with:
42
+ name: dist
43
+ path: dist/
44
+
45
+ - uses: pypa/gh-action-pypi-publish@release/v1
@@ -0,0 +1,43 @@
1
+ # Python
2
+ __pycache__/
3
+ *.py[cod]
4
+ *$py.class
5
+ *.so
6
+ .Python
7
+ build/
8
+ dist/
9
+ *.egg-info/
10
+ *.egg
11
+ .eggs/
12
+ .pytest_cache/
13
+ .ruff_cache/
14
+ .mypy_cache/
15
+ .coverage
16
+ htmlcov/
17
+
18
+ # Virtual envs
19
+ .venv/
20
+ venv/
21
+ env/
22
+
23
+ # IDE
24
+ .vscode/
25
+ .idea/
26
+ *.swp
27
+
28
+ # Ennoia data artifacts
29
+ *.parquet
30
+ *.npy
31
+ /.ennoia/
32
+
33
+ # Internal working directory (specs shared between maintainers and tooling; not public).
34
+ .ref/
35
+ .claude/
36
+
37
+ # Coverage reports
38
+ coverage.xml
39
+ .coverage.*
40
+
41
+ # OS
42
+ .DS_Store
43
+ Thumbs.db
@@ -0,0 +1,16 @@
1
+ repos:
2
+ - repo: https://github.com/astral-sh/ruff-pre-commit
3
+ rev: v0.14.1
4
+ hooks:
5
+ - id: ruff
6
+ args: [--fix]
7
+ - id: ruff-format
8
+
9
+ - repo: https://github.com/pre-commit/pre-commit-hooks
10
+ rev: v4.6.0
11
+ hooks:
12
+ - id: trailing-whitespace
13
+ - id: end-of-file-fixer
14
+ - id: check-yaml
15
+ - id: check-toml
16
+ - id: check-added-large-files
@@ -0,0 +1,49 @@
1
+ # Changelog
2
+
3
+ All notable changes to Ennoia are documented here. The format is based on
4
+ [Keep a Changelog](https://keepachangelog.com/en/1.1.0/), and the project
5
+ adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0.html)
6
+ from v0.1.0 onward.
7
+
8
+ ## [0.1.0] — Unreleased
9
+
10
+ First public release. Stage 2 (Working Concept) in
11
+ `.ref/IMPLEMENTATION.md` — pip-installable, CLI, strict CI.
12
+
13
+ ### Added
14
+
15
+ - **Schema layer:** operator inference per field type, `ennoia.Field`
16
+ overrides (`operators=[...]`, `filterable=False`), `describe_schema()`
17
+ class method, and top-level `ennoia.describe(schemas)` producing the
18
+ canonical filter contract JSON.
19
+ - **Index layer:** layer-wise parallel executor
20
+ (`ennoia.index.executor`), `extend()` parent-context injection into
21
+ child prompts, self-reported `_confidence` dynamically appended to the
22
+ JSON Schema last and surfaced on `IndexResult.confidences`,
23
+ `FilterValidationError` with the `docs/filters.md` error shape.
24
+ - **Stores:** `SQLiteStructuredStore`, `ParquetStructuredStore`,
25
+ `FilesystemVectorStore`, and `Store.from_path` for a filesystem-backed
26
+ composite store matching the CLI default.
27
+ - **Adapters:** `OpenAIAdapter`, `AnthropicAdapter`, `OpenAIEmbedding`,
28
+ with environment-variable API-key fallback.
29
+ - **Events:** typed event dataclasses (`ExtractionEvent`, `IndexEvent`,
30
+ `SearchEvent`) + synchronous `Emitter` pub/sub.
31
+ - **CLI:** `ennoia try | index | search`, adapter URI syntax
32
+ (`ollama:qwen3:0.6b` etc.), filter validation wired to the shared
33
+ error shape.
34
+ - **Tooling:** strict CI (ruff check + ruff format + pyright strict +
35
+ pytest) across Python 3.11 / 3.12 / 3.13; PyPI trusted-publisher
36
+ release workflow; pre-commit config.
37
+ - **Docs:** `docs/` directory with concepts, quickstart, schema and
38
+ filter guides, CLI reference, adapter + store notes.
39
+
40
+ ### Changed
41
+
42
+ - `BaseStructure.model_config = ConfigDict(extra="allow")` so the
43
+ extractor can carry `_confidence` on the instance without declaring
44
+ it as a field.
45
+ - Pipeline orchestration moved from the serial Stage 1 loop in
46
+ `pipeline.py` to a layer-wise parallel executor
47
+ (`index/executor.py`).
48
+ - `KNOWN_OPERATORS` extended to the full set: `contains`, `startswith`,
49
+ `contains_all`, `contains_any`, `is_null`.
@@ -0,0 +1,62 @@
1
+ # Contributing to Ennoia
2
+
3
+ Ennoia is an Apache-2.0 open-source project and welcomes contributions.
4
+ Start with an issue describing the change if it isn't obvious from an
5
+ existing one.
6
+
7
+ ## Dev setup
8
+
9
+ ```bash
10
+ git clone https://github.com/ennoia-ai/ennoia
11
+ cd ennoia
12
+ uv venv
13
+ source .venv/bin/activate
14
+ pip install -e ".[all,dev]"
15
+ pre-commit install
16
+ ```
17
+
18
+ Everything is optional under an extra. The development install pulls in
19
+ every adapter + store backend so the full test suite runs.
20
+
21
+ ## Quality gates
22
+
23
+ Four gates must be green before merging — CI enforces each.
24
+
25
+ ```bash
26
+ ruff check . # lint
27
+ ruff format --check . # formatting
28
+ pyright # strict type-check
29
+ pytest # tests
30
+ ```
31
+
32
+ `ruff` and `pyright` are non-negotiable; unexplained `# pyright: ignore`
33
+ or `# noqa` comments are not accepted.
34
+
35
+ ## Testing conventions
36
+
37
+ - Every new module ships with a test module under `tests/`.
38
+ - Tests use pytest, `pytest-asyncio` (auto mode), and hand-rolled fakes.
39
+ No mocking library is required in the default test path — the
40
+ pipeline's protocols make structural typing cheap.
41
+ - Optional-dependency tests guard with `pytest.importorskip(...)` so the
42
+ default install can run a useful subset.
43
+ - Integration tests against live external services (Qdrant, OpenAI,
44
+ Anthropic) are reserved for Stage 3.
45
+
46
+ ## Pull request checklist
47
+
48
+ - [ ] Issue or PR description explains the *why*, not just the *what*.
49
+ - [ ] Public API changes are covered in `docs/` (not `.ref/`).
50
+ - [ ] `CHANGELOG.md` entry under `[Unreleased]`.
51
+ - [ ] Tests added or updated for every behavioral change.
52
+ - [ ] All four quality gates pass locally.
53
+
54
+ ## Governance
55
+
56
+ - Breaking changes to the public SDK require a minor-version bump
57
+ pre-1.0, a major bump post-1.0.
58
+ - Filter-language changes (operators, inference rules, error shape)
59
+ touch every surface (SDK, CLI, MCP, REST) — expect review from
60
+ multiple maintainers.
61
+ - Adapter additions ship as extras; the core package depends only on
62
+ Pydantic.
@@ -0,0 +1,202 @@
1
+
2
+ Apache License
3
+ Version 2.0, January 2004
4
+ http://www.apache.org/licenses/
5
+
6
+ TERMS AND CONDITIONS FOR USE, REPRODUCTION, AND DISTRIBUTION
7
+
8
+ 1. Definitions.
9
+
10
+ "License" shall mean the terms and conditions for use, reproduction,
11
+ and distribution as defined by Sections 1 through 9 of this document.
12
+
13
+ "Licensor" shall mean the copyright owner or entity authorized by
14
+ the copyright owner that is granting the License.
15
+
16
+ "Legal Entity" shall mean the union of the acting entity and all
17
+ other entities that control, are controlled by, or are under common
18
+ control with that entity. For the purposes of this definition,
19
+ "control" means (i) the power, direct or indirect, to cause the
20
+ direction or management of such entity, whether by contract or
21
+ otherwise, or (ii) ownership of fifty percent (50%) or more of the
22
+ outstanding shares, or (iii) beneficial ownership of such entity.
23
+
24
+ "You" (or "Your") shall mean an individual or Legal Entity
25
+ exercising permissions granted by this License.
26
+
27
+ "Source" form shall mean the preferred form for making modifications,
28
+ including but not limited to software source code, documentation
29
+ source, and configuration files.
30
+
31
+ "Object" form shall mean any form resulting from mechanical
32
+ transformation or translation of a Source form, including but
33
+ not limited to compiled object code, generated documentation,
34
+ and conversions to other media types.
35
+
36
+ "Work" shall mean the work of authorship, whether in Source or
37
+ Object form, made available under the License, as indicated by a
38
+ copyright notice that is included in or attached to the work
39
+ (an example is provided in the Appendix below).
40
+
41
+ "Derivative Works" shall mean any work, whether in Source or Object
42
+ form, that is based on (or derived from) the Work and for which the
43
+ editorial revisions, annotations, elaborations, or other modifications
44
+ represent, as a whole, an original work of authorship. For the purposes
45
+ of this License, Derivative Works shall not include works that remain
46
+ separable from, or merely link (or bind by name) to the interfaces of,
47
+ the Work and Derivative Works thereof.
48
+
49
+ "Contribution" shall mean any work of authorship, including
50
+ the original version of the Work and any modifications or additions
51
+ to that Work or Derivative Works thereof, that is intentionally
52
+ submitted to Licensor for inclusion in the Work by the copyright owner
53
+ or by an individual or Legal Entity authorized to submit on behalf of
54
+ the copyright owner. For the purposes of this definition, "submitted"
55
+ means any form of electronic, verbal, or written communication sent
56
+ to the Licensor or its representatives, including but not limited to
57
+ communication on electronic mailing lists, source code control systems,
58
+ and issue tracking systems that are managed by, or on behalf of, the
59
+ Licensor for the purpose of discussing and improving the Work, but
60
+ excluding communication that is conspicuously marked or otherwise
61
+ designated in writing by the copyright owner as "Not a Contribution."
62
+
63
+ "Contributor" shall mean Licensor and any individual or Legal Entity
64
+ on behalf of whom a Contribution has been received by Licensor and
65
+ subsequently incorporated within the Work.
66
+
67
+ 2. Grant of Copyright License. Subject to the terms and conditions of
68
+ this License, each Contributor hereby grants to You a perpetual,
69
+ worldwide, non-exclusive, no-charge, royalty-free, irrevocable
70
+ copyright license to reproduce, prepare Derivative Works of,
71
+ publicly display, publicly perform, sublicense, and distribute the
72
+ Work and such Derivative Works in Source or Object form.
73
+
74
+ 3. Grant of Patent License. Subject to the terms and conditions of
75
+ this License, each Contributor hereby grants to You a perpetual,
76
+ worldwide, non-exclusive, no-charge, royalty-free, irrevocable
77
+ (except as stated in this section) patent license to make, have made,
78
+ use, offer to sell, sell, import, and otherwise transfer the Work,
79
+ where such license applies only to those patent claims licensable
80
+ by such Contributor that are necessarily infringed by their
81
+ Contribution(s) alone or by combination of their Contribution(s)
82
+ with the Work to which such Contribution(s) was submitted. If You
83
+ institute patent litigation against any entity (including a
84
+ cross-claim or counterclaim in a lawsuit) alleging that the Work
85
+ or a Contribution incorporated within the Work constitutes direct
86
+ or contributory patent infringement, then any patent licenses
87
+ granted to You under this License for that Work shall terminate
88
+ as of the date such litigation is filed.
89
+
90
+ 4. Redistribution. You may reproduce and distribute copies of the
91
+ Work or Derivative Works thereof in any medium, with or without
92
+ modifications, and in Source or Object form, provided that You
93
+ meet the following conditions:
94
+
95
+ (a) You must give any other recipients of the Work or
96
+ Derivative Works a copy of this License; and
97
+
98
+ (b) You must cause any modified files to carry prominent notices
99
+ stating that You changed the files; and
100
+
101
+ (c) You must retain, in the Source form of any Derivative Works
102
+ that You distribute, all copyright, patent, trademark, and
103
+ attribution notices from the Source form of the Work,
104
+ excluding those notices that do not pertain to any part of
105
+ the Derivative Works; and
106
+
107
+ (d) If the Work includes a "NOTICE" text file as part of its
108
+ distribution, then any Derivative Works that You distribute must
109
+ include a readable copy of the attribution notices contained
110
+ within such NOTICE file, excluding those notices that do not
111
+ pertain to any part of the Derivative Works, in at least one
112
+ of the following places: within a NOTICE text file distributed
113
+ as part of the Derivative Works; within the Source form or
114
+ documentation, if provided along with the Derivative Works; or,
115
+ within a display generated by the Derivative Works, if and
116
+ wherever such third-party notices normally appear. The contents
117
+ of the NOTICE file are for informational purposes only and
118
+ do not modify the License. You may add Your own attribution
119
+ notices within Derivative Works that You distribute, alongside
120
+ or as an addendum to the NOTICE text from the Work, provided
121
+ that such additional attribution notices cannot be construed
122
+ as modifying the License.
123
+
124
+ You may add Your own copyright statement to Your modifications and
125
+ may provide additional or different license terms and conditions
126
+ for use, reproduction, or distribution of Your modifications, or
127
+ for any such Derivative Works as a whole, provided Your use,
128
+ reproduction, and distribution of the Work otherwise complies with
129
+ the conditions stated in this License.
130
+
131
+ 5. Submission of Contributions. Unless You explicitly state otherwise,
132
+ any Contribution intentionally submitted for inclusion in the Work
133
+ by You to the Licensor shall be under the terms and conditions of
134
+ this License, without any additional terms or conditions.
135
+ Notwithstanding the above, nothing herein shall supersede or modify
136
+ the terms of any separate license agreement you may have executed
137
+ with Licensor regarding such Contributions.
138
+
139
+ 6. Trademarks. This License does not grant permission to use the trade
140
+ names, trademarks, service marks, or product names of the Licensor,
141
+ except as required for reasonable and customary use in describing the
142
+ origin of the Work and reproducing the content of the NOTICE file.
143
+
144
+ 7. Disclaimer of Warranty. Unless required by applicable law or
145
+ agreed to in writing, Licensor provides the Work (and each
146
+ Contributor provides its Contributions) on an "AS IS" BASIS,
147
+ WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or
148
+ implied, including, without limitation, any warranties or conditions
149
+ of TITLE, NON-INFRINGEMENT, MERCHANTABILITY, or FITNESS FOR A
150
+ PARTICULAR PURPOSE. You are solely responsible for determining the
151
+ appropriateness of using or redistributing the Work and assume any
152
+ risks associated with Your exercise of permissions under this License.
153
+
154
+ 8. Limitation of Liability. In no event and under no legal theory,
155
+ whether in tort (including negligence), contract, or otherwise,
156
+ unless required by applicable law (such as deliberate and grossly
157
+ negligent acts) or agreed to in writing, shall any Contributor be
158
+ liable to You for damages, including any direct, indirect, special,
159
+ incidental, or consequential damages of any character arising as a
160
+ result of this License or out of the use or inability to use the
161
+ Work (including but not limited to damages for loss of goodwill,
162
+ work stoppage, computer failure or malfunction, or any and all
163
+ other commercial damages or losses), even if such Contributor
164
+ has been advised of the possibility of such damages.
165
+
166
+ 9. Accepting Warranty or Additional Liability. While redistributing
167
+ the Work or Derivative Works thereof, You may choose to offer,
168
+ and charge a fee for, acceptance of support, warranty, indemnity,
169
+ or other liability obligations and/or rights consistent with this
170
+ License. However, in accepting such obligations, You may act only
171
+ on Your own behalf and on Your sole responsibility, not on behalf
172
+ of any other Contributor, and only if You agree to indemnify,
173
+ defend, and hold each Contributor harmless for any liability
174
+ incurred by, or claims asserted against, such Contributor by reason
175
+ of your accepting any such warranty or additional liability.
176
+
177
+ END OF TERMS AND CONDITIONS
178
+
179
+ APPENDIX: How to apply the Apache License to your work.
180
+
181
+ To apply the Apache License to your work, attach the following
182
+ boilerplate notice, with the fields enclosed by brackets "[]"
183
+ replaced with your own identifying information. (Don't include
184
+ the brackets!) The text should be enclosed in the appropriate
185
+ comment syntax for the file format. We also recommend that a
186
+ file or class name and description of purpose be included on the
187
+ same "printed page" as the copyright notice for easier
188
+ identification within third-party archives.
189
+
190
+ Copyright [yyyy] [name of copyright owner]
191
+
192
+ Licensed under the Apache License, Version 2.0 (the "License");
193
+ you may not use this file except in compliance with the License.
194
+ You may obtain a copy of the License at
195
+
196
+ http://www.apache.org/licenses/LICENSE-2.0
197
+
198
+ Unless required by applicable law or agreed to in writing, software
199
+ distributed under the License is distributed on an "AS IS" BASIS,
200
+ WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
201
+ See the License for the specific language governing permissions and
202
+ limitations under the License.
ennoia-0.1.0/NOTICE ADDED
@@ -0,0 +1,17 @@
1
+ Ennoia
2
+ Copyright 2026 The Ennoia Contributors
3
+
4
+ This product includes software developed by
5
+ The Ennoia Contributors (https://github.com/ennoia-ai/ennoia).
6
+
7
+ Licensed under the Apache License, Version 2.0 (the "License");
8
+ you may not use this file except in compliance with the License.
9
+ You may obtain a copy of the License at
10
+
11
+ http://www.apache.org/licenses/LICENSE-2.0
12
+
13
+ Unless required by applicable law or agreed to in writing, software
14
+ distributed under the License is distributed on an "AS IS" BASIS,
15
+ WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
16
+ See the License for the specific language governing permissions and
17
+ limitations under the License.
ennoia-0.1.0/PKG-INFO ADDED
@@ -0,0 +1,164 @@
1
+ Metadata-Version: 2.4
2
+ Name: ennoia
3
+ Version: 0.1.0
4
+ Summary: A framework for LLM-powered document pre-indexing and hybrid retrieval.
5
+ Project-URL: Documentation, https://github.com/ennoia-ai/ennoia
6
+ Project-URL: Source, https://github.com/ennoia-ai/ennoia
7
+ Project-URL: Issues, https://github.com/ennoia-ai/ennoia/issues
8
+ Project-URL: Changelog, https://github.com/ennoia-ai/ennoia/blob/main/CHANGELOG.md
9
+ Author: Ennoia contributors
10
+ License-Expression: Apache-2.0
11
+ License-File: LICENSE.txt
12
+ Keywords: hybrid-search,indexing,llm,pydantic,rag,retrieval
13
+ Classifier: Development Status :: 3 - Alpha
14
+ Classifier: Intended Audience :: Developers
15
+ Classifier: License :: OSI Approved :: Apache Software License
16
+ Classifier: Programming Language :: Python :: 3
17
+ Classifier: Programming Language :: Python :: 3.11
18
+ Classifier: Programming Language :: Python :: 3.12
19
+ Classifier: Programming Language :: Python :: 3.13
20
+ Classifier: Topic :: Software Development :: Libraries :: Python Modules
21
+ Classifier: Typing :: Typed
22
+ Requires-Python: >=3.11
23
+ Requires-Dist: pydantic>=2.0
24
+ Provides-Extra: all
25
+ Requires-Dist: anthropic>=0.34; extra == 'all'
26
+ Requires-Dist: numpy>=1.26; extra == 'all'
27
+ Requires-Dist: ollama>=0.3; extra == 'all'
28
+ Requires-Dist: openai>=1.40; extra == 'all'
29
+ Requires-Dist: pandas>=2.1; extra == 'all'
30
+ Requires-Dist: pyarrow>=15; extra == 'all'
31
+ Requires-Dist: sentence-transformers>=3; extra == 'all'
32
+ Requires-Dist: typer>=0.12; extra == 'all'
33
+ Provides-Extra: anthropic
34
+ Requires-Dist: anthropic>=0.34; extra == 'anthropic'
35
+ Provides-Extra: cli
36
+ Requires-Dist: typer>=0.12; extra == 'cli'
37
+ Provides-Extra: dev
38
+ Requires-Dist: coverage[toml]>=7.5; extra == 'dev'
39
+ Requires-Dist: pyright>=1.1; extra == 'dev'
40
+ Requires-Dist: pytest-asyncio>=0.23; extra == 'dev'
41
+ Requires-Dist: pytest-cov>=5; extra == 'dev'
42
+ Requires-Dist: pytest>=8; extra == 'dev'
43
+ Requires-Dist: respx>=0.21; extra == 'dev'
44
+ Requires-Dist: ruff>=0.6; extra == 'dev'
45
+ Provides-Extra: filesystem
46
+ Requires-Dist: numpy>=1.26; extra == 'filesystem'
47
+ Requires-Dist: pandas>=2.1; extra == 'filesystem'
48
+ Requires-Dist: pyarrow>=15; extra == 'filesystem'
49
+ Provides-Extra: ollama
50
+ Requires-Dist: ollama>=0.3; extra == 'ollama'
51
+ Provides-Extra: openai
52
+ Requires-Dist: openai>=1.40; extra == 'openai'
53
+ Provides-Extra: sentence-transformers
54
+ Requires-Dist: numpy>=1.26; extra == 'sentence-transformers'
55
+ Requires-Dist: sentence-transformers>=3; extra == 'sentence-transformers'
56
+ Description-Content-Type: text/markdown
57
+
58
+ # Ennoia
59
+
60
+ [![CI](https://github.com/vunone/ennoia/actions/workflows/ci.yml/badge.svg)](https://github.com/vunone/ennoia/actions/workflows/ci.yml)
61
+ [![coverage](https://codecov.io/gh/vunone/ennoia/branch/main/graph/badge.svg)](https://codecov.io/gh/vunone/ennoia)
62
+ [![PyPI](https://img.shields.io/pypi/v/ennoia.svg)](https://pypi.org/project/ennoia/)
63
+ [![Python](https://img.shields.io/pypi/pyversions/ennoia.svg)](https://pypi.org/project/ennoia/)
64
+ [![License](https://img.shields.io/badge/license-Apache%202.0-blue.svg)](LICENSE.txt)
65
+ [![types: pyright strict](https://img.shields.io/badge/types-pyright%20strict-informational.svg)](https://microsoft.github.io/pyright/)
66
+ [![Ruff](https://img.shields.io/endpoint?url=https://raw.githubusercontent.com/astral-sh/ruff/main/assets/badge/v2.json)](https://github.com/astral-sh/ruff)
67
+
68
+ A framework for LLM-powered document pre-indexing and hybrid retrieval.
69
+
70
+ Ennoia treats indexing as a first-class problem. Instead of embedding raw
71
+ text and hoping vector similarity recovers relevance, you declare
72
+ extraction schemas (Pydantic models for structured metadata, marker
73
+ classes for semantic summaries), and Ennoia runs an LLM-driven DAG over
74
+ each document to produce rich, filterable indices. At query time,
75
+ retrieval runs in two phases: structured filters narrow the candidate set,
76
+ then vector search ranks within it.
77
+
78
+ ## Install
79
+
80
+ ```bash
81
+ pip install "ennoia[ollama,sentence-transformers,cli]"
82
+ ```
83
+
84
+ Available extras: `ollama`, `openai`, `anthropic`, `sentence-transformers`,
85
+ `filesystem` (Parquet + NumPy stores), `cli` (`ennoia` CLI), `all`
86
+ (everything above).
87
+
88
+ ## Quick start (SDK)
89
+
90
+ ```python
91
+ from datetime import date
92
+ from typing import Literal
93
+
94
+ from ennoia import BaseSemantic, BaseStructure, Pipeline, Store
95
+ from ennoia.adapters.embedding.sentence_transformers import SentenceTransformerEmbedding
96
+ from ennoia.adapters.llm.ollama import OllamaAdapter
97
+ from ennoia.store import InMemoryStructuredStore, InMemoryVectorStore
98
+
99
+
100
+ class DocMeta(BaseStructure):
101
+ """Extract basic document metadata."""
102
+
103
+ category: Literal["legal", "medical", "financial"]
104
+ doc_date: date
105
+
106
+
107
+ class Summary(BaseSemantic):
108
+ """What is the main topic of this document?"""
109
+
110
+
111
+ pipeline = Pipeline(
112
+ schemas=[DocMeta, Summary],
113
+ store=Store(vector=InMemoryVectorStore(), structured=InMemoryStructuredStore()),
114
+ llm=OllamaAdapter(model="qwen3:0.6b"),
115
+ embedding=SentenceTransformerEmbedding(model="all-MiniLM-L6-v2"),
116
+ )
117
+
118
+ pipeline.index(text="The court held that...", source_id="doc_001")
119
+ results = pipeline.search(
120
+ query="court holdings on liability",
121
+ filters={"category": "legal"},
122
+ top_k=5,
123
+ )
124
+ ```
125
+
126
+ See [docs/quickstart.md](docs/quickstart.md) for the full walkthrough.
127
+
128
+ ## Quick start (CLI)
129
+
130
+ ```bash
131
+ # Iterate on a schema against a single document
132
+ ennoia try ./sample.txt --schema my_schemas.py
133
+
134
+ # Index a folder into a filesystem-backed store
135
+ ennoia index ./docs \
136
+ --schema my_schemas.py \
137
+ --store ./my_index \
138
+ --llm ollama:qwen3:0.6b \
139
+ --embedding sentence-transformers:all-MiniLM-L6-v2
140
+
141
+ # Hybrid search
142
+ ennoia search "employer duty to accommodate disability" \
143
+ --schema my_schemas.py \
144
+ --store ./my_index \
145
+ --filter "jurisdiction=WA" \
146
+ --filter "date_decided__gte=2020-01-01" \
147
+ --top-k 5
148
+ ```
149
+
150
+ See [docs/cli.md](docs/cli.md).
151
+
152
+ ## Documentation
153
+
154
+ - [Concepts](docs/concepts.md)
155
+ - [Quickstart](docs/quickstart.md)
156
+ - [Schema authoring](docs/schemas.md)
157
+ - [Filter language](docs/filters.md)
158
+ - [CLI reference](docs/cli.md)
159
+ - [Adapters](docs/adapters.md)
160
+ - [Stores](docs/stores.md)
161
+
162
+ ## License
163
+
164
+ Apache 2.0. See [LICENSE.txt](LICENSE.txt) and [NOTICE](NOTICE).