ostis-example-app is an example of ostis-system designed with OSTIS Technology. It serves as a comprehensive demonstration of how to create, structure, and run an ostis-based system.
The main purpose of this example is to provide a foundation for creating custom intelligent systems based on the OSTIS technology. Developers can use this example as a starting point, adapting and extending its components to suit their specific needs.
The ostis-example-app consists of several interconnected components:
- Knowledge base. Knowledge represented in SC-code format (.scs and .gwf files).
- Problem solver. Agents written in C++ that implement specific problem-solving logic.
- Interface. The web-based user interface for interacting with the system.
To use Docker with ostis-example-app, follow these steps:
-
Build the Docker images:
docker compose build
-
Build the knowledge base:
docker compose run --rm machine build
-
Start the ostis-system:
docker compose up
These commands will set up and run the entire ostis-system using Docker containers. The system will be accessible through the web interface at localhost:8000.
If you need to rebuild the knowledge base after making changes, you can run the second command again. To stop the system, use:
docker compose down
Note that you need to have Docker and Docker Compose installed on your system before running these commands.
First, clone the repository and navigate to the project directory:
git clone https://github.com/NikitaZotov/ostis-example-app.git
cd ostis-example-app
git checkout release/0.10.0
git submodule update --init --recursive
To install pipx, use this guide: https://pipx.pypa.io/stable/installation/.
Conan is a decentralized package manager for C/C++. It's used in this project to manage dependencies.
# Use pipx to install conan if not already installed
pipx install conan
pipx ensurepath
After installing Conan, relaunch your shell to ensure the new PATH is loaded:
exec $SHELL
sc-machine libraries are the core components of the OSTIS Platform, used to develop C++ agents. They're installed using Conan:
conan remote add ostis-ai https://conan.ostis.net/artifactory/api/conan/ostis-ai-sc-machine
conan profile detect
conan install . --build=missing
sc-machine binaries are pre-compiled executables that provide the runtime environment for the ostis-system: build knowledge base source and launch the ostis-system. The installation process differs slightly between Linux and macOS:
curl -LO https://github.com/ostis-ai/sc-machine/releases/download/0.10.0/sc-machine-0.10.0-Linux.tar.gz
mkdir sc-machine && tar -xvzf sc-machine-0.10.0-Linux.tar.gz -C sc-machine --strip-components 1
rm -rf sc-machine-0.10.0-Linux.tar.gz && rm -rf sc-machine/include
curl -LO https://github.com/ostis-ai/sc-machine/releases/download/0.10.0/sc-machine-0.10.0-Darwin.tar.gz
mkdir sc-machine && tar -xvzf sc-machine-0.10.0-Darwin.tar.gz -C sc-machine --strip-components 1
rm -rf sc-machine-0.10.0-Darwin.tar.gz && rm -rf sc-machine/include
sc-web provides the web-based user interface for the ostis-system. The installation process includes setting up dependencies and building the interface:
cd interface/sc-web
./scripts/install_deps_ubuntu.sh
npm run build
cd ../..
cd interface/sc-web
./scripts/install_deps_macOS.sh
npm run build
cd ../..
The problem solver contains custom agents for your ostis-system. Build it using CMake:
cmake --preset release-conan
cmake --build --preset release
The knowledge base contains your custom knowledge represented in SC-code. It needs to be built before launching the system or after making changes:
./sc-machine/bin/sc-builder -i repo.path -o kb.bin --clear
To launch system you should start sc-machine in the first terminal:
./sc-machine/bin/sc-machine -s kb.bin -e "sc-machine/lib/extensions;build/Release/extensions"
After that launch sc-web interface in the second terminal:
cd interface/sc-web
source .venv/bin/activate && python3 server/app.py
To check that everything is fine open localhost:8000 in your browser.
knowledge-base
is the place for the knowledge base source text files of your app. Put your .scs and .gwf files here.
After updating your .scs and .gwf files you need to rebuild knowledge-base
:
./sc-machine/bin/sc-builder -i repo.path -o kb.bin --clear
problem-solver
is the place for the problem solver of your app. Put your agents here. After changes in problem-solver you should rebuild it:
After updating your C++ code you need to rebuild problem-solver
:
cmake --preset release-conan
cmake --build --preset release
To build C++ code in debug mode, run:
conan install . --build=missing -s build_type=Debug
cmake --preset debug-conan
cmake --build --preset debug
To enable Debug logs set fields in ostis-example-app.ini:
log_type = Console
log_file = sc-memory.log
log_level = Debug
- GitHub: @ostis-apps, @ostis-ai
Give us a ⭐️ if you've liked this project!
Contributions, issues and feature requests are welcome!
Feel free to check issues page.
This project is MIT licensed.