ostis-geometry is a working example of an ostis-system, utilizing the OSTIS Technology.
Choose between Docker (recommended) or Native installation.
Ensure these tools are installed before proceeding:
Required for both Docker and Native installations:
- Git: For cloning the repository. https://git-scm.com/book/en/v2/Getting-Started-Installing-Git
Docker simplifies setup and provides a consistent environment.
-
Install Docker and Docker Compose:
Instructions: https://www.docker.com/get-started/.
-
Clone repository:
git clone https://github.com/ostis-apps/ostis-geometry.git cd ostis-geometry git submodule update --init --recursive -
Build Docker images:
docker compose build
This command creates the necessary Docker images for the application.
-
Build knowledge base:
docker compose run --rm machine build
The
--rmflag ensures the container is removed after the build. -
Start ostis-system:
docker compose up
This command starts all the services defined in the
docker-compose.ymlfile (sc-machine, sc-web). The system is accessible atlocalhost:8000. -
Stop ostis-system:
docker compose stop
This command stops and removes the containers created by
docker compose up. To fully remove the containers, you can usedocker compose downinstead.Important: Rebuild the knowledge base (step 4) after any changes to the knowledge base files.
Steps for installing and running the application directly on your system.
-
Install basic tools for development environment:
-
Ubuntu/Debian (GCC):
sudo apt update sudo apt install --yes --no-install-recommends \ curl \ ccache \ python3 \ python3-pip \ build-essential \ ninja-build -
macOS (Clang):
brew update && brew upgrade brew install \ curl \ ccache \ cmake \ ninja -
Other Linux distributions:
If you're using a different Linux distribution that doesn't support apt, ensure you have equivalent packages installed:
- curl: A tool for transferring data with URLs;
- ccache: A compiler cache to speed up compilation processes;
- python3 and python3-pip: Python 3 interpreter and package installer;
- build-essential: Includes a C++ compiler, necessary for building C++ components;
- ninja-build: An alternative build system designed to be faster than traditional ones.
Compiler is required for building C++ components.
-
-
Install pipx:
Instructions: https://pipx.pypa.io/stable/installation/.
pipxisolates Python packages, preventing conflicts, especially useful when working with tools like CMake and Conan. -
Install CMake:
pipx install cmake pipx ensurepath
CMake is used to generate build files for your specific system.
pipx ensurepathadds CMake to your PATH. -
Install Conan:
pipx install conan pipx ensurepath
Conan manages the project's C++ dependencies.
pipx ensurepathadds Conan to your PATH. -
Clone repository:
git clone https://github.com/ostis-apps/ostis-geometry.git cd ostis-geometry git submodule update --init --recursive -
Restart your shell:
exec $SHELL
Ensures that the PATH changes from
pipx ensurepathare applied. -
Install C++ problem solver dependencies:
They include sc-machine libraries -- 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-library conan profile detect conan install . --build=missing--build=missingbuilds dependencies from source if pre-built binaries are not available. -
Install sc-machine and scl-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:
scl-machine binaries are pre-compiled modules with agents of logical inferences.
./scripts/install_cxx_problem_solver.sh
Downloads and extracts pre-built
sc-machinebinaries for your operating system. Theincludedirectory is removed because it is not required. -
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/Debian:
cd interface/sc-web ./scripts/install_deps_ubuntu.sh npm install # Ensure npm dependencies are installed npm run build cd ../..
-
macOS:
cd interface/sc-web ./scripts/install_deps_macOS.sh npm install # Ensure npm dependencies are installed npm run build cd ../..
Installs the necessary dependencies for the web interface.
npm installdownloads JavaScript packages, andnpm run buildcompiles the web interface. -
-
Install py libraries:
The `py-sc-server` is a Python library that provides a communication interface between the `sc-machine` and the Python agents. It's installed using pip:
```sh
cd problem-solver/py/
python3 -m venv .venv
source .venv/bin/activate && pip3 install -r requirements.txt
cd ../..
```
-
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
These commands use CMake to build the C++ problem solver in Release mode. The
--presetoption specifies a pre-configured build setup. -
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:
./install/sc-machine/bin/sc-builder -i repo.path -o kb.bin --clear
This command builds the knowledge base from the
.scsand.gwffiles in theknowledge-basedirectory, creating thekb.binfile. The--clearflag clears the knowledge base before building.
-
Start
sc-machine(in a terminal):./install/sc-machine/bin/sc-machine -s kb.bin \ -e "install/sc-machine/lib/extensions;build/Release/extensions"Starts the
sc-machine, loading the knowledge base (kb.bin) and specifying the paths to the extensions. -
Start
sc-webinterface (in a separate terminal):cd interface/sc-web source .venv/bin/activate && python3 server/app.py
Starts the
sc-web.source .venv/bin/activateactivates the virtual environment forsc-web, andpython3 server/app.pystarts the web server. -
Start 'py-sc-server' (in a separate terminal):
cd problem-solver/py/ source .venv/bin/activate && python3 server.py
Starts the
py-sc-server.source .venv/bin/activateactivates the virtual environment forpy-sc-server, andpython3 server.pystarts the py server. -
Access interface: Open
localhost:8000in your web browser.
To stop the running servers for the ostis-geometry, press Ctrl+C in the terminals where sc-machine and sc-web are running.
To generate local documentation:
pip3 install mkdocs mkdocs-material markdown-include
mkdocs serveThen open http://127.0.0.1:8005/ in your browser.
Note: The documentation is currently under development and may be incomplete.
-
knowledge-base: Contains the knowledge base source files (.scs,.gwf). Rebuild the knowledge base after making changes:./install/sc-machine/bin/sc-builder -i repo.path -o kb.bin --clear
-
problem-solver: Contains the C++ agents that implement the problem-solving logic. Rebuild after modifying:cmake --preset release-conan cmake --build --preset release
For debug mode:
conan install . --build=missing -s build_type=Debug cmake --preset debug-conan cmake --build --preset debugFor release mode with tests:
cmake --preset release-with-tests-conan cmake --build --preset release
To update log type and log level of agent, modify constructor of agent class. By default, logs of agents execution are stored in the
logsdirectory:logs/ |--ExampleAgent.log
This project follows the code style guidelines of sc-machine, which can be found here.
- GitHub: @ostis-apps, @ostis-ai
Give us a ⭐️ if you like this project!
Contributions, issues, and feature requests are welcome! Check the issues page.
This project is licensed under the MIT License
