Skip to content

Getting Started

Follow this guide to get up and running with Maticlib.

Installation

Install Maticlib using pip:

pip install maticlib

From Source

If you want the latest features or wish to contribute:

git clone https://github.com/arvohsoft/maticlib.git
cd maticlib
pip install -e .

Environment Configuration

Maticlib supports environment variables for secure API key management. We recommend using a .env file in your project root.

# .env
OPENAI_API_KEY=your_openai_key
MISTRAL_API_KEY=your_mistral_key
GOOGLE_API_KEY=your_google_key

Then in your code:

from dotenv import load_dotenv
load_dotenv()

Core Concepts

LLM Clients

Maticlib provides a unified interface for multiple LLM providers. Each client supports synchronous (complete) and asynchronous (async_complete) methods.

from maticlib.llm.mistral import MistralClient

client = MistralClient()
response = client.complete("Hello!")

Graph Workflows

The MaticGraph is a powerful engine for building agentic workflows as a directed graph of nodes.

from maticlib.graph import MaticGraph

graph = MaticGraph()
graph.add_node("start", lambda state: {"status": "running"}, next="end")
graph.add_node("end", lambda state: {"status": "complete"})

result = graph.run(initial_state={})

Next Steps

Now that you have the basics down, explore the API Reference or look at some Examples.