Skip to main content

Simple RAG pipeline + document ingestion utilities (LangChain + Chroma + Ollama).

Project description

pk-ai-tools

pk-ai-tools is a small Python library that provides a reusable RAG (Retrieval-Augmented Generation) pipeline and a flexible document ingestion system.

It is built on top of:

  • LangChain
  • Chroma
  • Ollama

The main goal of this project is to make it easy to:

  • Ingest documents from many formats (PDF, Word, Excel, CSV, Markdown, HTML, etc.)
  • Build or update a Chroma vector database
  • Ask questions using a simple RAG pipeline backed by local Ollama models

This library was originally created for personal use and has since been generalized to be reusable across projects.


Installation

pip install pk-ai-tools
Requirements
Python 3.10  3.13

Python 3.14+ is currently not supported due to upstream dependencies (Chroma / onnxruntime)

Ollama installed and running

https://ollama.com

At least one local LLM downloaded (for example: llama3)

Quick example
python
Kopiera kod
from pk_ai_tools import RAGPipeline

rag = RAGPipeline(
    doc_folder="./data",
    language="en",
    uuid="demo-user",
    model_name="llama3"
)

answer = rag.ask("What is this documentation about?")
print(answer)
How it works (high level)
Documents in doc_folder are ingested and split into chunks

Chunks are embedded and stored in a Chroma vector database

Queries are expanded and retrieved using LangChain

Answers are generated by a local Ollama model

Supported document types
The document ingestion system supports:

PDF

Word (.docx)

Excel (.xlsx)

CSV

Markdown

HTML

Plain text

Notes
This library is designed for local, private RAG setups

No cloud APIs are required

Vector databases are stored locally

Ollama must be running before querying

Roadmap (informal)
Improve Python 3.14+ compatibility when dependencies allow

Optional dependency groups (lighter installs)

Better configuration presets

More examples and docs

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

pk_ai_tools-0.2.2.tar.gz (28.4 kB view details)

Uploaded Source

Built Distribution

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

pk_ai_tools-0.2.2-py3-none-any.whl (16.8 kB view details)

Uploaded Python 3

File details

Details for the file pk_ai_tools-0.2.2.tar.gz.

File metadata

  • Download URL: pk_ai_tools-0.2.2.tar.gz
  • Upload date:
  • Size: 28.4 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/6.2.0 CPython/3.13.5

File hashes

Hashes for pk_ai_tools-0.2.2.tar.gz
Algorithm Hash digest
SHA256 714fd799495fb43b5e13d78fb9f53c078b25ec95fdf6ebc7122c954fa1577c02
MD5 c9483d68d97ce37966675e18d5339266
BLAKE2b-256 04a3710afe191ab7c2cf585ca017d3222429fe4325adef13f9ae270346a2ffc7

See more details on using hashes here.

File details

Details for the file pk_ai_tools-0.2.2-py3-none-any.whl.

File metadata

  • Download URL: pk_ai_tools-0.2.2-py3-none-any.whl
  • Upload date:
  • Size: 16.8 kB
  • Tags: Python 3
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/6.2.0 CPython/3.13.5

File hashes

Hashes for pk_ai_tools-0.2.2-py3-none-any.whl
Algorithm Hash digest
SHA256 1d5e29383c384a266f8b8366af70d10a6edfb0efd7353d194d825c389a8adfc2
MD5 d22a09f0a9f5ce83d4964d0164865b51
BLAKE2b-256 7b83092544be0272e269dec80fd675e90da97f1b4fcc90c7b8ad453c843b7581

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