Skip to main content

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 (or CHATGPT_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() in tool_agent.py (e.g. add get_page_images).
  • Another agent in your app: compose ChunkSmithAgent alongside your own planners/retrievers — this package is one document Q&A brain, not your whole system.

Project details


Download files

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

Source Distribution

chunksmith_agent-0.6.7.tar.gz (77.7 kB view details)

Uploaded Source

Built Distribution

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

chunksmith_agent-0.6.7-py3-none-any.whl (100.2 kB view details)

Uploaded Python 3

File details

Details for the file chunksmith_agent-0.6.7.tar.gz.

File metadata

  • Download URL: chunksmith_agent-0.6.7.tar.gz
  • Upload date:
  • Size: 77.7 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

Hashes for chunksmith_agent-0.6.7.tar.gz
Algorithm Hash digest
SHA256 582cb8cee67457f6fe2f96f8cd27617e218e3184cb953a2bde5ed0cbc19b5b19
MD5 af1bbc2aa0331707f1e7c07bb049ce37
BLAKE2b-256 23ebf5ceef40f336737c35bbeaf7fcbc6f3b570886f1e546ad0f4391744c401a

See more details on using hashes here.

File details

Details for the file chunksmith_agent-0.6.7-py3-none-any.whl.

File metadata

  • Download URL: chunksmith_agent-0.6.7-py3-none-any.whl
  • Upload date:
  • Size: 100.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

Hashes for chunksmith_agent-0.6.7-py3-none-any.whl
Algorithm Hash digest
SHA256 1bbf98732cca6fa6482ed66fb9d7459ad6d0a7ce9bfd6887f7de071e42c7e85d
MD5 743cdea45b8dea1bb9e3eb6a48b00990
BLAKE2b-256 e718829b6c01490474f8d16bb5436aa2c60dac1a2fd3bfa96d552b691ae33007

See more details on using hashes here.

Supported by

AWS Cloud computing and Security Sponsor Datadog Monitoring Depot Continuous Integration Fastly CDN Google Download Analytics Pingdom Monitoring Sentry Error logging StatusPage Status page