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 (OpenAI-compatible), passed at construction. Sync bridge: extract(...).
Pipeline at a glance
ParsedContent
→ preprocess + atomize (_block_split)
→ topic-tree LLM (per batch) (TOPIC_TREE_EXTRACT_PROMPT_EN)
→ cross-batch merge (>1 batch) (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
Related distributions
everalgo-parser— producesParsedContentfrom raw files (fully implemented except video, which is deferred pending ADR)everalgo-core—KnowledgeMemorytype is defined here
Metadata
Release files for everalgo-knowledge 0.2.0rc1
For a detailed explanation of source distributions (sdists) and built distributions (wheels), please see the package formats documentation.
Source distribution (sdist)
| File | Size | Uploaded | |
|---|---|---|---|
| everalgo_knowledge-0.2.0rc1.tar.gz | 54.7 kB | Details |
Built distribution (wheel)
| File | Interpreter | ABI | Platform | Reset |
|---|---|---|---|---|
| everalgo_knowledge-0.2.0rc1-py3-none-any.whl | Python 3 | none | any | Details |
Total release size: 91.0 kB
Release files / everalgo_knowledge-0.2.0rc1.tar.gz
| Download URL | everalgo_knowledge-0.2.0rc1.tar.gz |
|---|---|
| Size | 54.7 kB |
| Tags | Source |
|
SHA-256 checksum How to use checksums |
11b5e3c677d3326a5ef487cc11062c7ace33a1b8802df617ad39080842935c4e
|
|
BLAKE2b-256 checksum How to use checksums |
859d50d869d0839c1c81995f51cdef35cc0e6d8d7a5cd0773c934a8dc0399e0c
|
| 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.2.0rc1-py3-none-any.whl
| Download URL | everalgo_knowledge-0.2.0rc1-py3-none-any.whl |
|---|---|
| Size | 36.3 kB |
| Tags | Python 3 |
|
SHA-256 checksum How to use checksums |
1feb831672f569edff318cdc65e37b799f07e2ef328032ac976cc562f88c415d
|
|
BLAKE2b-256 checksum How to use checksums |
4fba2a564c96f13846670f96fb6658fc941f3b05f037dc975cca115cee172cec
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
Yes |
| Uploaded via |
twine/7.0.0 CPython/3.12.12
|