Custom Component Template
A template repository for creating custom Haystack components and publishing them as standalone Python packages.
For more details, see the Haystack documentation on creating custom components and creating custom document stores.
How to use this template
-
Click Use this template to create a new repository.
-
Rename the package directory from
src/haystack_integrations/components/example/to match your integration. See Namespace convention below for the correct path. -
Update
pyproject.toml— search forTODOcomments and replace:name: your package name, following the<technology>-haystackconvention (e.g.opensearch-haystack)description,authors,keywords,project.urlsdependencies: add your integration-specific dependenciestool.hatch.version.raw-options: if you renamed directories, the version path is still derived from git tags so no change is needed here
-
Add your component code in the renamed directory and export your classes from
__init__.py. -
Add tests in
tests/— see the skeleton intests/test_example.py. -
Search for all
TODOcomments across the project and address them.
Check out the video walkthrough for a step-by-step guide on how to use this template.
Namespace convention
Haystack integrations use the haystack_integrations namespace package. The directory structure under src/ determines the import path for your component.
Components (converters, embedders, generators, rankers, etc.) use:
src/haystack_integrations/components/<type>/<name>/
Import path: from haystack_integrations.components.<type>.<name> import MyComponent
Common component types: converters, embedders, generators, rankers, retrievers, connectors, tools, websearch
Document stores use a separate namespace:
src/haystack_integrations/document_stores/<name>/
Import path: from haystack_integrations.document_stores.<name> import MyDocumentStore
Development
This project uses Hatch for build and environment management.
# Install Hatch
pip install hatch
# Format and lint
hatch run fmt # auto-fix
hatch run fmt-check # check only
# Run tests
hatch run test:unit # unit tests only
hatch run test:integration # integration tests only
hatch run test:all # all tests
hatch run test:cov # with coverage
Publishing to PyPI
This template includes a GitHub Actions workflow that publishes your package to PyPI when you push a version tag.
-
Add a
PYPI_API_TOKENsecret to your repository settings (Settings > Secrets and variables > Actions). -
Create a version tag and push it:
git tag v0.1.0 git push origin v0.1.0
The release workflow will build and publish the package automatically.
License
Apache-2.0 - See LICENSE for details.
Metadata
Release files for neuforge-haystack 0.1.0
For a detailed explanation of source distributions (sdists) and built distributions (wheels), please see the package formats documentation.
Source distribution (sdist)
| File | Size | Uploaded | Provenance | Actions |
|---|---|---|---|---|
| neuforge_haystack-0.1.0.tar.gz | 11.9 kB | Without provenance | Details for neuforge_haystack-0.1.0.tar.gz |
Built distribution (wheel)
| File | Interpreter | ABI | Platform | Actions Reset |
|---|---|---|---|---|
| neuforge_haystack-0.1.0-py3-none-any.whl | Python 3 | none | any | Details for neuforge_haystack-0.1.0-py3-none-any.whl |
Total release size: 21.1 kB
Release files / neuforge_haystack-0.1.0.tar.gz
| Download URL | neuforge_haystack-0.1.0.tar.gz |
|---|---|
| Size | 11.9 kB |
| Tags | Source |
|
SHA-256 checksum How to use checksums |
a5915e27599653882feecf6254feb9cc474a152d5dcc30ab1c811329371c597b
|
|
BLAKE2b-256 checksum How to use checksums |
bc25cf38a9ad31aaef016fe08be9f398ea6527f255da43d3a3edc588970544da
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
No |
| Uploaded via |
twine/7.0.0 CPython/3.11.14
|
Release files / neuforge_haystack-0.1.0-py3-none-any.whl
| Download URL | neuforge_haystack-0.1.0-py3-none-any.whl |
|---|---|
| Size | 9.3 kB |
| Tags | Python 3 |
|
SHA-256 checksum How to use checksums |
62cdd01ec4ac7d07e15ac5501dd07d1ab87ed923f6c49bc1f7f7c621e326c028
|
|
BLAKE2b-256 checksum How to use checksums |
743b564c56b4a21ef7b0e618db2e87c32dd95d232b2cc9222dcb2bd4e10a28ed
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
No |
| Uploaded via |
twine/7.0.0 CPython/3.11.14
|
Security for neuforge-haystack 0.1.0
Provenance
Provenance describes where a file came from. On PyPI, provenance is shared via attestations, which provide a verifiable record of the build or publishing details. View details, limitations and caveats.
No provenance found
None of the files in this release were uploaded with provenance metadata.
A note on package security
PyPI is a repository for distributing packages, not a service for auditing them. While third-party security researchers and our staff do their best to detect and remove malicious packages, PyPI cannot guarantee the quality, security or suitability of any given package.
To learn more about protecting yourself from malicious actors, visit our package security documentation.