AI Agent capable of automating various tasks using openai function call feature
MIT License
Read our documentation
Looking for the Python version? Check out Saiku.py.
This project aims to create a robust, intelligent AI Agent capable of automating various tasks. Our agent is designed following the PEAS (Performance measure, Environment, Actuators, Sensors) framework to ensure it's robust, scalable, and efficient.
"Saiku" (細工) in Japanese refers to detailed or delicate work, symbolizing the intricate and intelligent workings of our AI agent.
We chose a Japanese name to symbolize precision, innovation, and advanced technology, attributes highly respected in Japanese culture. Even though we are based in Tunisia, we believe in global collaboration and the universal appeal and understanding of technology.
PEAS stands for Performance measure, Environment, Actuators, and Sensors. It's a framework used to describe the various components of an intelligent agent:
gcloud auth login
gcloud config set project <your-project-id>
Saiku is a versatile tool that enhances projects with advanced functionalities. This guide will help you integrate Saiku into your applications, covering the installation, configuration, and usage.
npm install saiku
in your project directory to add Saiku as a dependency.import Agent from 'saiku';
async function main(opts) {
const agent = new Agent(opts); // Initialize the agent
// Additional initialization code
}
AgentOptions:
string
| optional
): Path to custom action scripts.string
| optional
): Default system message or instructions.boolean
| optional
): Flag to enable/disable code execution.boolean
| string
| optional
): Interactive mode setting.'input' | 'output' | 'both' | 'none'
): Configures speech functionality.'openai' | 'vertexai' | 'ollama' | 'huggingface'
): Specifies the language learning model. Default is 'openai'
.optional
): Allows additional custom properties for unique project requirements.Example Configuration:
let opts = {
actionsPath: "../actions",
systemMessage: "Welcome to Saiku",
allowCodeExecution: true,
interactive: true,
speech: "both",
llm: "openai",
// Custom options
};
Process:
Example Interaction:
do {
let userQuery = await getUserInput(); // Get user input
agent.messages.push({ role: "user", content: userQuery });
await agent.interact(); // Process and perform actions
// Additional code
} while (userQuery.toLowerCase() !== "quit");
Clone the Repository:
git clone https://github.com/nooqta/saiku.git
Navigate to Project Folder:
cd saiku
Install Dependencies:
npm install
Run the Project Locally:
Before starting Saiku locally, build the project using the following command:
npm run build
To start the agent:
npm start
For automated building during development, use:
npm run watch
This will automatically build the project whenever files are changed, helping streamline the development process.
Saiku is available globally but is still in early development. Local installation is recommended.
npm install -g saiku
For detailed documentation and API usage, refer to the upcoming Saiku documentation, which will provide comprehensive guidance for advanced uses.
This guide is designed to provide clarity and ease of use for integrating Saiku into various projects, catering to a wide range of developers.
Although Saiku is available as an npm package, we are still in the early stages of development, and drastic changes to the architecture will occur. We don't recommend installing it globally yet. However, if you still wish to do so:
npm install -g saiku
https://github.com/nooqta/saiku/assets/3036133/87752826-fc6a-4c16-91a7-917b0f79427a
Before running Saiku, configure the necessary environment variables. Copy the example environment file and then fill in the details.
cp .env.example .env
Edit the .env
file to include your specific information:
# OpenAI
OPENAI_API_KEY=
OPENAI_MODEL=gpt-3.5-turbo
# Eleven Labs
ELEVENLABS_API_KEY=
# Database related
DB_HOST=
DB_USER=
DB_PASSWORD=
# Email related
EMAIL_SERVICE=
EMAIL_USER=
DISPLAY_FROM_EMAIL=
EMAIL_PASS=
# User related
USER=
COMPANY=
COUNTRY=
CITY=
PHONE=
LATITUDE=
LONGITUDE=
# Twilio
TWILIO_ACCOUNT_SID=
TWILIO_AUTH_TOKEN=
# Weather API
WEATHER_API_KEY=
# Stability AI
STABILITY_API_KEY=
# GITLAB
GITLAB_GRAPHQL_ENDPOINT=
GITLAB_PERSONAL_ACCESS_TOKEN=
GITLAB_USERNAME=
GITLAB_VERSION=
GITLAB_API_VERSION=
Use Saiku with various options to tailor its operation to your needs:
AI agent to help automate your tasks
Options:
-v, --version Output the current version.
-exec, --allowCodeExecution Execute the code without prompting the user.
-s, --speech <type> Receive voice input from the user and/or output responses as speech.
Possible values: input, output, both, none. Default is "none".
-role, --systemMessage The model system role message.
-m, --llm <model> Specify the language model to use.
Possible values: openai, vertexai, ollama, and huggingface. Default is "openai".
-h, --help Display help for command.
Commands:
action [options] Manage actions: create an new action using AI, list available actions and activate an action.
autopilot [options] AI agent to help automate your tasks on autopilot mode (in progress).
serve Chat with the Saiku agent in the browser.
To allow code execution without prompting:
saiku -exec
or
npm start -- -exec
To enable voice input and output:
saiku -s both
or
npm start -- --speech both
To specify a language model:
saiku -m huggingface
or
npm start -- --llm huggingface
To chat with Saiku in the browser
saiku serve
# or
npm start -- serve
To create a new action
saiku action create
# or
npm start -- action create
Prompt Example: "Please transcribe the audio from interview.mp3." Description: Saiku will use the speech_to_text function to transcribe the audio file interview.mp3 and provide the user with the text content.
Prompt Example: "Extract text from this photo image_of_document.jpg." Description: Saiku will use google_vision with the DOCUMENT_TEXT_DETECTION feature to analyze the image image_of_document.jpg and return any readable text found in the image.
Prompt Example: "Summarize the following article content for me: ...(article text)..." Description: Saiku utilizes the text_summarizer function to produce a concise summary of the provided article text.
Prompt Example: "Convert this HTML code to a PDF file and save it as report.pdf." Description: Saiku employs the html_to_pdf tool to transform the given HTML code into a PDF document and saves it with the filename report.pdf.
Prompt Example: "Take a full-page screenshot of the website at http://example.com and name the file screenshot.png." Description: Saiku uses the take_screenshot feature, set to capture the full page, to create an image file screenshot.png of the URL provided.
Prompt Example: "Please convert the following text to speech: Hello World!." Description: Saiku runs the text_to_speech function to convert the text "Hello World!" into an audio file and will play it if the user requests.
Prompt Example: "Make a pie chart with this data: { 'Data A': 30, 'Data B': 70 }." Description: Using the d3_chart_generation, Saiku will generate a pie chart image based on the data provided.
Prompt Example: "Extract the text from the PDF file named report.pdf." Description: Saiku will apply the parse_pdf function to read the PDF file report.pdf and extract its text content.
Prompt Example: "Perform a SQL query SELECT * FROM users on the local userDB database." Description: Saiku executes the database_query action, running the provided SQL query on the specified database.
Prompt Example: "Create a text file named notes.txt with the following content: Meeting notes...." Description: Saiku will utilize the file_action function to write the provided content into a new text file called notes.txt.
We welcome contributions from the community. If you'd like to contribute, please follow these steps:
git checkout -b feature/YourFeature
)git commit -m 'Add some feature'
)git commit push origin feature/YourFeature
)We are actively seeking sponsors and contributors. If you believe in the potential of Saiku, support the project in any way you can. Your support will help us make Saiku a reality.
We value your feedback. If you encounter any issues or have suggestions for improvements, please open an issue on our GitHub repository.
Please be aware of the rate limits and costs associated with the APIs used by Saiku. Each service provider may have different policies, and it's essential to stay informed to avoid unexpected charges.
Please note that we are in the experimental stage. The architecture and features are subject to significant changes.
This project is licensed under the MIT License - see the LICENSE.md file for details.