Skip to main content
Pre-release

This release is a pre-release and may not be stable for production use.

OpenEmbedForge geometric tiger logo

Forge specialized retrieval models from your own data.

Python 3.11+ CI workflow Pytest test suite Ruff linting Apache 2.0 license Local documentation Contributions welcome

Quick Start Architecture Evaluation Research Roadmap Contributing

OpenEmbedForge turns domain corpora into auditable retrieval-training datasets and specialized retrievers for RAG.

Not another vector database. Not another RAG orchestration framework. Not just another embedding-model wrapper.

OpenEmbedForge focuses on:

corpus -> training data -> specialized retrieval model -> evaluation -> deployment

OpenEmbedForge pipeline from domain data to deployable retriever

Quick Start

Install the local development package:

pip install -e ".[dev]"

Use the v0.1 Python API:

from openembedforge.corpus import WordChunker, chunk_documents, load_documents
from openembedforge.data import dataset_from_chunks
from openembedforge.mining import RandomNegativeMiner

documents = list(load_documents("./examples/data"))
chunks = chunk_documents(documents, WordChunker(max_words=64, overlap_words=8))
dataset = RandomNegativeMiner(negatives_per_example=1, seed=42).mine(dataset_from_chunks(chunks))

dataset.to_jsonl(".tmp/train.jsonl")

Or run the same MVP flow from the CLI:

openembedforge corpus prepare examples/data --output .tmp/corpus.jsonl
openembedforge dataset make .tmp/corpus.jsonl --output .tmp/train.jsonl
openembedforge train --dataset .tmp/train.jsonl --output .tmp/model
openembedforge evaluate --model .tmp/model --dataset .tmp/train.jsonl

For a raw corpus path:

openembedforge train ./documents --output ./domain-model

Installation

Runtime is currently stdlib-only. Development tooling is optional:

pip install -e ".[dev]"

Future extras are reserved for heavier stacks:

pip install "openembedforge[train]"
pip install "openembedforge[onnx]"

openembedforge[train] enables the optional Hugging Face Transformers backend:

openembedforge train \
  --dataset .tmp/train.jsonl \
  --backend transformer \
  --model-name-or-path sentence-transformers/all-MiniLM-L6-v2 \
  --output .tmp/transformer-model

The default test suite builds a tiny local Transformer model, so CI does not download models.

Architecture

The current MVP includes:

  • corpus loading for .txt, .md, .json, and .jsonl
  • deterministic word-window chunking
  • canonical RetrievalExample and JSONL datasets
  • deterministic easy-negative mining
  • a dependency-free dense hashing encoder for local tests and examples
  • optional Transformer encoder training with an in-batch InfoNCE objective
  • Recall@K, MRR, and nDCG@10
  • CLI and Python APIs

Hard-negative mining, distillation, Matryoshka, ONNX, sparse, and late-interaction implementations are future work.

Roadmap

v0.2: synthetic query generation, query quality filtering, BM25/dense hard negatives, iterative mining, full provenance.

v0.3: teacher/student distillation, domain-specialized small encoders, Matryoshka dimensions, ONNX, quantization.

v0.4: continued domain pretraining, sparse retrieval, late interaction, hybrid retrieval, vector-store adapters.

v0.5: AutoRetriever, deployment-aware strategy selection, RAG-aware evaluation, experimental scratch pretraining.

CLI

openembedforge --help
openembedforge version
openembedforge corpus prepare ./documents --output ./data/corpus.jsonl
openembedforge dataset make ./data/corpus.jsonl --output ./data/train.jsonl
openembedforge dataset inspect ./data/train.jsonl
openembedforge train --dataset ./data/train.jsonl --output ./models/domain-retriever
openembedforge evaluate --model ./models/domain-retriever --dataset ./data/train.jsonl

Evaluation

Evaluation is independent of training code and reports:

  • Recall@1
  • Recall@5
  • Recall@10
  • MRR
  • nDCG@10

JSON output is available:

openembedforge evaluate --model .tmp/model --dataset .tmp/train.jsonl --json

Documentation

Contributing

See CONTRIBUTING.md.

License

Apache-2.0.

Download files

Download the file for your platform. If you're not sure which to choose, learn more about installing packages.

Source Distribution

openembedforge-0.1.0a1.tar.gz (62.9 kB view details)

Uploaded Source

Built Distribution

If you're not sure about the file name format, learn more about wheel file names.

openembedforge-0.1.0a1-py3-none-any.whl (33.2 kB view details)

Uploaded Python 3

File details

Details for the file openembedforge-0.1.0a1.tar.gz.

File metadata

  • Download URL: openembedforge-0.1.0a1.tar.gz
  • Upload date:
  • Size: 62.9 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/6.2.0 CPython/3.14.3

File hashes

Hashes for openembedforge-0.1.0a1.tar.gz
Algorithm Hash digest
SHA256 c375a7e616c838054ade842c320e8aa51563c365694b74930efb400eea988bff
MD5 a07667e919f07a1b8202d3e0e641f4b7
BLAKE2b-256 4b0ad4faeb4b7bc9ad4818049b096bc9cf58ae7d4bb143cde34798fa641e03cb

See more details on using hashes here.

File details

Details for the file openembedforge-0.1.0a1-py3-none-any.whl.

File metadata

File hashes

Hashes for openembedforge-0.1.0a1-py3-none-any.whl
Algorithm Hash digest
SHA256 d9be9633e37f3911af12d9b0aa21ff41af15c10acd381db74223d63293f5ae93
MD5 2764a04931aa34314abd35866ea66e31
BLAKE2b-256 3d5fc47b3ee05179d421e86119c10a9a62bf32c91de8a05d946bc63db061af22

See more details on using hashes here.

Release history Release notifications | RSS feed

This release

0.1.0a1 This release

2 files

Anthropic, PBC Visionary sponsor Bloomberg Visionary sponsor Hudson River Trading Visionary sponsor Meta Visionary sponsor NVIDIA Visionary sponsor Microsoft Sustainability sponsor Depot Continuous Integration AWS Cloud computing and Security Sponsor Datadog Monitoring Fastly CDN Google Download Analytics Sentry Error logging StatusPage Status page