ChunkSmith document Q&A agent over saved multi-indexing outlines.
Project description
chunksmith-agent
Standalone document Q&A over saved ChunkSmith index JSON (no dependency on chunksmith-core, chunksmith-multimodal, or chunksmith-pageindex).
Install
pip install chunksmith-agent
pip install "chunksmith-agent[langchain]" # LangChain tool-calling Q&A
Usage
from pathlib import Path
from chunksmith_agent import ChunkSmithAgent
from chunksmith_agent.index_builder import build_document_index_from_saved
index = build_document_index_from_saved(
pageindex_path=Path("runs/my-doc/json/my-doc_pageindex.json"),
)
agent = ChunkSmithAgent(index)
answer = agent.ask("What is this document about?")
print(answer.answer)
JSON artifact contract
The agent reads files produced by chunksmith-cli (or compatible tools) under a run folder:
| File | Fields used |
|---|---|
json/*_pageindex.json |
doc_name, structure, optional embedded canonical_bundle |
json/*_canonical_bundle.json |
elements[], coded_formate, path_image |
| Outline nodes | node_id, title, summary, start_index/end_index, anchor fields |
Environment variables
Same LLM env vars as ChunkSmith CLI / MVL:
OPENAI_API_KEY(orCHATGPT_API_KEY)PAGEINDEX_MODEL,CHUNKSMITH_LLM_MODEL,LLM_MODEL- Azure:
AZURE_API_KEY,AZURE_API_BASE,AZURE_API_VERSION
Integration patterns (loose coupling)
Do not depend on chunksmith-adapters inside this package. Pass data in yourself:
| Caller | How to load index | Agent config |
|---|---|---|
| CLI | build_document_index_from_saved(pageindex_path=...) |
load_settings() from .env |
| MVL app | chunksmith_agent_bridge.load_document_index_from_mvl(repo, ...) |
load_settings() or explicit AgentSettings |
| Custom app | Fetch JSON from your DB/S3 → build_document_index(dict) |
Your env / settings |
Install separately from CLI or MVL:
pip install "chunksmith-agent[langchain]"
Extensibility
- Outline nodes: come from saved JSON (
structure); re-index or edit JSON to add sections. - Tools: extend
_make_tools()intool_agent.py(e.g. addget_page_images). - Another agent in your app: compose
ChunkSmithAgentalongside your own planners/retrievers — this package is one document Q&A brain, not your whole system.
Project details
Release history Release notifications | RSS feed
Download files
Download the file for your platform. If you're not sure which to choose, learn more about installing packages.
Source Distribution
Built Distribution
Filter files by name, interpreter, ABI, and platform.
If you're not sure about the file name format, learn more about wheel file names.
Copy a direct link to the current filters
File details
Details for the file chunksmith_agent-0.5.0.tar.gz.
File metadata
- Download URL: chunksmith_agent-0.5.0.tar.gz
- Upload date:
- Size: 71.5 kB
- Tags: Source
- Uploaded using Trusted Publishing? No
- Uploaded via: uv/0.9.13 {"installer":{"name":"uv","version":"0.9.13"},"python":null,"implementation":{"name":null,"version":null},"distro":null,"system":{"name":null,"release":null},"cpu":null,"openssl_version":null,"setuptools_version":null,"rustc_version":null,"ci":null}
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
9601865b78bcb9cc3b6c23bba1c0298e9c6bfca4c0bfe9c9a016f94f1b4be988
|
|
| MD5 |
9ff5452a077a01f5d74255c46f6af928
|
|
| BLAKE2b-256 |
dd0a287c06ff69b43f65798ae00cfa840de179692cd6815ff8fe6919fde8f3bb
|
File details
Details for the file chunksmith_agent-0.5.0-py3-none-any.whl.
File metadata
- Download URL: chunksmith_agent-0.5.0-py3-none-any.whl
- Upload date:
- Size: 94.2 kB
- Tags: Python 3
- Uploaded using Trusted Publishing? No
- Uploaded via: uv/0.9.13 {"installer":{"name":"uv","version":"0.9.13"},"python":null,"implementation":{"name":null,"version":null},"distro":null,"system":{"name":null,"release":null},"cpu":null,"openssl_version":null,"setuptools_version":null,"rustc_version":null,"ci":null}
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
765a8f3a51a46c087127c56a2e067302f8945135a0a18e0f517b06fd994c71d0
|
|
| MD5 |
ea9e3c740a708c7f5e8e19ecc86618e5
|
|
| BLAKE2b-256 |
9e60668cdac8bd831eef97e52355811907e0e7eab4b38281af29fc1fc0d7df5b
|