Skip to main content

An open-source Python library for building intent classification and execution systems that work with any AI backend.

Project description

Intent Kit Logo

Intent Kit

Build intelligent workflows that understand what users want

CI Coverage Status Documentation PyPI


What is Intent Kit?

Intent Kit helps you build AI-powered applications that understand what users want and take the right actions. Think of it as a smart router that can:

  • Understand user requests using any AI model (OpenAI, Anthropic, Google, or your own)
  • Extract important details like names, dates, and preferences automatically
  • Take actions like sending messages, making calculations, or calling APIs
  • Handle complex requests that involve multiple steps
  • Keep track of conversations so your app remembers context

The best part? You stay in complete control. You define exactly what your app can do and how it should respond.


Why Intent Kit?

🎯 You're in Control

Define every possible action upfront. No surprises, no unexpected behavior.

🚀 Works with Any AI

Use OpenAI, Anthropic, Google, Ollama, or even simple rules. Mix and match as needed.

🔧 Easy to Build

Simple, clear API that feels natural to use. No complex abstractions to learn.

🧪 Testable & Reliable

Built-in testing tools let you verify your workflows work correctly before deploying.

📊 See What's Happening

Visualize your workflows and track exactly how decisions are made.


Quick Start

1. Install Intent Kit

pip install intentkit-py

For AI features, add your preferred provider:

pip install 'intentkit-py[openai]'    # OpenAI
pip install 'intentkit-py[anthropic]'  # Anthropic
pip install 'intentkit-py[all]'        # All providers

2. Build Your First Workflow

from intent_kit import IntentGraphBuilder, action, llm_classifier

# Define what your app can do
greet = action(
    name="greet",
    description="Greet the user by name",
    action_func=lambda name: f"Hello {name}!",
    param_schema={"name": str}
)

weather = action(
    name="weather",
    description="Get weather for a location",
    action_func=lambda city: f"Weather in {city}: 72°F, Sunny",
    param_schema={"city": str}
)

# Create a classifier to understand user requests
classifier = llm_classifier(
    name="main",
    children=[greet, weather],
    llm_config={"provider": "openai", "model": "gpt-3.5-turbo"}
)

# Build your workflow
graph = IntentGraphBuilder().root(classifier).build()

# Test it!
result = graph.route("Hello Alice")
print(result.output)  # → "Hello Alice!"

3. Try More Examples

# Get weather
result = graph.route("What's the weather in San Francisco?")
print(result.output)  # → "Weather in San Francisco: 72°F, Sunny"

# Handle multiple requests
result = graph.route("Greet Bob and check weather in NYC")
print(result.output)  # → Handles both requests!

How It Works

Intent Kit uses a simple but powerful pattern:

  1. Actions - Define what your app can do (send messages, make API calls, etc.)
  2. Classifiers - Understand what the user wants using AI or rules
  3. Graphs - Connect everything together into a workflow
  4. Context - Remember conversations and user preferences

The magic happens when a user sends a message:

  • The classifier figures out what they want
  • Intent Kit extracts the important details (names, locations, etc.)
  • The right action runs with those details
  • You get back a response

Real-World Testing

Most AI frameworks are black boxes that are hard to test. Intent Kit is different.

Test Your Workflows Like Real Software

from intent_kit.evals import run_eval, load_dataset

# Load test cases
dataset = load_dataset("tests/greeting_tests.yaml")

# Test your workflow
result = run_eval(dataset, graph)

print(f"Accuracy: {result.accuracy():.1%}")
result.save_report("test_results.md")

What You Can Test

  • Accuracy - Does your workflow understand requests correctly?
  • Performance - How fast does it respond?
  • Edge Cases - What happens with unusual inputs?
  • Regressions - Catch when changes break existing functionality

This means you can deploy with confidence, knowing your AI workflows work reliably.


Key Features

🧠 Smart Understanding

  • Works with any AI model (OpenAI, Anthropic, Google, Ollama)
  • Extracts parameters automatically (names, dates, preferences)
  • Handles complex, multi-step requests

🔄 Multi-Step Workflows

  • Chain actions together
  • Handle "do X and Y" requests
  • Remember context across conversations

🎨 Visualization

  • See your workflows as interactive diagrams
  • Track how decisions are made
  • Debug complex flows easily

🛠️ Developer Friendly

  • Simple, clear API
  • Comprehensive error handling
  • Built-in debugging tools
  • JSON configuration support

🧪 Testing & Evaluation

  • Test against real datasets
  • Measure accuracy and performance
  • Catch regressions automatically

Common Use Cases

🤖 Chatbots & Virtual Assistants

Build intelligent bots that understand natural language and take appropriate actions.

🔧 Task Automation

Automate complex workflows that require understanding user intent.

📊 Data Processing

Route and process information based on what users are asking for.

🎯 Decision Systems

Create systems that make smart decisions based on user requests.


Installation Options

# Basic installation (Python only)
pip install intentkit-py

# With specific AI providers
pip install 'intentkit-py[openai]'      # OpenAI
pip install 'intentkit-py[anthropic]'    # Anthropic  
pip install 'intentkit-py[google]'       # Google AI
pip install 'intentkit-py[ollama]'       # Ollama

# With visualization tools
pip install 'intentkit-py[viz]'

# Everything (all providers + tools)
pip install 'intentkit-py[all]'

# Development (includes testing tools)
pip install 'intentkit-py[dev]'

Project Structure

intent-kit/
├── intent_kit/        # Main library code
├── examples/          # Working examples
├── docs/             # Documentation
├── tests/            # Test suite
└── pyproject.toml    # Project configuration

Getting Help


Contributing

We welcome contributions! Here's how to get started:

git clone git@github.com:Stephen-Collins-tech/intent-kit.git
cd intent-kit
pip install -e ".[dev]"
pytest tests/

See our Contributing Guide for more details.


License

MIT License - feel free to use Intent Kit in your projects!

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

intentkit_py-0.3.0.tar.gz (89.7 kB view details)

Uploaded Source

Built Distribution

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

intentkit_py-0.3.0-py3-none-any.whl (103.4 kB view details)

Uploaded Python 3

File details

Details for the file intentkit_py-0.3.0.tar.gz.

File metadata

  • Download URL: intentkit_py-0.3.0.tar.gz
  • Upload date:
  • Size: 89.7 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: uv/0.7.20

File hashes

Hashes for intentkit_py-0.3.0.tar.gz
Algorithm Hash digest
SHA256 744106aa4847de66c67ca158f794a68fe4c9d92c5589227cbd41c194cffc6e89
MD5 734e3a80d452dfe3521995f2b2b8c20b
BLAKE2b-256 edccaf48d056f8df4204bfb45e499e7202ee8f0f9853b5140e1a55b3335219a3

See more details on using hashes here.

File details

Details for the file intentkit_py-0.3.0-py3-none-any.whl.

File metadata

File hashes

Hashes for intentkit_py-0.3.0-py3-none-any.whl
Algorithm Hash digest
SHA256 7e2f5bc051784dd28c71744c1e96317b8bc4ed0c6e0a8ac756e4ca3098fc9f2c
MD5 5808c26a0eafb192d8912004cbf9c86f
BLAKE2b-256 28970e63f4e88f64a875379c89ab6ab8a7cf585cb95f8c890e58dd1402480da3

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