qortex-ingest
Pluggable document ingestion for qortex: extract concepts, relations, and rules from any source into a knowledge graph.
Install
pip install qortex-ingest
With extraction backends:
pip install "qortex-ingest[anthropic]" # Claude API extraction
pip install "qortex-ingest[pdf]" # PDF support (pymupdf + pdfplumber)
pip install "qortex-ingest[all]" # everything
Quick Start
from qortex.ingest import IngestionManifest
from qortex.ingest.text import TextIngestor
from qortex.ingest.backends import get_extraction_backend
# Auto-detect best available backend (Anthropic > Ollama > Stub)
backend = get_extraction_backend()
ingestor = TextIngestor(backend=backend)
manifest: IngestionManifest = ingestor.ingest(
source_path="notes.txt",
domain="my-project",
)
print(f"Extracted {len(manifest.concepts)} concepts, {len(manifest.edges)} relations")
What It Does
qortex-ingest converts documents into structured knowledge graph components:
- Chunk — Split source by format (paragraphs, headings, sentences)
- Extract — Two-pass LLM extraction: generalizable concepts, then illustrative examples reconciled onto parents
- Relate — 10 relation types:
REQUIRES,USES,REFINES,IMPLEMENTS,PART_OF,SIMILAR_TO,ALTERNATIVE_TO,SUPPORTS,CHALLENGES,CONTRADICTS - Assemble — Output a single
IngestionManifest(the universal contract)
Ingestors
| Ingestor | Format | Chunking Strategy |
|---|---|---|
TextIngestor |
Plain text | Fixed-size with configurable overlap |
MarkdownIngestor |
Markdown | By heading hierarchy, preserves structure |
SentenceBoundaryChunker |
Online/streaming | Regex sentence boundaries, SHA256 IDs |
Pluggable Chunkers
Any callable matching ChunkingStrategy can replace the default:
from qortex.online.chunker import Chunk
def my_chunker(
text: str,
max_tokens: int = 256,
overlap_tokens: int = 32,
source_id: str = "",
) -> list[Chunk]:
# Your custom chunking logic (tiktoken, semantic, etc.)
...
Extraction Backends
| Backend | Cost | Features |
|---|---|---|
AnthropicExtractionBackend |
~$0.60/57KB | Full extraction: concepts, relations, rules, code examples |
OllamaExtractionBackend |
Free (local) | Concepts, relations, rules (no code examples) |
StubLLMBackend |
Free | Testing only — returns configured fixtures |
Auto-detection priority: Anthropic (if ANTHROPIC_API_KEY set) > Ollama (if reachable) > Stub.
Output: IngestionManifest
The manifest is the universal contract between ingestion and the knowledge graph:
@dataclass
class IngestionManifest:
source: SourceMetadata # origin info + stats
domain: str # knowledge domain name
concepts: list[ConceptNode] # extracted concepts with embeddings
edges: list[ConceptEdge] # typed relations between concepts
rules: list[ExplicitRule] # best practices, warnings, principles
code_examples: list[CodeExample] # linked to concepts and rules
Requirements
- Python 3.11+
qortex(for core models —IngestionManifest,ConceptNode, etc.)anthropic(optional, for Claude extraction)pymupdf+pdfplumber(optional, for PDF support)
License
MIT
Metadata
Release files for qortex-ingest 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 | |
|---|---|---|---|
| qortex_ingest-0.1.0.tar.gz | 15.3 kB | Details |
Built distribution (wheel)
| File | Interpreter | ABI | Platform | Reset |
|---|---|---|---|---|
| qortex_ingest-0.1.0-py3-none-any.whl | Python 3 | none | any | Details |
Total release size: 35.3 kB
Release files / qortex_ingest-0.1.0.tar.gz
| Download URL | qortex_ingest-0.1.0.tar.gz |
|---|---|
| Size | 15.3 kB |
| Tags | Source |
|
SHA-256 checksum How to use checksums |
7ab9547e9c7b0cf1204d12e3fa7ee80a22facb1070d41d8a65ba23fc9a652398
|
|
BLAKE2b-256 checksum How to use checksums |
6c3002e1eb59cb3e5e9f0c0e4fed020d89281d62262226503c2d949706355a55
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
Yes |
| Uploaded via |
twine/6.1.0 CPython/3.13.7
|
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.
PyPI Publish Attestation
PyPI verified that this artifact, at this checksum, originated from the publisher listed below.
Signed by GitHub Actions, verified by PyPI on Feb 15, 2026.
Transparency logRelease files / qortex_ingest-0.1.0-py3-none-any.whl
| Download URL | qortex_ingest-0.1.0-py3-none-any.whl |
|---|---|
| Size | 20.0 kB |
| Tags | Python 3 |
|
SHA-256 checksum How to use checksums |
c68b9ea3557a7d11b64c0360c7a7b0beebc5723d93a7f0979d3c138c030eeb45
|
|
BLAKE2b-256 checksum How to use checksums |
172a6804de65045c9fa0340a46c402f13d868139302845694ae02124b6ceb87b
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
Yes |
| Uploaded via |
twine/6.1.0 CPython/3.13.7
|
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.
PyPI Publish Attestation
PyPI verified that this artifact, at this checksum, originated from the publisher listed below.
Signed by GitHub Actions, verified by PyPI on Feb 15, 2026.
Transparency log