Skip to main content

ingest-anything: from data to vector database effortlessly

Project description

ingest-anything

From data to vector database effortlessly


Ingest-Anything Logo

ingest-anything is a python package aimed at providing a smooth solution to ingest non-PDF files into vector databases, given that most ingestion pipelines are focused on PDF/markdown files. Leveraging chonkie, PdfItDown, Llamaindex, Sentence Transformers embeddings and Qdrant, ingest-anything gives you a fully-automated pipeline for document ingestion within few lines of code!

Find out more about ingest-anything on the Documentation website!

Workflow

Ingest-Anything Workflow

For text files

  • The input files are converted into PDF by PdfItDown
  • The PDF text is extracted using LlamaIndex Docling reader
  • The text is chunked exploiting Chonkie's functionalities
  • The chunks are embedded thanks to Sentence Transformers models
  • The embeddings are loaded into a Qdrant vector database

For code files

  • The text is extracted from code files using LlamaIndex SimpleDirectoryReader
  • The text is chunked exploiting Chonkie's CodeChunker
  • The chunks are embedded thanks to Sentence Transformers models
  • The embeddings are loaded into a Qdrant vector database

Installation and usage

ingest-anything can be installed using pip in the following way:

pip install ingest-anything
# or, for a faster installation
uv pip install ingest-anything

And is available in your python scripts:

  • You can initialize the interface for text-based files like this:
from ingest_anything.ingestion import IngestAnything, QdrantClient, AsyncQdrantClient

coll_name = "Flowers"
client = QdrantClient("http://localhost:6333")
aclient = AsyncQdrantClient("http://localhost:6333")
ingestor = IngestAnything(qdrant_client=client, async_qdrant_client=aclient, collection_name=coll_name, hybrid_search=True)
  • And ingest your files:
# with a list of files
ingestor.ingest(chunker="late", files_or_dir=['tests/data/test.docx', 'tests/data/test0.png', 'tests/data/test1.csv', 'tests/data/test2.json', 'tests/data/test3.md', 'tests/data/test4.xml', 'tests/data/test5.zip'], embedding_model="sentence-transformers/all-MiniLM-L6-v2")
# with a directory
ingestor.ingest(chunker="token", files_or_dir="tests/data", tokenizer="gpt2", embedding_model="sentence-transformers/all-MiniLM-L6-v2")
  • You can also initialize the interface for code files
from ingest_anything.ingestion import IngestCode, QdrantClient, AsyncQdrantClient

coll_name = "go-code"
client = QdrantClient("http://localhost:6333")
aclient = AsyncQdrantClient("http://localhost:6333")
ingestor = IngestCode(qdrant_client=client, async_qdrant_client=aclient, collection_name=coll_name, hybrid_search=True)
  • And then ingest your code files:
# with a list of files
ingestor.ingest(files=["tests/code/acronym.go", "tests/code/animal_magic.go", "tests/code/atbash_cipher_test.go"], embedding_model="sentence-transformers/all-MiniLM-L6-v2", language="go")

You can find a complete reference for the package in REFERENCE.md

Contributing

Contributions are always welcome!

Find contribution guidelines at CONTRIBUTING.md

License and Funding

This project is open-source and is provided under an MIT License.

If you found it useful, please consider funding it.

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

ingest_anything-0.1.2.tar.gz (11.0 kB view details)

Uploaded Source

Built Distribution

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

ingest_anything-0.1.2-py3-none-any.whl (8.5 kB view details)

Uploaded Python 3

File details

Details for the file ingest_anything-0.1.2.tar.gz.

File metadata

  • Download URL: ingest_anything-0.1.2.tar.gz
  • Upload date:
  • Size: 11.0 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: python-httpx/0.28.1

File hashes

Hashes for ingest_anything-0.1.2.tar.gz
Algorithm Hash digest
SHA256 2c4c35961aef884f702f5e93b28aa61b17d09a88b75b32e7d46a9a1274515038
MD5 5eb4b86b28b09153c9331496eb681a3b
BLAKE2b-256 e74466b6b6b7f5556b3c02d46b6a3ca6e1b6ab74ee161986078c63e282046e82

See more details on using hashes here.

File details

Details for the file ingest_anything-0.1.2-py3-none-any.whl.

File metadata

File hashes

Hashes for ingest_anything-0.1.2-py3-none-any.whl
Algorithm Hash digest
SHA256 316d780febd70db6d28bcd995bce8be79ea78945419e752e4b73ec5372d91056
MD5 7312c20004c5233e5a998c2903244420
BLAKE2b-256 32ce41db6e5542f7aefae6067c82860350fc1b9486811dcf8b1cd826be63e747

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