Skip to main content

llama-index packs node_parser integration

Project description

Semantic Chunking Llama Pack

This LlamaPack implements the semantic chunking algorithm first proposed by Greg Kamradt in his Five Levels of Text Splitting tutorial.

How it works:

  • Split text into sentences.
  • For each sentence, generate an embedding.
  • Measure cosine distance between each pair of consecutive sentences.
  • Get the 95% percentile cosine distance, set that as the threshold.
  • Create a new chunk if the cosine distance of a sentence compared to prev. exceeds that threshold.

CLI Usage

You can download llamapacks directly using llamaindex-cli, which comes installed with the llama-index python package:

llamaindex-cli download-llamapack LLMCompilerAgentPack --download-dir ./llm_compiler_agent_pack

You can then inspect the files at ./llm_compiler_agent_pack and use them as a template for your own project!

Code Usage

You can download the pack to a directory. NOTE: You must specify skip_load=True - the pack contains multiple files, which makes it hard to load directly.

We will show you how to import the agent from these files!

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

Built Distribution

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

File details

Details for the file llama_index_packs_node_parser_semantic_chunking-0.5.0.tar.gz.

File metadata

  • Download URL: llama_index_packs_node_parser_semantic_chunking-0.5.0.tar.gz
  • Upload date:
  • Size: 6.0 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: uv/0.10.9 {"installer":{"name":"uv","version":"0.10.9","subcommand":["publish"]},"python":null,"implementation":{"name":null,"version":null},"distro":{"name":"Ubuntu","version":"24.04","id":"noble","libc":null},"system":{"name":null,"release":null},"cpu":null,"openssl_version":null,"setuptools_version":null,"rustc_version":null,"ci":true}

File hashes

Hashes for llama_index_packs_node_parser_semantic_chunking-0.5.0.tar.gz
Algorithm Hash digest
SHA256 ec77f22dda62442a01044e28109274f96f42bafe9e5d141ac4783dcce69fe1c1
MD5 27b36da6fee89e6281665f5a5edf7641
BLAKE2b-256 c0172eb381a07dfcef14b7cfcd4de406f96d4196f621837982eef93c37e85b56

See more details on using hashes here.

File details

Details for the file llama_index_packs_node_parser_semantic_chunking-0.5.0-py3-none-any.whl.

File metadata

  • Download URL: llama_index_packs_node_parser_semantic_chunking-0.5.0-py3-none-any.whl
  • Upload date:
  • Size: 5.9 kB
  • Tags: Python 3
  • Uploaded using Trusted Publishing? No
  • Uploaded via: uv/0.10.9 {"installer":{"name":"uv","version":"0.10.9","subcommand":["publish"]},"python":null,"implementation":{"name":null,"version":null},"distro":{"name":"Ubuntu","version":"24.04","id":"noble","libc":null},"system":{"name":null,"release":null},"cpu":null,"openssl_version":null,"setuptools_version":null,"rustc_version":null,"ci":true}

File hashes

Hashes for llama_index_packs_node_parser_semantic_chunking-0.5.0-py3-none-any.whl
Algorithm Hash digest
SHA256 84df4b152c44cbd53a6788a029c36ed9e95caf7395135024d6a6612f8798afe3
MD5 4309b14e85770d1c4817157736d26328
BLAKE2b-256 4b181d9ba765faf8c2f647e2c1ba56010125df41e22eeb9bc51cc72e9ca2f249

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