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.0.tar.gz (27.3 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.0-py3-none-any.whl (16.7 kB view details)

Uploaded Python 3

File details

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

File metadata

  • Download URL: pk_ai_tools-0.2.0.tar.gz
  • Upload date:
  • Size: 27.3 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.0.tar.gz
Algorithm Hash digest
SHA256 9079a9a94a6fc9a352632e80b9e9e8fa1eb98baaf65eba575b68ca162a987216
MD5 130e0e6a7a96507a09951350a50f0c09
BLAKE2b-256 998109f74fb50fac292e8b2de01cebf91432b11f139e087cf3d5d654a372fa33

See more details on using hashes here.

File details

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

File metadata

  • Download URL: pk_ai_tools-0.2.0-py3-none-any.whl
  • Upload date:
  • Size: 16.7 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.0-py3-none-any.whl
Algorithm Hash digest
SHA256 99a806407d58bbf7cd12986484fa2365a6f7975a67221b96661ad364643e745f
MD5 a773145e9c83b3d1c27042a9a9ec4def
BLAKE2b-256 70c32678e6452626432383b85f000a416c5a85182bc750d051cf49bf9611a6ee

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