Semi-Autonomous Personal Intelligent Agent from Large language models
Sapial is a open framework for building personal agents that can be trained on your own data. It is built on top of Deno, [Transforemrs](), [Langchain](), and [llama-index]().
Why Deno?
Deno is a secure, user-friendly runtime for JavaScript, TypeScript, and WebAssembly, built on V8, Rust, and Tokio. It supports TypeScript natively, provides built-in development tools, and accommodates existing npm modules. Distributed as a single executable, Deno doubles as both a runtime and package manager, using browser-compatible protocols for loading modules. It's an ideal environment for modern programming and a great alternative for utility scripts previously written in Bash or Python.
Sapial is broadly divided into three parts:
To check if you already have it installed, run
deno --version
If Deno is installed, you should see a message like deno 1.x.x
where x.x
represents a version of deno
If you get command not found
proceed with installation according to your OS
To check if you already have it installed, run
python --version
If Python is installed, you should see a message like python 2.x.x
where x.x
represents a version of Python
If you get command not found
proceed with installation according to your OS
In case you didn't have Python installed, make sure to restart your computer before proceeding to the next steps!
Usually Pip is automatically installed with python
To check if you already have it installed, run
pip --version
If you get command not found
proceed with installation according to your OS
To setup the virtual environment, run this command in the terminal
pip install virtualenv
To use venv in your project, change directory into services
by running
cd services
nd then run python -m venv venv
This will create a vurtual environment inside services
folder named venv
run cd ..
in your terminal to get back to the root folder
To install, run pip install -r ./services/requirements.txt
in your terminal
In the root of directory, create a new file named .env
Open .env
file using editor of your choice and add your OpenAI API key
Your .env
file should look like this
OPENAI_API_KEY = "your_API_KEY"
To start an agent, run the following command in your terminal
deno run --allow-all --unstable ./agents/alice.ts
In a separate terminal, start the CLI client by running
cd /clients/cli
deno run --allow-all httpClient.ts
To check if everything is working properly, type any prompt in the latter terminal
Alternatively, you can start a web client to use a web interface
To start a web client, run yarn && yarn dev
By default, the server will spin up on port 3000
Proceed to localhost:3000
and send a message to start interacting with AI
We appreciate and highly encourage community contributions!
If you're not sure, here's how to fork the repo.
To clone your repo, you can run the command in the terminal of your choice
git clone git@github.com:[your_github_handle]/sapial.git && cd sapial
Create new branch and make changes
git checkout -b new_branch_name
Make changes where necessary and save them by running
git add --all
git commit -m "Use a message that best describes changes"
Push the changes to your repo
git push
After your changes are committed to your GitHub fork, submit a pull request (PR) to the main
branch of the sapial-ai/sapial
repo
Kill the fastAPI server on agent crash
lsof -i :8000 ->