Skip to main content
Pre-release

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

KISS AI Stack Banner

KISS AI Stack - Core

Effortless AI Stack Building

Welcome to the core of the KISS AI Stack! This module helps you build a stack effortlessly using a simple YAML configuration file. Say goodbye to boilerplate code and embrace minimalism with the KISS principle (Keep It Simple, Stupid).


Features

  • Centralized Stack Management: Manage multiple session-based AI stacks with lifecycle support.
  • Minimal Dependencies: Built using simple, vanilla vendor libraries.
  • Tool Classification: Configure tools for your stack to handle specific tasks easily.
  • Supports RAG and Prompt-Based Models: Choose the model type that suits your needs.
  • Thread-Safe: Reliable operation in multi-threaded environments.

Installation

Install the core module using pip:

pip install kiss-ai-stack-core

Example Configuration

Here’s an example YAML configuration to set up an AI stack with different tools:

stack:
  decision_maker: # Required for tool classification
    name: decision_maker
    role: classify tools for given queries
    kind: prompt  # Choose from 'rag' or 'prompt'
    ai_client:
      provider: openai
      model: gpt-4
      api_key: <your-api-key>

  tools:
    - name: general_queries
      role: process other queries if no suitable tool is found.
      kind: prompt
      ai_client:
        provider: openai
        model: gpt-4
        api_key: <your-api-key>

    - name: document_tool
      role: process documents and provide answers based on them.
      kind: rag  # Retrieval-Augmented Generation
      embeddings: text-embedding-ada-002
      ai_client:
        provider: openai
        model: gpt-4
        api_key: <your-api-key>

  vector_db:
    provider: chroma
    kind: remote # Choose in-memory, storage, or remote options.
    host: 0.0.0.0
    port: 8000
    secure: false

Example Python Usage

Use the core module to build and interact with your AI stack:

from kiss_ai_stack import Stacks

async def main():
    try:
        # Initialize a stack in the stack
        await Stacks.bootstrap_stack(stack_id="my_stack", temporary=True)

        # Process a query
        response = await Stacks.generate_answer(stack_id="my_stack", query="What is Retrieval-Augmented Generation?")
        print(response.answer)

    except Exception as ex:
        print(f"An error occurred: {ex}")

# Run the example
import asyncio
asyncio.run(main())

How It Works

  1. Stack Initialization: Use Stack.bootstrap_stack to initialize stacks with their configuration and resources.
  2. Query Processing: Process queries with Stack.generate_answer, leveraging tools and AI clients defined in the YAML configuration.
  3. Tool Management: Define tools to handle specific tasks like document processing or query classification.
  4. Vector Database: Use the vector_db section to define how document embeddings are stored and retrieved for RAG-based tasks. Currently, only Chroma is supported.

Documentation

Key Methods

  • bootstrap_stack(stack_id: str, temporary: bool): Initialize a new stack session.
  • generate_answer(stack_id: str, query: Union[str, Dict, List]): Process a query and return a response.

Configuration Highlights

  • AI Client: Configure the provider, model, and API key for supported services like OpenAI.
  • Tools: Define tools such as general-purpose query handlers or document processors.
  • Vector Database: Set up in-memory or persistent storage for RAG-based tasks.

Contributing

We welcome contributions! Submit pull requests or open issues to improve this stack.


License

This project is licensed under the MIT License. See the LICENSE file for details.

Metadata

Release files for kiss-ai-stack-core 0.1.0a28

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

Source distribution (sdist)

Source distribution for kiss-ai-stack-core 0.1.0a28
File Size Uploaded Provenance Actions
kiss_ai_stack_core-0.1.0a28.tar.gz 24.7 kB Without provenance Details for kiss_ai_stack_core-0.1.0a28.tar.gz

Built distribution (wheel)

Table of built distributions (wheels) for kiss-ai-stack-core 0.1.0a28
File Interpreter ABI Platform Actions
kiss_ai_stack_core-0.1.0a28-py3-none-any.whl Python 3 none any Details for kiss_ai_stack_core-0.1.0a28-py3-none-any.whl

Total release size: 58.1 kB

Release files / kiss_ai_stack_core-0.1.0a28.tar.gz

Download URL kiss_ai_stack_core-0.1.0a28.tar.gz
Size 24.7 kB
Tags Source
SHA-256 checksum
How to use checksums
85f3438f597cee772aaf643ea5f702b1c56d34099530670c139fb6fa895bd752
BLAKE2b-256 checksum
How to use checksums
2b80f166d02aa9e8f5815594a6e273f6a7c102d6539a360b7caf4882d1268106
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via twine/6.0.0 CPython/3.12.7

Release files / kiss_ai_stack_core-0.1.0a28-py3-none-any.whl

Download URL kiss_ai_stack_core-0.1.0a28-py3-none-any.whl
Size 33.4 kB
Tags Python 3
SHA-256 checksum
How to use checksums
4316b8a573a94badd3fad8a651f1ef06a8205b5017078b6a482d194b7841b231
BLAKE2b-256 checksum
How to use checksums
edf05094ada3618ee302812cfc9f3e7b50c3af1187128eea35e70f334453efef
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via twine/6.0.0 CPython/3.12.7

Security for kiss-ai-stack-core 0.1.0a28

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.

No provenance found

None of the files in this release were uploaded with provenance metadata.

A note on package security

PyPI is a repository for distributing packages, not a service for auditing them. While third-party security researchers and our staff do their best to detect and remove malicious packages, PyPI cannot guarantee the quality, security or suitability of any given package.

To learn more about protecting yourself from malicious actors, visit our package security documentation.

Release history Release notifications | RSS feed

This release
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