Skip to main content
Pre-release

This release is a pre-release and may not be stable for production use.

StruktX Logo
StruktX

A configurable, typed AI framework with swappable LLM, classifier, handlers, and memory for Natural Language to Action apps

Python 3.8+ License: MIT

Quick Install

Using uv (Recommended)

# Install with core dependencies only
uv pip install struktx-ai

# Install with LLM support (LangChain)
uv pip install struktx-ai[llm]

# Install with vector store support
uv pip install struktx-ai[vector]

# Install with all optional dependencies
uv pip install struktx-ai[all]

# Install for development
uv pip install struktx-ai[dev]

Using pip

# Install with core dependencies only
pip install struktx-ai

# Install with LLM support (LangChain)
pip install struktx-ai[llm]

# Install with vector store support
pip install struktx-ai[vector]

# Install with all optional dependencies
pip install struktx-ai[all]

Source

# Create virtual env
uv venv

# Activate environment
source .venv/bin/activate

# Sync and install pyproject dependencies
uv sync

# Install finall Strukt package
uv pip install struktx-ai[all]

Quick Start with LangChain

from strukt import create, StruktConfig, HandlersConfig, LLMClientConfig, ClassifierConfig
from strukt.classifiers.llm_classifier import DefaultLLMClassifier
from strukt.prompts import DEFAULT_CLASSIFIER_TEMPLATE
from strukt.examples.time_handler import TimeHandler

from langchain_openai import ChatOpenAI
from strukt.langchain_helpers import LangChainLLMClient

# Create LangChain LLM client
langchain_llm = ChatOpenAI(api_key="your-openai-api-key")
llm = LangChainLLMClient(langchain_llm)

app = create(StruktConfig(
    llm=LLMClientConfig(llm),
    classifier=ClassifierConfig(
        factory=DefaultLLMClassifier(
            llm=llm,
            prompt_template=DEFAULT_CLASSIFIER_TEMPLATE,
            allowed_types=["time_service", "weather", "general"],
            max_parts=4,
        )
    ),
    handlers=HandlersConfig(
        registry={"time_service": TimeHandler(llm)},
        default_route="general",
    ),
))

app.invoke("What is the time in Tokyo?")

What is StruktX?

StruktX is a Python framework for building AI applications with focus on natural language -> actions

  • 🔄 Swappable Components: LLM clients, classifiers, handlers, and memory engines
  • 📝 Type Safety: Full type hints and Pydantic models
  • ⚙️ Configurable: Factory-based configuration system
  • 🔌 Extensible: Easy to add custom components
  • 🧠 Memory Support: Optional conversation memory
  • 🔧 Middleware: Pre/post processing hooks

Features

  • LLM Integration: Support for any LLM via the LLMClient interface
  • Query Classification: Route requests to appropriate handlers
  • Structured Outputs: Pydantic model integration
  • Memory Engines: Conversation history and context
  • Middleware System: Pre/post processing hooks
  • LangChain Helpers: Easy integration with LangChain ecosystem

Requirements

  • Python 3.10+
  • Core: pydantic>=2.0.0, python-dotenv>=1.0.0
  • Optional: LangChain packages, vector stores, etc.

License

MIT License - see LICENSE file for details.

Contributing

Contributions are welcome! Please report any issues, bugs, improvements, or features on GitHub.

Support

Metadata

Release files for struktx-ai 0.0.4b5

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

Source distribution (sdist)

Source distribution for struktx-ai 0.0.4b5
File Size Uploaded
struktx_ai-0.0.4b5.tar.gz 112.6 kB Details

Built distribution (wheel)

Table of built distributions (wheels) for struktx-ai 0.0.4b5
File Interpreter ABI Platform
struktx_ai-0.0.4b5-py3-none-any.whl Python 3 none any Details

Total release size: 254.6 kB

Release files / struktx_ai-0.0.4b5.tar.gz

Download URL struktx_ai-0.0.4b5.tar.gz
Size 112.6 kB
Tags Source
SHA-256 checksum
How to use checksums
b8e2d3c99f1295b3b15c442e207ec45b6dfd1740572ae5a957b0ef468428df57
BLAKE2b-256 checksum
How to use checksums
da7f3693f24179159132585940516f76ceb6faac9ede66389f90b2a56fd2f568
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via twine/6.1.0 CPython/3.13.7

Release files / struktx_ai-0.0.4b5-py3-none-any.whl

Download URL struktx_ai-0.0.4b5-py3-none-any.whl
Size 141.9 kB
Tags Python 3
SHA-256 checksum
How to use checksums
cda328781a94fcedb64b1813a4947382f489ade82ccbdb11cdba19d890a0f8f0
BLAKE2b-256 checksum
How to use checksums
12e8cdbf65eb23f4944a49592cdee38972b4680dd161089aab227b4615577157
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via twine/6.1.0 CPython/3.13.7
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