KISS AI Stack's AI Agent Builder - Simplify AI Agent Development
Project description
KISS AI Stack - Core
Effortless AI Agent Building
Welcome to the core of the KISS AI Stack! This module helps you build an AI agent 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 Agent Management: Manage multiple session-based AI agents with lifecycle support.
- Minimal Dependencies: Built using simple, vanilla vendor libraries.
- Tool Classification: Configure tools for your agent 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 agent with different tools:
agent:
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 agent:
from kiss_ai_stack import AgentStack
async def main():
try:
# Initialize an agent in the stack
await AgentStack.bootstrap_agent(agent_id="my_agent", temporary=True)
# Process a query
response = await AgentStack.generate_answer(agent_id="my_agent", query="What is KISS AI Stack?")
print(response.answer)
except Exception as ex:
print(f"An error occurred: {ex}")
# Run the example
import asyncio
asyncio.run(main())
How It Works
- Agent Initialization: Use
AgentStack.bootstrap_agentto initialize agents with their configuration and resources. - Query Processing: Process queries with
AgentStack.generate_answer, leveraging tools and AI clients defined in the YAML configuration. - Tool Management: Define tools to handle specific tasks like document processing or query classification.
- Vector Database: Use the
vector_dbsection to define how document embeddings are stored and retrieved for RAG-based tasks. Currently,Chromais supported.
Documentation
Key Methods
bootstrap_agent(agent_id: str, temporary: bool): Initialize a new agent session.generate_answer(agent_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.
Project details
Release history Release notifications | RSS feed
Download files
Download the file for your platform. If you're not sure which to choose, learn more about installing packages.
Source Distribution
Built Distribution
Filter files by name, interpreter, ABI, and platform.
If you're not sure about the file name format, learn more about wheel file names.
Copy a direct link to the current filters
File details
Details for the file kiss_ai_stack_core-0.1.0a21.tar.gz.
File metadata
- Download URL: kiss_ai_stack_core-0.1.0a21.tar.gz
- Upload date:
- Size: 25.5 kB
- Tags: Source
- Uploaded using Trusted Publishing? No
- Uploaded via: twine/6.0.0 CPython/3.12.7
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
686cfc3a82c9d25310b471ee1fe47165a5b1dd5f41402ea62d985f926d053062
|
|
| MD5 |
c43ec2ae39a5c6fef721fe5896428ed1
|
|
| BLAKE2b-256 |
cc82a7559ef064d5d7311268a5e96b4d242952a77300adcd8991125df458ec1f
|
File details
Details for the file kiss_ai_stack_core-0.1.0a21-py3-none-any.whl.
File metadata
- Download URL: kiss_ai_stack_core-0.1.0a21-py3-none-any.whl
- Upload date:
- Size: 34.1 kB
- Tags: Python 3
- Uploaded using Trusted Publishing? No
- Uploaded via: twine/6.0.0 CPython/3.12.7
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
248fccf9febb0886e402733b6034afb2879c15c785700add297e8441f7e03f98
|
|
| MD5 |
c70bde28fed7e42907f567269544fbd0
|
|
| BLAKE2b-256 |
285daf6b41c5aa29e9482513175d20c54c5bcf5de5eb54d310854cb4b5401c35
|