Skip to content

NikitaZotov/ostis-example-app

 
 

Repository files navigation

ostis-example-app

license

About

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:

  1. Knowledge base. Knowledge represented in SC-code format (.scs and .gwf files).
  2. Problem solver. Agents written in C++ that implement specific problem-solving logic.
  3. Interface. The web-based user interface for interacting with the system.

Docker

To use Docker with ostis-example-app, follow these steps:

  1. Build the Docker images:

    docker compose build
  2. Build the knowledge base:

    docker compose run --rm machine build
  3. 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.

Native

Clone repository

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

Install pipx

To install pipx, use this guide: https://pipx.pypa.io/stable/installation/.

Install Conan

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

Relaunch shell

After installing Conan, relaunch your shell to ensure the new PATH is loaded:

exec $SHELL

Install sc-machine libraries

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

Install sc-machine binaries

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:

Linux

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

macOS

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

Install sc-web

sc-web provides the web-based user interface for the ostis-system. The installation process includes setting up dependencies and building the interface:

Ubuntu

cd interface/sc-web
./scripts/install_deps_ubuntu.sh
npm run build
cd ../..

macOS

cd interface/sc-web
./scripts/install_deps_macOS.sh
npm run build
cd ../..

Build

Build problem solver

The problem solver contains custom agents for your ostis-system. Build it using CMake:

cmake --preset release-conan
cmake --build --preset release

Build knowledge base

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

Usage

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.

Project Structure

Knowledge Base

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

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

Author

Show your support

Give us a ⭐️ if you've liked this project!

🤝 Contributing

Contributions, issues and feature requests are welcome!
Feel free to check issues page.

📝 License

This project is MIT licensed.

About

Initial project of ostis-system

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Languages

  • C++ 50.1%
  • Shell 16.8%
  • Python 13.6%
  • Dockerfile 12.2%
  • CMake 7.3%