Skip to main content

A Python Automation Library for Creating Agents

Project description

Maticlib Logo

A high-performance Python Automation Library for Creating Agents.

License: MIT Downloads PyPI version

Maticlib is a developer-centric library designed to build complex, stateful AI workflows with ease. Whether you need a simple chat completion or a multi-node parallel execution graph, Maticlib provides the primitives to build it with a focus on type safety and performance.


Documentation

For complete documentation, visit: https://arvohsoft.github.io/maticlib/


Installation

From PyPI

pip install maticlib

From Source (Local Development)

# Clone the repository
git clone https://github.com/arvohsoft/maticlib.git
cd maticlib

# Create and activate a virtual environment
python -m venv .venv
source .venv/bin/activate  # On Windows: .venv\Scripts\activate

# Install in editable mode with dev dependencies
pip install -e ".[dev]"

Quick Start

from maticlib.llm.openai import OpenAIClient

# Initialize client (uses OPENAI_API_KEY from environment)
client = OpenAIClient()

# Make a request
response = client.complete("Explain quantum computing in one sentence.")
print(client.get_text_response(response))

Quick Start: Embeddings

from maticlib import OpenAIEmbeddings

# Initialize the client
embed_client = OpenAIEmbeddings()

# Embed single query
res = embed_client.embed_query("Core features of Maticlib")
print(res.vector[:5])      # List[float]
print(res.prompt_tokens)   # Total prompt tokens used

Quick Start: Context Engineering (RAG)

from maticlib.io.file import TextLoader
from maticlib.core.text.chunkers import HierarchicalChunker

chunker = HierarchicalChunker(target_size=500)
loader = TextLoader(chunker=chunker)

segments = list(loader.load("data.txt"))
print(f"Loaded {len(segments)} segments!")

Quick Start: Text2SQL

from maticlib.core.text2sql.guards import SQLInjectionGuard
from maticlib.core.text2sql.executors import SQLAlchemyExecutor

guard = SQLInjectionGuard(allowed_dialect="sqlite")
executor = SQLAlchemyExecutor("sqlite:///my_db.db", read_only=True)

query = guard.validate_and_format("SELECT * FROM users LIMIT 10")
cols, rows = executor.execute(query)

Project Leadership

Maticlib is developed and maintained by Arvoh Software.


License

This project is licensed under the MIT License - see the LICENSE file for details.

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

maticlib-0.2.1.tar.gz (67.5 kB view details)

Uploaded Source

Built Distribution

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

maticlib-0.2.1-py3-none-any.whl (84.1 kB view details)

Uploaded Python 3

File details

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

File metadata

  • Download URL: maticlib-0.2.1.tar.gz
  • Upload date:
  • Size: 67.5 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/6.2.0 CPython/3.12.3

File hashes

Hashes for maticlib-0.2.1.tar.gz
Algorithm Hash digest
SHA256 cd4df13c2495e83011a80969a85557a2ecbc8c1ea87f8a6b9def921b8b4fde52
MD5 4a2b9bcfe904b7e07c28556319cfc9ba
BLAKE2b-256 b7ccde81cffac874545ee1dfbf7138d653823d54767216f2da2f32407ec26333

See more details on using hashes here.

File details

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

File metadata

  • Download URL: maticlib-0.2.1-py3-none-any.whl
  • Upload date:
  • Size: 84.1 kB
  • Tags: Python 3
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/6.2.0 CPython/3.12.3

File hashes

Hashes for maticlib-0.2.1-py3-none-any.whl
Algorithm Hash digest
SHA256 ca4862613c47f796962a07a26633e71c0f215ea48a0d1432c62b168e86d3f657
MD5 d7116b4f45ef1c0d7cf67098939f6def
BLAKE2b-256 15ad08185a849c557b718ba44a1760a76ed647f8a706fb1c7b34e13313a1c3f4

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