Skip to main content
Pre-release

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

everalgo-knowledge

Extracts a flattened topic tree (list[KnowledgeMemory]) from parsed content (ParsedContent) via LLM.

Use

from everalgo.knowledge import KnowledgeExtractor
from everalgo.types import ParsedContent

parsed = ParsedContent(text="...", mime="text/markdown")
memories = await KnowledgeExtractor(llm=client).aextract(parsed, doc_id="doc1", title="My doc")
# memories[0] = synthetic doc root; rest = DFS-ordered topic nodes.

llm: any everalgo.llm.LLMClient, passed at construction. Every call sends a system message of rules and a user message of data, requests a strict reply model as response_format, and raises everalgo.llm.LLMOutputError when the reply does not validate (no retry; the host decides). Sync bridge: extract(...).

custom_instructions= (on aextract and aclassify_category) adds the host's text to the bundled rules, never replacing them: it goes, verbatim and never rendered as a template, in a <custom_instructions> block closing the system message of every LLM call the extraction makes; None or a blank string adds nothing.

Pipeline at a glance

ParsedContent
  → preprocess + atomize           (_block_split)
  → topic-tree LLM (per batch)     (prompts.en.topic_tree_extract)
  → cross-batch merge (>1 batch)   (prompts.en.content_merge + topic_merge)
  → postprocess: split unsplit leaves + assign uncovered blocks
  → tree assembly + DFS flatten    → list[KnowledgeMemory]

Install

pip install everalgo-knowledge    # pulls everalgo-core + everalgo-parser

For development within the monorepo workspace:

uv sync --package everalgo-knowledge

Live-LLM scripts

Run from the repository root. Put LLM_API_KEY, LLM_BASE_URL, LLM_MODEL in a .env file there first; each command block below sources it inline and is paste-and-run.

Smoke test — 2 fixtures, structural assertions only, no artifacts written:

set -a; source .env; set +a
uv run pytest -m integration packages/everalgo-knowledge/tests/functional/test_extraction_smoke.py

Run one doc — dumps result (JSON + optional HTML viz) under tests/functional/outputs/:

set -a; source .env; set +a
uv run python packages/everalgo-knowledge/examples/run_one_doc.py \
  packages/everalgo-knowledge/tests/functional/fixtures/idx_multi_topic.json --html
  • everalgo-parser — produces ParsedContent from raw files (fully implemented except video, which is deferred pending ADR)
  • everalgo-core — KnowledgeMemory type is defined here

Metadata

Release files for everalgo-knowledge 0.3.0rc2

For a detailed explanation of source distributions (sdists) and built distributions (wheels), please see the package formats documentation.

Source distribution (sdist)

Source distribution for everalgo-knowledge 0.3.0rc2
File Size Uploaded Provenance Actions
everalgo_knowledge-0.3.0rc2.tar.gz 73.6 kB Without provenance Details for everalgo_knowledge-0.3.0rc2.tar.gz

Built distribution (wheel)

Table of built distributions (wheels) for everalgo-knowledge 0.3.0rc2
File Interpreter ABI Platform Actions
everalgo_knowledge-0.3.0rc2-py3-none-any.whl Python 3 none any Details for everalgo_knowledge-0.3.0rc2-py3-none-any.whl

Total release size: 115.4 kB

Release files / everalgo_knowledge-0.3.0rc2.tar.gz

Download URL everalgo_knowledge-0.3.0rc2.tar.gz
Size 73.6 kB
Tags Source
SHA-256 checksum
How to use checksums
6a1f6d8718b33fae18b4ae7ee882027c15d6db2b7c1b5bc4c26d69430b676f8c
BLAKE2b-256 checksum
How to use checksums
ef0ece9bef2ff989fd2bf74285620b63a3eb374012959f2f61aa601483915c6c
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
Yes
Uploaded via twine/7.0.0 CPython/3.12.12

Release files / everalgo_knowledge-0.3.0rc2-py3-none-any.whl

Download URL everalgo_knowledge-0.3.0rc2-py3-none-any.whl
Size 41.8 kB
Tags Python 3
SHA-256 checksum
How to use checksums
275a7cb5c2692b6eee893a1fe02a4bc806052bb873f325d1865fd347b1adc50e
BLAKE2b-256 checksum
How to use checksums
ecf8c3b9087fbf4368e3b1788071b717099b95577a3be000bc3cac25b802251a
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
Yes
Uploaded via twine/7.0.0 CPython/3.12.12

Security for everalgo-knowledge 0.3.0rc2

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.

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