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.1.tar.gz (27.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.1-py3-none-any.whl (16.8 kB view details)

Uploaded Python 3

File details

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

File metadata

  • Download URL: pk_ai_tools-0.2.1.tar.gz
  • Upload date:
  • Size: 27.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.1.tar.gz
Algorithm Hash digest
SHA256 e40d95d93354e25d32c6e87c7723bc54ea3c4de30796e559e5b3ae6e7ea63a22
MD5 a46dc711d595925891889cadb0379c11
BLAKE2b-256 25acd9dd5b65d4e33ad9802df271ade0cc69b201d9c1363c7168714beaa0ad8a

See more details on using hashes here.

File details

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

File metadata

  • Download URL: pk_ai_tools-0.2.1-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.1-py3-none-any.whl
Algorithm Hash digest
SHA256 0b78c78cc5233fefc97716bc83d9d090e78065bfc54257fb82bec02e91a4fdab
MD5 d1da5f5531201088376f5cb607a2f8a6
BLAKE2b-256 5edda2e2877c17c055cfc7d24ed05a414c3489271272c7e0eb890b40eb9e9f13

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