Skip to main content

GentisAI

GentisAI is a small Python package for building multi-expert AI agent POCs with a simple mental model:

Expert + Router + Flow

It is designed for interactive chat, support, sales, copilots, and other workflows where routing should be explicit, fast, and easy to test. GentisAI keeps low orchestration overhead by avoiding hidden manager loops, while still leaving an optional bridge to LangGraph for durable workflows.

Install

pip install gentis-ai

The default install only includes the tiny core and pydantic. Provider SDKs are optional:

pip install "gentis-ai[gemini]"
pip install "gentis-ai[openai]"
pip install "gentis-ai[ollama]"
pip install "gentis-ai[langgraph]"

Quick Start

This example runs offline with no API key.

from gentis_ai import Expert, Flow, Router
from gentis_ai.llm import MockLLM

llm = MockLLM(
    routing_rules={
        "help": "support",
        "buy": "sales",
    },
    responses={
        "help": "I can help troubleshoot that issue.",
        "buy": "I can walk you through plans and pricing.",
    },
    default_response="I can route that to the right expert.",
)

support = Expert(name="support", description="Handles technical support.")
sales = Expert(name="sales", description="Handles sales and pricing.")

router = Router(experts=[support, sales], llm=llm)
flow = Flow(router=router, llm=llm)

response = flow.process_turn(
    "I need help with my account.",
    session_id="demo-user",
)

print(response.agent_name)
print(response.content)

Create a Gemini-backed customer-support project:

gentis new customer-support-gemini --template gemini-support
cd customer-support-gemini
gentis run

Set GOOGLE_API_KEY or GEMINI_API_KEY in the same shell before running it.

Core Concepts

  • Expert: a persona with a name, description, optional system prompt, and optional tools.
  • Router: selects one or more experts and returns a validated RoutingDecision.
  • Flow: manages routing, session history, expert execution, streaming events, and responses.
  • SessionStore: stores state in memory or SQLite.
  • BaseLLM: provider-neutral interface for mock, Gemini, Ollama, Bedrock, and OpenAI-compatible adapters.

Structured Routing

Router.classify() returns a RoutingDecision:

decision = router.classify("I want pricing help", "orchestrator")
print(decision.experts)
print(decision.confidence)

Older code can use router.classify_names(...) to get a list[str].

For zero-LLM routing, pass deterministic rules:

router = Router(
    experts=[support, sales],
    llm=None,
    rules={"help": "support", "buy": "sales"},
)

Sessions

Use explicit session_id values in production so users do not share state:

response = flow.process_turn("hello", session_id="customer-123")

SQLite persistence is built in:

from gentis_ai import SQLiteSessionStore

flow = Flow(
    router=router,
    llm=llm,
    session_store=SQLiteSessionStore("gentis.db"),
)

Anonymous calls are allowed, but each call receives a fresh anonymous session.

Streaming

Core runtime does not print. Use stream_turn() and decide how your app displays events:

for event in flow.stream_turn("Tell me a story", session_id="demo"):
    if event.type == "token":
        print(event.content, end="", flush=True)
    elif event.type == "final":
        print()

Async variants are available:

response = await flow.aprocess_turn("hello", session_id="demo")

async for event in flow.astream_turn("hello", session_id="demo"):
    ...

Providers

All provider adapters implement the same BaseLLM contract.

from gentis_ai.llm import OpenAICompatibleLLM

llm = OpenAICompatibleLLM(
    model_name="gpt-4o-mini",
    api_key="...",
    base_url="https://api.openai.com/v1",
)

Helpful extras:

  • Gemini: pip install "gentis-ai[gemini]"
  • OpenAI-compatible and Azure: pip install "gentis-ai[openai]"
  • AWS Bedrock: pip install "gentis-ai[bedrock]"
  • Ollama: pip install "gentis-ai[ollama]"
  • LangGraph bridge: pip install "gentis-ai[langgraph]"

See examples/cloud_providers_example.py for provider selection by environment variable.

Tools

GentisAI includes reusable tool schema, registry, and executor primitives:

from gentis_ai.tools import ToolExecutor, ToolRegistry

def add(a: int, b: int) -> int:
    return a + b

registry = ToolRegistry()
registry.register(add)

executor = ToolExecutor(registry, approval_policy={"delete_file": "always"})
result = executor.execute("add", {"a": 2, "b": 3})

LangGraph Bridge

