Skip to content

Examples Gallery

Check out these runnable examples to learn how to use Maticlib for different use cases. You can find all these scripts in the examples/ directory of the repository.


Basic Chat & Multi-Provider

Demonstrates how to initialize and use LLM clients from different providers.


Graph Workflows

Learn how to build intelligent agents using the MaticGraph engine.


Structured Output & Parsing

  • Pydantic Response Parsing: Force models to generate validated JSON that maps directly to your Pydantic schemas.
  • Typed Graph State: Using Pydantic models to enforce strict state schemas throughout your graph workflows.

Native Tool Calling


Running the Examples

  1. Set up your environment: Make sure you have your API keys in a .env file.

  2. Execute a script:

    # From the project root
    python examples/01_basic_chat.py