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

Uploaded Python 3

File details

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

File metadata

  • Download URL: maticlib-0.2.0.tar.gz
  • Upload date:
  • Size: 53.9 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.0.tar.gz
Algorithm Hash digest
SHA256 8b4693db2a9413494048cd58d2408cda3a09905ce417d71b2e7c1700fa0ec8f6
MD5 d89a2e8f741a3897e22f85a47739381f
BLAKE2b-256 09f1adf4072cee731a567c1759d22cfda8ff84ff032a76f5b1fe23092f2cea41

See more details on using hashes here.

File details

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

File metadata

  • Download URL: maticlib-0.2.0-py3-none-any.whl
  • Upload date:
  • Size: 64.2 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.0-py3-none-any.whl
Algorithm Hash digest
SHA256 867431fda5ad01f3db93088178bd48ccf116fdedb78fd10310303c59678cd550
MD5 5992367188eb7ae9a8fe97bee93f926f
BLAKE2b-256 0689ccf58f9d4a6b2eed0fe5db52063b58b3205bf38c4974327b58ff6a8ed3f9

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