GentisAI stays simple by default. Use LangGraph when you need checkpointed, durable, multi-node workflows:

from gentis_ai.adapters.langgraph import to_langgraph

graph = to_langgraph(flow)

import gentis_ai never imports LangGraph.

CLI

gentis new support-agent
gentis run
gentis eval
gentis bench

Azure Customer Support POC

Create a three-agent customer-support demo in four commands:

pip install "gentis-ai[azure]"
gentis new customer-support --template azure-support
cd customer-support
gentis run

The POC routes each message to Technical, Billing, or Account Support. If the Azure API key, endpoint, and deployment are not all configured, it clearly announces the local mock fallback and still runs.

Documentation And Examples

  • docs/getting-started.md
  • docs/api-reference.md
  • docs/features/streaming.md
  • examples/quick_mock_start.py
  • examples/cloud_providers_example.py
  • benchmarks/README_comparison.md

Development

pip install -e ".[dev]"
python -m pytest

Launch Demos

  • demos/customer_rescue shows explicit hybrid routing, fictional tool execution, streaming, and session follow-ups.
  • demos/launch_war_room shows contextual product-expert routing and parallel synthesis.
  • Both demos support GENTIS_PROVIDER=mock|openai|gemini|azure; mock remains the default.
python -m streamlit run demos/customer_rescue/app.py
python -m streamlit run demos/launch_war_room/app.py

License

MIT. See LICENSE.

Metadata

Release files for gentis-ai 0.2.1

For a detailed explanation of source distributions (sdists) and built distributions (wheels), please see the package formats documentation.

Source distribution (sdist)

Source distribution for gentis-ai 0.2.1
File Size Uploaded
gentis_ai-0.2.1.tar.gz 55.1 kB Details

Built distribution (wheel)

Table of built distributions (wheels) for gentis-ai 0.2.1
File Interpreter ABI Platform
gentis_ai-0.2.1-py3-none-any.whl Python 3 none any Details

Total release size: 117.6 kB

Release files / gentis_ai-0.2.1.tar.gz

Download URL gentis_ai-0.2.1.tar.gz
Size 55.1 kB
Tags Source
SHA-256 checksum
How to use checksums
22638c1b6b8afac55bd07256565765b7f9bce3f60201666118f677733df9c771
BLAKE2b-256 checksum
How to use checksums
4adea5a5eab9cfc866473db12f0571f116592a8c205a101690e09f98395e5f21
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
Yes
Uploaded via twine/7.0.0 CPython/3.13.14

Provenance

Provenance describes where a file came from. On PyPI, provenance is shared via attestations, which provide a verifiable record of the build or publishing details. View details, limitations and caveats.

PyPI Publish Attestation

PyPI verified that this artifact, at this checksum, originated from the publisher listed below.

Signed by GitHub Actions, verified by PyPI on Sep 4, 2026.

Transparency log

Release files / gentis_ai-0.2.1-py3-none-any.whl

Download URL gentis_ai-0.2.1-py3-none-any.whl
Size 62.5 kB
Tags Python 3
SHA-256 checksum
How to use checksums
b761112b5a0ae3ce3f3250f6845aaf2150bd729d7015be7bfab39d4023bc1b90
BLAKE2b-256 checksum
How to use checksums
580419d238a06b22e3fa87436e7b37a2eef42776e0f87b07a020503327ace336
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
Yes
Uploaded via twine/7.0.0 CPython/3.13.14

Provenance

Provenance describes where a file came from. On PyPI, provenance is shared via attestations, which provide a verifiable record of the build or publishing details. View details, limitations and caveats.

PyPI Publish Attestation

PyPI verified that this artifact, at this checksum, originated from the publisher listed below.

Signed by GitHub Actions, verified by PyPI on Sep 4, 2026.

Transparency log

Release history Release notifications | RSS feed

0.2.21

2 release files

0.2.2

2 release files

This release

0.2.1 This release

2 release files

0.2.0

2 release files

0.1.13

2 release files

Anthropic, PBC Visionary sponsor Bloomberg Visionary sponsor Hudson River Trading Visionary sponsor Meta Visionary sponsor NVIDIA Visionary sponsor Microsoft Sustainability sponsor Depot Continuous Integration AWS Cloud computing and Security Sponsor Datadog Monitoring Fastly CDN Google Download Analytics Sentry Error logging StatusPage Status page