Skip to main content

AGENTIC CHUNKER

Installation

pip install agentic-chunker

Usage

from agentic_chunker import AgenticChunker
import markdown
import os

file_path = "test_files/pronoun_dep.md"
api_key = os.environ.get('OPENAI_APIKEY')
with open(file_path, 'r', encoding='utf-8') as f:
    md_content = f.read()
text = markdown.markdown(md_content)
chunker = AgenticChunker(api_key=api_key, model="gpt-4o-mini")
chunks = chunker.agentic_chunking(text, '.')
from agentic_chunker import AgenticChunker
from langchain.text_splitter import CharacterTextSplitter
import markdown
import os

file_path = "test_files/pronoun_dep.md"
api_key = os.environ.get('OPENAI_APIKEY')
with open(file_path, 'r', encoding='utf-8') as f:
    md_content = f.read()

text = markdown.markdown(md_content)
chunker = AgenticChunker(api_key=api_key, model="gpt-4o-mini")
text_splitter = CharacterTextSplitter(
    separator="\n",
    chunk_size=100,
    chunk_overlap=20
)
chunks = text_splitter.create_documents([text])

new_chunks = chunker.rechunk_langchain_chunks(chunks)

Dependencies

  • openai

Contributing

Contributions to AgenticChunker are welcome! Please make sure to follow the code style and conventions used in the project. If you have any suggestions or improvements, feel free to open an issue or submit a pull request.

License

This project is licensed under the GPL-3.0 License.

Release files for agentic-chunker 0.0.6

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

Source distribution (sdist)

Source distribution for agentic-chunker 0.0.6
File Size Uploaded
agentic_chunker-0.0.6.tar.gz 15.8 kB Details

Built distribution (wheel)

Table of built distributions (wheels) for agentic-chunker 0.0.6
File Interpreter ABI Platform
agentic_chunker-0.0.6-py3-none-any.whl Python 3 none any Details

Total release size: 32.3 kB

Release files / agentic_chunker-0.0.6.tar.gz

Download URL agentic_chunker-0.0.6.tar.gz
Size 15.8 kB
Tags Source
SHA-256 checksum
How to use checksums
8eb84a13d56ec7c2fc263a077bb39beba91b71a89dcbf22206299c971b4bff45
BLAKE2b-256 checksum
How to use checksums
bd9fd70ca2e64f5c1aa9059c25b3011e2e1d4fcec4ffeb2eddee1604aec46718
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via twine/6.1.0 CPython/3.11.6

Release files / agentic_chunker-0.0.6-py3-none-any.whl

Download URL agentic_chunker-0.0.6-py3-none-any.whl
Size 16.5 kB
Tags Python 3
SHA-256 checksum
How to use checksums
838c645164fc27cbc5e28e242748de0d62d121911be6883f795e541511b62725
BLAKE2b-256 checksum
How to use checksums
67baf46124920a004bd2ca52f237114fd8ddd3a1fdbea1ee20c55036208df2f5
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via twine/6.1.0 CPython/3.11.6

Release history Release notifications | RSS feed

This release

0.0.6 This release

2 release files

0.0.5

2 release files

0.0.4

2 release files

0.0.3

2 release files

0.0.2

2 release files

0.0.1

2 release files

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