Source-agnostic search/indexing kernel: domain-agnostic content ingestion, hybrid vector+keyword+graph search, pluggable embedding/LLM/reranker providers.
Project description
andnp-searchkernel
A domain-agnostic search and indexing kernel for hybrid keyword, vector, and graph retrieval with pluggable embedding, LLM, and reranker providers.
Status
0.5.0, pre-alpha: canonical record architecture. Record ingestion, candidate retrieval, fusion, graph expansion, and hydration use the record-oriented contracts. The package is still evolving, and the validation limits below are important when assessing production readiness.
Canonical record contracts
Records are identified by the composite tuple
(workspace_id, source_kind, source_id). The canonical storage_key is the
serialized form of that tuple and is the identity used by local and Postgres
stores, fusion, graph expansion, caches, and hydration. A bare source_id is
not a safe identity because different sources or workspaces may reuse it.
The search path also preserves these invariants:
RecordHitcarries the completeRecordIdentityacross every backend boundary.- Search is read-only. Source lifecycle, checkpoints, access state, and supersession state are not changed by a query.
- Status, workspace, source-kind, and candidate-storage-key filters are applied as retrieval constraints. Candidate-ID filtering is an explicit adapter capability; an adapter must not silently ignore a requested filter.
- Equal scores are ordered by canonical
storage_key, so scalar, batch, and concurrent execution remain deterministic. - Record results retain
SearchResultProvenance, including contributing strategies, rank/raw-score details, score adjustments, and parent-expansion identity where applicable. Degraded-mode failures are reported explicitly.
Compose canonical search
Compose a local record pipeline from the record hydrator and store ports:
from searchkernel.api import SearchOrchestrator
search = SearchOrchestrator(
hydrator=record_hydrator,
keyword_store=keyword_store,
vector_store=vector_store,
graph_store=graph_store,
embedding_provider=embedding_provider,
)
SearchOrchestrator is the canonical record query boundary. Source adapters
map native data into Record; the core keeps source-specific fields in opaque
metadata and uses injected policy objects for filtering and ranking.
Ingest canonical records
SemanticRecordIngestor is the canonical keyword-and-vector ingestor. It
returns an IngestionReceipt with one outcome per record and leaves checkpoint
persistence to the caller. ResumableSemanticCoordinator adds bounded source
iteration and persists a source checkpoint only after the batch completes
successfully:
- Strict ingestion stops at the first failed record or stage and the
coordinator raises
IngestionError; it does not roll back work already committed to another store. - Lenient ingestion retains successful records, reports failed records with stage errors, and does not advance the checkpoint for a failed batch.
- Once a batch fails, later source batches may still be processed in lenient mode, but their checkpoints remain blocked until the failed work is retried.
These are partial-failure guarantees, not a cross-store transaction. A source
can therefore be queryable with a partial index; readiness snapshots expose
indexing, partial, and ready states.
Retired compatibility boundary
The former chunk-oriented query pipeline and federated query execution were
retired before 0.5.0 and are not supported APIs. Chunks may still be produced
during ingestion, but query callers use Record, RecordIdentity, RecordHit,
the record store ports, and the canonical record pipeline. SearchKernel
remains an ingestion and composition facade; its query method returns
canonical record outcomes only.
Optional backends
The core package provides source-agnostic domain models, ports, record search, and evaluation primitives. Install only the integrations an application uses:
pip install andnp-searchkernel[pgvector,huggingface,markdown]
Available extras are faiss, pgvector, huggingface, ollama, and
markdown. FAISS and pgvector implement the same record-oriented backend
contracts and can be selected independently. Importing the core does not
require any optional provider or backend.
Validation limits
The CI quality gate runs Ruff, Pyrefly, import-linter, and the complete
collected suite while excluding slow and real_embeddings tests. Pyrefly is
the only type checker. This gate does not prove production relevance, latency,
memory use, or parity across every backend. The pgvector tests need Docker or
SEARCHKERNEL_PG_DSN; real-embedding tests need locally cached models and are
not part of the default offline gate. Use the benchmark artifacts and the
performance roadmap for the measured
scope and remaining limits.
Releases
Merges to main with feat, fix, or breaking Conventional Commits are
released automatically. The release workflow bumps the SemVer version,
updates pyproject.toml and uv.lock, pushes a v* tag, and dispatches the
PyPI publishing workflow. Documentation, chore, and test-only commits do not
create releases.
License
MIT License. See LICENSE for details.
Project details
Release history Release notifications | RSS feed
Download files
Download the file for your platform. If you're not sure which to choose, learn more about installing packages.
Source Distribution
Built Distribution
Filter files by name, interpreter, ABI, and platform.
If you're not sure about the file name format, learn more about wheel file names.
Copy a direct link to the current filters
File details
Details for the file andnp_searchkernel-0.6.0.tar.gz.
File metadata
- Download URL: andnp_searchkernel-0.6.0.tar.gz
- Upload date:
- Size: 443.9 kB
- Tags: Source
- Uploaded using Trusted Publishing? Yes
- Uploaded via: twine/7.0.0 CPython/3.13.14
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
6fa851ba6c1e71d0993283cf57ce1521ab9623d3eed0b34a68d3b248d7ad87a3
|
|
| MD5 |
14d03416cc5892c5bd9d51e567c814e7
|
|
| BLAKE2b-256 |
5ab639848f5f5c4197bfdd2c78b1433d8c5a9c8e0bdda0e81530981b91fafc95
|
Provenance
The following attestation bundles were made for andnp_searchkernel-0.6.0.tar.gz:
Publisher:
publish.yml on andnp/andnp-searchkernel
-
Statement:
-
Statement type:
https://in-toto.io/Statement/v1 -
Predicate type:
https://docs.pypi.org/attestations/publish/v1 -
Subject name:
andnp_searchkernel-0.6.0.tar.gz -
Subject digest:
6fa851ba6c1e71d0993283cf57ce1521ab9623d3eed0b34a68d3b248d7ad87a3 - Sigstore transparency entry: 2329048658
- Sigstore integration time:
-
Permalink:
andnp/andnp-searchkernel@5b87667592e49d718d1f92d5e9e068ce35773a00 -
Branch / Tag:
refs/tags/v0.6.0 - Owner: https://github.com/andnp
-
Access:
public
-
Token Issuer:
https://token.actions.githubusercontent.com -
Runner Environment:
github-hosted -
Publication workflow:
publish.yml@5b87667592e49d718d1f92d5e9e068ce35773a00 -
Trigger Event:
workflow_dispatch
-
Statement type:
File details
Details for the file andnp_searchkernel-0.6.0-py3-none-any.whl.
File metadata
- Download URL: andnp_searchkernel-0.6.0-py3-none-any.whl
- Upload date:
- Size: 214.4 kB
- Tags: Python 3
- Uploaded using Trusted Publishing? Yes
- Uploaded via: twine/7.0.0 CPython/3.13.14
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
03be53734dd32084b04e7aec55d4cd520c84a308fc2fa2b3241d373cf8d8880b
|
|
| MD5 |
20f7c8c4dce9338ae87cc582a07d0051
|
|
| BLAKE2b-256 |
c2114b0a698673a807fd128db56d79a12182dee8a21a87a2a4098fa110a88637
|
Provenance
The following attestation bundles were made for andnp_searchkernel-0.6.0-py3-none-any.whl:
Publisher:
publish.yml on andnp/andnp-searchkernel
-
Statement:
-
Statement type:
https://in-toto.io/Statement/v1 -
Predicate type:
https://docs.pypi.org/attestations/publish/v1 -
Subject name:
andnp_searchkernel-0.6.0-py3-none-any.whl -
Subject digest:
03be53734dd32084b04e7aec55d4cd520c84a308fc2fa2b3241d373cf8d8880b - Sigstore transparency entry: 2329048706
- Sigstore integration time:
-
Permalink:
andnp/andnp-searchkernel@5b87667592e49d718d1f92d5e9e068ce35773a00 -
Branch / Tag:
refs/tags/v0.6.0 - Owner: https://github.com/andnp
-
Access:
public
-
Token Issuer:
https://token.actions.githubusercontent.com -
Runner Environment:
github-hosted -
Publication workflow:
publish.yml@5b87667592e49d718d1f92d5e9e068ce35773a00 -
Trigger Event:
workflow_dispatch
-
Statement type: