context-engineering-core 0.14.0__tar.gz → 0.15.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.
- {context_engineering_core-0.14.0 → context_engineering_core-0.15.0}/CHANGELOG.md +23 -1
- {context_engineering_core-0.14.0 → context_engineering_core-0.15.0}/PKG-INFO +19 -19
- {context_engineering_core-0.14.0 → context_engineering_core-0.15.0}/README.md +18 -18
- {context_engineering_core-0.14.0 → context_engineering_core-0.15.0}/pyproject.toml +1 -1
- {context_engineering_core-0.14.0 → context_engineering_core-0.15.0}/src/context_engine/__init__.py +1 -1
- {context_engineering_core-0.14.0 → context_engineering_core-0.15.0}/src/context_engine/cli.py +3 -8
- context_engineering_core-0.15.0/src/context_engine/embedding_data/LICENSE +33 -0
- context_engineering_core-0.15.0/src/context_engine/embedding_data/potion-base-8M-int8.npz +0 -0
- context_engineering_core-0.15.0/src/context_engine/embedding_data/potion-base-8M-vocab.txt +29528 -0
- {context_engineering_core-0.14.0 → context_engineering_core-0.15.0}/src/context_engine/embeddings.py +70 -10
- {context_engineering_core-0.14.0 → context_engineering_core-0.15.0}/src/context_engine/evaluation/data/freeze.json +2 -2
- {context_engineering_core-0.14.0 → context_engineering_core-0.15.0}/src/context_engine/evaluation/grading.py +30 -0
- {context_engineering_core-0.14.0 → context_engineering_core-0.15.0}/src/context_engine/evaluation/harness.py +1 -0
- {context_engineering_core-0.14.0 → context_engineering_core-0.15.0}/src/context_engine/evaluation/strategies.py +10 -5
- {context_engineering_core-0.14.0 → context_engineering_core-0.15.0}/src/context_engine/mcp_server.py +6 -15
- {context_engineering_core-0.14.0 → context_engineering_core-0.15.0}/src/context_engine/pipeline.py +10 -2
- context_engineering_core-0.15.0/src/context_engine/wordpiece.py +114 -0
- {context_engineering_core-0.14.0 → context_engineering_core-0.15.0}/.gitignore +0 -0
- {context_engineering_core-0.14.0 → context_engineering_core-0.15.0}/LICENSE +0 -0
- {context_engineering_core-0.14.0 → context_engineering_core-0.15.0}/examples/evidence_answer_policy.py +0 -0
- {context_engineering_core-0.14.0 → context_engineering_core-0.15.0}/examples/incident-demo.json +0 -0
- {context_engineering_core-0.14.0 → context_engineering_core-0.15.0}/examples/inspection-input.json +0 -0
- {context_engineering_core-0.14.0 → context_engineering_core-0.15.0}/examples/rolling_summary.py +0 -0
- {context_engineering_core-0.14.0 → context_engineering_core-0.15.0}/examples/sdk_quickstart.py +0 -0
- {context_engineering_core-0.14.0 → context_engineering_core-0.15.0}/examples/service-config.example.json +0 -0
- {context_engineering_core-0.14.0 → context_engineering_core-0.15.0}/examples/structured_answers.py +0 -0
- {context_engineering_core-0.14.0 → context_engineering_core-0.15.0}/examples/validated_answer.py +0 -0
- {context_engineering_core-0.14.0 → context_engineering_core-0.15.0}/src/context_engine/__main__.py +0 -0
- {context_engineering_core-0.14.0 → context_engineering_core-0.15.0}/src/context_engine/_sqlite.py +0 -0
- {context_engineering_core-0.14.0 → context_engineering_core-0.15.0}/src/context_engine/_windows_security.py +0 -0
- {context_engineering_core-0.14.0 → context_engineering_core-0.15.0}/src/context_engine/_windows_storage.py +0 -0
- {context_engineering_core-0.14.0 → context_engineering_core-0.15.0}/src/context_engine/adapters.py +0 -0
- {context_engineering_core-0.14.0 → context_engineering_core-0.15.0}/src/context_engine/answers.py +0 -0
- {context_engineering_core-0.14.0 → context_engineering_core-0.15.0}/src/context_engine/budget.py +0 -0
- {context_engineering_core-0.14.0 → context_engineering_core-0.15.0}/src/context_engine/config.py +0 -0
- {context_engineering_core-0.14.0 → context_engineering_core-0.15.0}/src/context_engine/context.py +0 -0
- {context_engineering_core-0.14.0 → context_engineering_core-0.15.0}/src/context_engine/demo.py +0 -0
- {context_engineering_core-0.14.0 → context_engineering_core-0.15.0}/src/context_engine/errors.py +0 -0
- {context_engineering_core-0.14.0 → context_engineering_core-0.15.0}/src/context_engine/evaluation/__init__.py +0 -0
- {context_engineering_core-0.14.0 → context_engineering_core-0.15.0}/src/context_engine/evaluation/commands.py +0 -0
- {context_engineering_core-0.14.0 → context_engineering_core-0.15.0}/src/context_engine/evaluation/corpus.py +0 -0
- {context_engineering_core-0.14.0 → context_engineering_core-0.15.0}/src/context_engine/evaluation/data/ground_truth.json +0 -0
- {context_engineering_core-0.14.0 → context_engineering_core-0.15.0}/src/context_engine/evaluation/data/paraphrases.json +0 -0
- {context_engineering_core-0.14.0 → context_engineering_core-0.15.0}/src/context_engine/evaluation/data/pin_retention.json +0 -0
- {context_engineering_core-0.14.0 → context_engineering_core-0.15.0}/src/context_engine/evaluation/data/protocol.json +0 -0
- {context_engineering_core-0.14.0 → context_engineering_core-0.15.0}/src/context_engine/evaluation/data/scenario.json +0 -0
- {context_engineering_core-0.14.0 → context_engineering_core-0.15.0}/src/context_engine/evaluation/data/summary_fixture.json +0 -0
- {context_engineering_core-0.14.0 → context_engineering_core-0.15.0}/src/context_engine/evaluation/execution.py +0 -0
- {context_engineering_core-0.14.0 → context_engineering_core-0.15.0}/src/context_engine/evaluation/fixtures.py +0 -0
- {context_engineering_core-0.14.0 → context_engineering_core-0.15.0}/src/context_engine/evaluation/heldout/__init__.py +0 -0
- {context_engineering_core-0.14.0 → context_engineering_core-0.15.0}/src/context_engine/evaluation/heldout/__main__.py +0 -0
- {context_engineering_core-0.14.0 → context_engineering_core-0.15.0}/src/context_engine/evaluation/heldout/data/ground_truth.json +0 -0
- {context_engineering_core-0.14.0 → context_engineering_core-0.15.0}/src/context_engine/evaluation/heldout/data/manifest.json +0 -0
- {context_engineering_core-0.14.0 → context_engineering_core-0.15.0}/src/context_engine/evaluation/heldout/data/protocol.json +0 -0
- {context_engineering_core-0.14.0 → context_engineering_core-0.15.0}/src/context_engine/evaluation/heldout/data/scenarios.json +0 -0
- {context_engineering_core-0.14.0 → context_engineering_core-0.15.0}/src/context_engine/evaluation/heldout/data/scoring_manifest.json +0 -0
- {context_engineering_core-0.14.0 → context_engineering_core-0.15.0}/src/context_engine/evaluation/heldout/data/scoring_protocol.json +0 -0
- {context_engineering_core-0.14.0 → context_engineering_core-0.15.0}/src/context_engine/evaluation/heldout/scoring.py +0 -0
- {context_engineering_core-0.14.0 → context_engineering_core-0.15.0}/src/context_engine/evaluation/protocol.py +0 -0
- {context_engineering_core-0.14.0 → context_engineering_core-0.15.0}/src/context_engine/evaluation/reporting.py +0 -0
- {context_engineering_core-0.14.0 → context_engineering_core-0.15.0}/src/context_engine/evaluation/results.py +0 -0
- {context_engineering_core-0.14.0 → context_engineering_core-0.15.0}/src/context_engine/evaluation/run_commands.py +0 -0
- {context_engineering_core-0.14.0 → context_engineering_core-0.15.0}/src/context_engine/inspection.py +0 -0
- {context_engineering_core-0.14.0 → context_engineering_core-0.15.0}/src/context_engine/layers/__init__.py +0 -0
- {context_engineering_core-0.14.0 → context_engineering_core-0.15.0}/src/context_engine/layers/cap.py +0 -0
- {context_engineering_core-0.14.0 → context_engineering_core-0.15.0}/src/context_engine/layers/common.py +0 -0
- {context_engineering_core-0.14.0 → context_engineering_core-0.15.0}/src/context_engine/layers/pin.py +0 -0
- {context_engineering_core-0.14.0 → context_engineering_core-0.15.0}/src/context_engine/layers/retrieve.py +0 -0
- {context_engineering_core-0.14.0 → context_engineering_core-0.15.0}/src/context_engine/layers/summarize.py +0 -0
- {context_engineering_core-0.14.0 → context_engineering_core-0.15.0}/src/context_engine/layers/window.py +0 -0
- {context_engineering_core-0.14.0 → context_engineering_core-0.15.0}/src/context_engine/memory/__init__.py +0 -0
- {context_engineering_core-0.14.0 → context_engineering_core-0.15.0}/src/context_engine/memory/codec.py +0 -0
- {context_engineering_core-0.14.0 → context_engineering_core-0.15.0}/src/context_engine/memory/demo.py +0 -0
- {context_engineering_core-0.14.0 → context_engineering_core-0.15.0}/src/context_engine/memory/store.py +0 -0
- {context_engineering_core-0.14.0 → context_engineering_core-0.15.0}/src/context_engine/models.py +0 -0
- {context_engineering_core-0.14.0 → context_engineering_core-0.15.0}/src/context_engine/providers/__init__.py +0 -0
- {context_engineering_core-0.14.0 → context_engineering_core-0.15.0}/src/context_engine/providers/client.py +0 -0
- {context_engineering_core-0.14.0 → context_engineering_core-0.15.0}/src/context_engine/providers/commands.py +0 -0
- {context_engineering_core-0.14.0 → context_engineering_core-0.15.0}/src/context_engine/providers/contracts.py +0 -0
- {context_engineering_core-0.14.0 → context_engineering_core-0.15.0}/src/context_engine/providers/credentials.py +0 -0
- {context_engineering_core-0.14.0 → context_engineering_core-0.15.0}/src/context_engine/providers/memory.py +0 -0
- {context_engineering_core-0.14.0 → context_engineering_core-0.15.0}/src/context_engine/providers/store.py +0 -0
- {context_engineering_core-0.14.0 → context_engineering_core-0.15.0}/src/context_engine/providers/transport.py +0 -0
- {context_engineering_core-0.14.0 → context_engineering_core-0.15.0}/src/context_engine/providers/windows_credentials.py +0 -0
- {context_engineering_core-0.14.0 → context_engineering_core-0.15.0}/src/context_engine/py.typed +0 -0
- {context_engineering_core-0.14.0 → context_engineering_core-0.15.0}/src/context_engine/service/__init__.py +0 -0
- {context_engineering_core-0.14.0 → context_engineering_core-0.15.0}/src/context_engine/service/__main__.py +0 -0
- {context_engineering_core-0.14.0 → context_engineering_core-0.15.0}/src/context_engine/service/app.py +0 -0
- {context_engineering_core-0.14.0 → context_engineering_core-0.15.0}/src/context_engine/service/auth.py +0 -0
- {context_engineering_core-0.14.0 → context_engineering_core-0.15.0}/src/context_engine/service/client.py +0 -0
- {context_engineering_core-0.14.0 → context_engineering_core-0.15.0}/src/context_engine/service/control.py +0 -0
- {context_engineering_core-0.14.0 → context_engineering_core-0.15.0}/src/context_engine/service/demo.py +0 -0
- {context_engineering_core-0.14.0 → context_engineering_core-0.15.0}/src/context_engine/service/integrations.py +0 -0
- {context_engineering_core-0.14.0 → context_engineering_core-0.15.0}/src/context_engine/service/schemas.py +0 -0
- {context_engineering_core-0.14.0 → context_engineering_core-0.15.0}/src/context_engine/service/worker.py +0 -0
- {context_engineering_core-0.14.0 → context_engineering_core-0.15.0}/src/context_engine/service/workers.py +0 -0
- {context_engineering_core-0.14.0 → context_engineering_core-0.15.0}/src/context_engine/summaries.py +0 -0
- {context_engineering_core-0.14.0 → context_engineering_core-0.15.0}/src/context_engine/tokens.py +0 -0
- {context_engineering_core-0.14.0 → context_engineering_core-0.15.0}/src/context_engine/work.py +0 -0
|
@@ -3,7 +3,29 @@
|
|
|
3
3
|
Earlier versions (0.1.0–0.9.6) are documented in `docs/C01_REPORT.md` through
|
|
4
4
|
`docs/C10_STORAGE_ACL_REPORT.md` and preserved as wheels under `archives/`.
|
|
5
5
|
|
|
6
|
-
## 0.
|
|
6
|
+
## 0.15.0 — 2026-10-31 (unreleased)
|
|
7
|
+
|
|
8
|
+
### Changed (behavior)
|
|
9
|
+
- Hybrid retrieval is the default (`assemble_context(embedder="builtin")`): the
|
|
10
|
+
bundled potion-base-8M model (8-bit vectors, ~7 MB in the package; MIT notice in
|
|
11
|
+
`embedding_data/LICENSE`) with a pure-Python WordPiece tokenizer. No download,
|
|
12
|
+
network or new dependency. `embedder=None` gives the pre-0.15.0 keyword-only path.
|
|
13
|
+
- Default `semantic_weight` 0.7 → 0.5: a needle-in-filler check showed 0.7 losing
|
|
14
|
+
exact keyword matches (22/31 vs 31/31); 0.5 is equal or better on every set.
|
|
15
|
+
- `strategy-eval` includes the hybrid strategies by default (`--no-semantic` to
|
|
16
|
+
skip; `--semantic` removed). `context-engine-mcp` is hybrid by default
|
|
17
|
+
(`--no-semantic`; `--semantic` removed).
|
|
18
|
+
- The frozen benchmark harness pins keyword-only retrieval.
|
|
19
|
+
|
|
20
|
+
### Added
|
|
21
|
+
- `BuiltinEmbedder`, `default_embedder()`, `context_engine.wordpiece`.
|
|
22
|
+
- Lenient grading v2 (`answer_correct_lenient`, `GRADERS`) beside frozen strict v1;
|
|
23
|
+
`scripts/regrade_live.py` writes `grading.json` for both live runs.
|
|
24
|
+
|
|
25
|
+
### Unchanged
|
|
26
|
+
- 0.14.0 wheel/freeze archived in `archives/c15-default-semantic-0150/`.
|
|
27
|
+
|
|
28
|
+
## 0.14.0 — 2026-10-31 (PyPI)
|
|
7
29
|
|
|
8
30
|
### Added
|
|
9
31
|
- Optional hybrid retrieval: `assemble_context(..., embedder=, semantic_weight=0.7)`
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
Metadata-Version: 2.5
|
|
2
2
|
Name: context-engineering-core
|
|
3
|
-
Version: 0.
|
|
3
|
+
Version: 0.15.0
|
|
4
4
|
Summary: Provider-independent context layers, source contracts, and token budget accounting
|
|
5
5
|
Project-URL: Homepage, https://github.com/Nandu1729/Context-Engine
|
|
6
6
|
Project-URL: Repository, https://github.com/Nandu1729/Context-Engine
|
|
@@ -50,7 +50,7 @@ that fits the budget. Those messages keep the recent turns, the facts you pinned
|
|
|
50
50
|
and the older evidence that matches the question. It never calls a model by
|
|
51
51
|
itself, so you send the messages to any provider you like.
|
|
52
52
|
|
|
53
|
-
> **Status: alpha (0.
|
|
53
|
+
> **Status: alpha (0.15.0).** Good for developers to try locally. It is not yet
|
|
54
54
|
> proven on real-world data, and there is no hosted service. See
|
|
55
55
|
> [What is not proven yet](#what-is-not-proven-yet).
|
|
56
56
|
|
|
@@ -111,22 +111,20 @@ chat_model.invoke(langchain_messages(result)) # pip install 'context-engineerin
|
|
|
111
111
|
history = turns_from_openai(existing_openai_messages, scope) # reuse a chat history you already have
|
|
112
112
|
```
|
|
113
113
|
|
|
114
|
-
###
|
|
114
|
+
### Finds meaning, not just matching words
|
|
115
115
|
|
|
116
|
-
|
|
117
|
-
|
|
116
|
+
Retrieval combines keyword search with a small embedding model bundled in the
|
|
117
|
+
package, so "retailer" finds "merchant". It runs locally with numpy: no download,
|
|
118
|
+
no network, no extra dependency (the package is ~7 MB because of the model).
|
|
119
|
+
Ranking is 0.5 x meaning score + 0.5 x keyword score.
|
|
118
120
|
|
|
119
121
|
```python
|
|
120
|
-
|
|
121
|
-
from context_engine.embeddings import Model2VecEmbedder
|
|
122
|
-
|
|
123
|
-
embedder = Model2VecEmbedder() # pinned minishlab/potion-base-8M; loads only when you create it
|
|
124
|
-
result = assemble_context(history, question, pins, budget, system=system, embedder=embedder)
|
|
122
|
+
result = assemble_context(..., embedder=None) # keyword-only, as before 0.15.0
|
|
123
|
+
from context_engine.embeddings import FastEmbedEmbedder, FunctionEmbedder, Model2VecEmbedder
|
|
124
|
+
result = assemble_context(..., embedder=FastEmbedEmbedder()) # more accurate, slower (extra [fastembed])
|
|
125
125
|
```
|
|
126
126
|
|
|
127
|
-
|
|
128
|
-
speed? `FastEmbedEmbedder("BAAI/bge-small-en-v1.5")` (extra `[fastembed]`). Or wrap
|
|
129
|
-
your own embedding function or API with `FunctionEmbedder`.
|
|
127
|
+
`FunctionEmbedder` wraps your own embedding function or API.
|
|
130
128
|
|
|
131
129
|
### Use it from an MCP client
|
|
132
130
|
|
|
@@ -178,12 +176,14 @@ These are enforced in code and covered by about 1,400 tests:
|
|
|
178
176
|
benchmark, the default settings keep 31 of 31 planted facts at 900 and 3000
|
|
179
177
|
tokens, and a live model run answered 31 of 31 correctly at 900 tokens. But
|
|
180
178
|
that benchmark is one synthetic conversation written alongside the engine.
|
|
181
|
-
- **Reworded questions.**
|
|
182
|
-
|
|
183
|
-
|
|
184
|
-
|
|
185
|
-
|
|
186
|
-
|
|
179
|
+
- **Reworded questions.** When we reword the 31 benchmark questions so they share
|
|
180
|
+
no words with the stored facts, keyword-only retrieval keeps 3 of 31 facts; the
|
|
181
|
+
default hybrid retrieval keeps 21 of 31 (retrieval alone: 24–25 of 31), with no
|
|
182
|
+
loss on the original questions. In a live model run on the reworded questions,
|
|
183
|
+
keyword-only answered 3 of 31 correctly and hybrid 18 of 31 (21 of 31 with
|
|
184
|
+
lenient grading, which ignores trailing punctuation and dash characters). A fact
|
|
185
|
+
buried in a long, repetitive message and asked with different words is still
|
|
186
|
+
hard (12 of 31). Run the offline test: `context-engine strategy-eval --questions paraphrased`.
|
|
187
187
|
- **Real-world data.** There are no results yet on real user conversations.
|
|
188
188
|
- **Exact provider token counts.** Budgets use a local tokenizer estimate.
|
|
189
189
|
Providers may count differently. On small requests, provider counts were up
|
|
@@ -9,7 +9,7 @@ that fits the budget. Those messages keep the recent turns, the facts you pinned
|
|
|
9
9
|
and the older evidence that matches the question. It never calls a model by
|
|
10
10
|
itself, so you send the messages to any provider you like.
|
|
11
11
|
|
|
12
|
-
> **Status: alpha (0.
|
|
12
|
+
> **Status: alpha (0.15.0).** Good for developers to try locally. It is not yet
|
|
13
13
|
> proven on real-world data, and there is no hosted service. See
|
|
14
14
|
> [What is not proven yet](#what-is-not-proven-yet).
|
|
15
15
|
|
|
@@ -70,22 +70,20 @@ chat_model.invoke(langchain_messages(result)) # pip install 'context-engineerin
|
|
|
70
70
|
history = turns_from_openai(existing_openai_messages, scope) # reuse a chat history you already have
|
|
71
71
|
```
|
|
72
72
|
|
|
73
|
-
###
|
|
73
|
+
### Finds meaning, not just matching words
|
|
74
74
|
|
|
75
|
-
|
|
76
|
-
|
|
75
|
+
Retrieval combines keyword search with a small embedding model bundled in the
|
|
76
|
+
package, so "retailer" finds "merchant". It runs locally with numpy: no download,
|
|
77
|
+
no network, no extra dependency (the package is ~7 MB because of the model).
|
|
78
|
+
Ranking is 0.5 x meaning score + 0.5 x keyword score.
|
|
77
79
|
|
|
78
80
|
```python
|
|
79
|
-
|
|
80
|
-
from context_engine.embeddings import Model2VecEmbedder
|
|
81
|
-
|
|
82
|
-
embedder = Model2VecEmbedder() # pinned minishlab/potion-base-8M; loads only when you create it
|
|
83
|
-
result = assemble_context(history, question, pins, budget, system=system, embedder=embedder)
|
|
81
|
+
result = assemble_context(..., embedder=None) # keyword-only, as before 0.15.0
|
|
82
|
+
from context_engine.embeddings import FastEmbedEmbedder, FunctionEmbedder, Model2VecEmbedder
|
|
83
|
+
result = assemble_context(..., embedder=FastEmbedEmbedder()) # more accurate, slower (extra [fastembed])
|
|
84
84
|
```
|
|
85
85
|
|
|
86
|
-
|
|
87
|
-
speed? `FastEmbedEmbedder("BAAI/bge-small-en-v1.5")` (extra `[fastembed]`). Or wrap
|
|
88
|
-
your own embedding function or API with `FunctionEmbedder`.
|
|
86
|
+
`FunctionEmbedder` wraps your own embedding function or API.
|
|
89
87
|
|
|
90
88
|
### Use it from an MCP client
|
|
91
89
|
|
|
@@ -137,12 +135,14 @@ These are enforced in code and covered by about 1,400 tests:
|
|
|
137
135
|
benchmark, the default settings keep 31 of 31 planted facts at 900 and 3000
|
|
138
136
|
tokens, and a live model run answered 31 of 31 correctly at 900 tokens. But
|
|
139
137
|
that benchmark is one synthetic conversation written alongside the engine.
|
|
140
|
-
- **Reworded questions.**
|
|
141
|
-
|
|
142
|
-
|
|
143
|
-
|
|
144
|
-
|
|
145
|
-
|
|
138
|
+
- **Reworded questions.** When we reword the 31 benchmark questions so they share
|
|
139
|
+
no words with the stored facts, keyword-only retrieval keeps 3 of 31 facts; the
|
|
140
|
+
default hybrid retrieval keeps 21 of 31 (retrieval alone: 24–25 of 31), with no
|
|
141
|
+
loss on the original questions. In a live model run on the reworded questions,
|
|
142
|
+
keyword-only answered 3 of 31 correctly and hybrid 18 of 31 (21 of 31 with
|
|
143
|
+
lenient grading, which ignores trailing punctuation and dash characters). A fact
|
|
144
|
+
buried in a long, repetitive message and asked with different words is still
|
|
145
|
+
hard (12 of 31). Run the offline test: `context-engine strategy-eval --questions paraphrased`.
|
|
146
146
|
- **Real-world data.** There are no results yet on real user conversations.
|
|
147
147
|
- **Exact provider token counts.** Budgets use a local tokenizer estimate.
|
|
148
148
|
Providers may count differently. On small requests, provider counts were up
|
|
@@ -4,7 +4,7 @@ build-backend = "hatchling.build"
|
|
|
4
4
|
|
|
5
5
|
[project]
|
|
6
6
|
name = "context-engineering-core"
|
|
7
|
-
version = "0.
|
|
7
|
+
version = "0.15.0"
|
|
8
8
|
description = "Provider-independent context layers, source contracts, and token budget accounting"
|
|
9
9
|
readme = "README.md"
|
|
10
10
|
license = "Apache-2.0"
|
{context_engineering_core-0.14.0 → context_engineering_core-0.15.0}/src/context_engine/cli.py
RENAMED
|
@@ -88,9 +88,9 @@ def main(argv: list[str] | None = None) -> int:
|
|
|
88
88
|
help="paraphrased: reworded questions with no shared words (lexical stress test)",
|
|
89
89
|
)
|
|
90
90
|
strategies.add_argument(
|
|
91
|
-
"--semantic",
|
|
91
|
+
"--no-semantic",
|
|
92
92
|
action="store_true",
|
|
93
|
-
help="
|
|
93
|
+
help="Skip the hybrid strategies (retrieval_semantic, combined_semantic)",
|
|
94
94
|
)
|
|
95
95
|
strategies.add_argument("--data-dir", type=Path)
|
|
96
96
|
strategies.add_argument("--output", type=Path, help="Save JSON to a new file; never overwrite")
|
|
@@ -147,17 +147,12 @@ def main(argv: list[str] | None = None) -> int:
|
|
|
147
147
|
budgets = None if args.budget is None else tuple(args.budget)
|
|
148
148
|
if budgets is not None and any(b <= 0 for b in budgets):
|
|
149
149
|
raise ContextEngineError("Budgets must be positive integers")
|
|
150
|
-
embedder = None
|
|
151
|
-
if args.semantic:
|
|
152
|
-
from .embeddings import Model2VecEmbedder
|
|
153
|
-
|
|
154
|
-
embedder = Model2VecEmbedder()
|
|
155
150
|
result = compare_strategies(
|
|
156
151
|
bundle,
|
|
157
152
|
budgets,
|
|
158
153
|
include_probes=args.probes,
|
|
159
154
|
questions=args.questions,
|
|
160
|
-
embedder=
|
|
155
|
+
embedder=None if args.no_semantic else "builtin",
|
|
161
156
|
)
|
|
162
157
|
if args.output is not None:
|
|
163
158
|
save_inspection(args.output, result)
|
|
@@ -0,0 +1,33 @@
|
|
|
1
|
+
Bundled embedding model data
|
|
2
|
+
============================
|
|
3
|
+
|
|
4
|
+
potion-base-8M-int8.npz and potion-base-8M-vocab.txt are derived from the
|
|
5
|
+
Model2Vec model "minishlab/potion-base-8M" (revision
|
|
6
|
+
bf8b056651a2c21b8d2565580b8569da283cab23), https://huggingface.co/minishlab/potion-base-8M,
|
|
7
|
+
licensed under the MIT License. Its vocabulary comes from BAAI/bge-base-en-v1.5
|
|
8
|
+
(MIT License). The vectors were quantized to 8-bit integers with one float32
|
|
9
|
+
scale per token by the Context Engine project; no other changes.
|
|
10
|
+
|
|
11
|
+
MIT License
|
|
12
|
+
|
|
13
|
+
Copyright (c) 2024 Thomas van Dongen
|
|
14
|
+
(copyright line as in the MIT license of the model2vec project; the model card
|
|
15
|
+
of minishlab/potion-base-8M declares "license: mit")
|
|
16
|
+
|
|
17
|
+
Permission is hereby granted, free of charge, to any person obtaining a copy
|
|
18
|
+
of this software and associated documentation files (the "Software"), to deal
|
|
19
|
+
in the Software without restriction, including without limitation the rights
|
|
20
|
+
to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
|
|
21
|
+
copies of the Software, and to permit persons to whom the Software is
|
|
22
|
+
furnished to do so, subject to the following conditions:
|
|
23
|
+
|
|
24
|
+
The above copyright notice and this permission notice shall be included in all
|
|
25
|
+
copies or substantial portions of the Software.
|
|
26
|
+
|
|
27
|
+
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
|
|
28
|
+
IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
|
|
29
|
+
FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
|
|
30
|
+
AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
|
|
31
|
+
LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
|
|
32
|
+
OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
|
|
33
|
+
SOFTWARE.
|