This release is a pre-release and may not be stable for production use.
KISS AI Stack - Server
The KISS AI Stack Server is an server stub designed to support RESTful and WebSocket APIs for handling AI-agent sessions with kiss-ai-stack-core tasks like agent lifecycle management, query execution, and document storage.
Features
- REST API for authentication, session actions, queries, and document storage.
- WebSocket API for real-time, event-driven interactions.
- Built-in persistent and temporary session management.
- Flexible architecture to handle server events though AI agent's lifecycle events.
Agent's session lifecycle Events
ON_AUTH: Authenticate a session.ON_INIT: Initialize a session.ON_CLOSE: Close a session.ON_QUERY: Execute a query.ON_STORE: Store documents.
Getting Started
Requirements
- Python 3.12
Installation
-
Install kiss-ai-stack-server package:
pip install kiss-ai-stack-server
-
Set environment variables file
# .env ACCESS_TOKEN_SECRET_KEY = "your-secure-random-secret-key" ACCESS_TOKEN_ALGORITHM = "HS256" ACCESS_TOKEN_EXPIRE_MINUTES = 30 SESSION_DB_URL="sqlite://sessions.db"
-
Run the server:
from kiss_ai_stack_server import bootstrap_session_schema, agent_server
REST API Endpoints
1. Authentication
Endpoint: /auth
Method: POST
Request Body:
{
"client_id": "string",
"client_secret": "string"
}
Response:
{
"session_id": "string",
"access_token": "string",
"expires_in": 3600
}
2. Session Actions
Endpoint: /sessions?action={init|close}
Method: POST
Query Parameter:
action(required): Action to perform on the session (initorclose).
Request Body:
{
"session_id": "string"
}
Response: Session-related details or status.
3. Query Execution
Endpoint: /queries
Method: POST
Request Body:
{
"query": "string",
"parameters": {
"key": "value"
}
}
Response: Query results.
4. Document Storage
Endpoint: /documents
Method: POST
Request Body:
{
"documents": [
{
"id": "string",
"content": "string",
"metadata": {}
}
]
}
Response: Document storage confirmation.
WebSocket API
Endpoint: /ws
Workflow
-
Establish a WebSocket connection:
ws://localhost:8080/ws
-
Send a message:
{ "event": "ON_QUERY", "data": { "query": "example query", "parameters": { "key": "value" } } }
-
Receive a response:
{ "event": "ON_QUERY", "result": { "response_key": "response_value" } }
Contributing
Contributions are welcome! Feel free to fork the repository and submit a pull request.
License
This project is licensed under the MIT License.
Metadata
Release files for kiss-ai-stack-server 0.1.0a17
For a detailed explanation of source distributions (sdists) and built distributions (wheels), please see the package formats documentation.
Source distribution (sdist)
| File | Size | Uploaded | Provenance | Actions |
|---|---|---|---|---|
| kiss_ai_stack_server-0.1.0a17.tar.gz | 13.1 kB | Without provenance | Details for kiss_ai_stack_server-0.1.0a17.tar.gz |
Built distribution (wheel)
| File | Interpreter | ABI | Platform | Actions Reset |
|---|---|---|---|---|
| kiss_ai_stack_server-0.1.0a17-py3-none-any.whl | Python 3 | none | any | Details for kiss_ai_stack_server-0.1.0a17-py3-none-any.whl |
Total release size: 30.9 kB
Release files / kiss_ai_stack_server-0.1.0a17.tar.gz
| Download URL | kiss_ai_stack_server-0.1.0a17.tar.gz |
|---|---|
| Size | 13.1 kB |
| Tags | Source |
|
SHA-256 checksum How to use checksums |
2a4fd53577d9f7c337c1c552c57ae8af546de8ebe67633e7c448de0b863e4a7a
|
|
BLAKE2b-256 checksum How to use checksums |
275ae033d0fab88227012bb299b86ea072eec4fdd162c7edee1ea5d6e886130d
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
No |
| Uploaded via |
twine/6.0.1 CPython/3.12.7
|
Release files / kiss_ai_stack_server-0.1.0a17-py3-none-any.whl
| Download URL | kiss_ai_stack_server-0.1.0a17-py3-none-any.whl |
|---|---|
| Size | 17.8 kB |
| Tags | Python 3 |
|
SHA-256 checksum How to use checksums |
3e923823f4e4f3feb3cae467e018d95e0e4f059f61902fbf9ca9535a224d8a61
|
|
BLAKE2b-256 checksum How to use checksums |
ea7e138644af8a99da572ffec0c76708df225f643a6fe88f1614b6ffaeab4f12
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
No |
| Uploaded via |
twine/6.0.1 CPython/3.12.7
|
Security for kiss-ai-stack-server 0.1.0a17
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.