Skip to content

pckimlong/kai_engine

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

5 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Kai Engine

GitHub CI

A modular, extensible AI chat engine built with a pipeline-based architecture.

Battle-tested in production - Powers Resonate, a modern AI chat application.

Packages

This repository is a monorepo containing the following packages:

Package Description Version
kai_engine The core AI chat engine with a pipeline-based architecture TBD
kai_engine_firebase_ai Firebase AI adapter for the Kai Engine TBD

Overview

The Kai Engine is a flexible framework for building AI-powered chat applications with a clean, modular architecture. It follows a pipeline-first pattern, allowing developers to easily customize and extend the processing pipeline with domain-specific logic.

The core framework provides essential abstractions for building conversational AI applications while remaining unopinionated about concrete implementations, allowing maximum flexibility.

Features

  • Modular Pipeline Architecture: Each processing step is a separate component that can be customized or replaced.
  • Extensible Design: Unlimited extensibility through component composition.
  • Generic Type Support: Full generic support for using your own message types with MessageAdapter.
  • Stream-Based Responses: Real-time streaming responses for better user experience.
  • Optimistic UI Updates: Immediate UI feedback with rollback on errors.
  • Flexible Context Building: Advanced prompt engineering with parallel and sequential context building.
  • Tool Calling Support: Native support for AI function/tool calling with type-safe schemas.
  • Template Engine: Built-in flexible template engine for dynamic content generation.
  • Post-Response Processing: Process AI responses after generation with custom pipelines.
  • Type Safety: Strong typing throughout the system for better developer experience.
  • Comprehensive Testability: Designed for easy unit and integration testing.

Getting Started

Add the dependency to your pubspec.yaml:

dependencies:
  kai_engine: ^1.0.0

For Firebase AI integration:

dependencies:
  kai_engine_firebase_ai: ^1.0.0

Documentation

See the individual package READMEs for detailed documentation:

Contributing

Contributions are welcome! Please read our Contributing Guide for details on how to submit pull requests, report issues, or request features.

License

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

About

Modular AI chat engine with pipeline architecture

Topics

Resources

License

Code of conduct

Contributing

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Languages