Package: genia
Imagine a ChatGPT integrated with your team's tools and APIs, capable of executing tasks and handling queries independently, contributing to time and energy efficiency.GeniA is an AI assistant developed for engineering tasks. GeniA is a dynamic, intuitive tool capable of managing tasks in your team's Slack channel.📝 Table of Contents🎉 Introduction🌟 Features🆚 Comparison to LLM🔌 Supported Tools⚙️ Expanding GeniA's Toolbox🚀 Future Plans[🔒 Security▶️ Getting started🔧 Installation📖 Developer Guide🤝 Contributing📜 License📞 ContactIntroductionWhile ChatGPT and CoPilot have garnered significant attention for their ability to assist with writing new code, as software engineers, we understand that coding is merely one aspect of our daily responsibilities and AI present many additional opportunities to minimize bolier plate, time wasters and cross team dependencies.Under the hoodGeniA built upon thefunction-calling capabilities offered by OpenAI. Azure OpenAI supported as well.GeniA requires OpenAI API Key, you can generatehereGeniA is 100% open source!Built with love by engineers for engineers, our goal is to help teams harness the power of LLMs to boost how fast you can go!GeniA is Production gradewe have set ourselves the goal of building a production-grade software right off the bat. Now, you can start working with GeniA in production by installing the GeniA container, integrate it into your team's Slack channel, and let it land on its feet running.Imagine a virtual asisstant empowering you with:Research & Development ScenariosDeployment, troubleshooting, log summarization, build initiation, PR digestingDeploy your k8s-based service to staging/production using ArgoInvestigate the cause of the last Argo deployment failureSummarize the recent logs from your Node.js serviceInitiate a new Jenkins buildSummarize GitHub pull request along with its contentFinOps Shift-LeftReporting on unused resources, optimising cloud expenditure.Generate a report detailing unutilized cloud resources per team and share it on SlackCreate a usage report for AWS ECR (Amazon Elastic Container Registry) to identify potential cost-saving opportunitiesSecOps Shift-LeftVulnerability checks, best practices, playbooks.Conduct a security vulnerability analysis on your S3 bucketsGrant me temporary production permissions (Add me temporarily to an IAM user group with auditing)SRE Shift-Leftlower your MTTR, Service usage monitoring, service optimization.Examine my service usage metrics for any anomaliesIncrease the memory for my Node service deployed on a k8s clusterDevOps Shift-LeftScaling services, managing EC2 instances and cron jobs, coding utilities.Scale out my Node.js k8s-based serviceIdentify unlabeled EC2 instancesSet up a cron job to trigger a taskDevelop code for a new utility and deploy my 'automate this task' snippet to a lambda functionTrigger any of my company's predefined playbooksMany more great examplescan be found hereIntroducing Tools 3.0: Enhance Coding with Large Language ModelsTools 2.0 with low-code/no-code approaches have been revolutionary, allowing users to leverage drag-and-drop functions over traditional coding for certain use cases.However, with the advent of Language Learning Models (LLMs), Tools 3.0 pushes the boundary further, empowering everyone to write code using natural language. It signifies a shift from proprietary, restrictive design paradigms to a more open, innovative approach where the model assists in understanding and revising complex code snippets.Tools 3.0 negates the need for proprietary YAML files and vendor-specific domain languages (DSLs), urging users to rely on native code. Rather than waiting for vendor updates to fulfill requirements, users can now instruct LLMs to write code, create it themselves, or utilize the vast range of community-contributed tools.Remember, any class, method, or API available becomes a learning and application tool for GeniA. Tools 3.0 redefines coding, transforming it into an intuitive, flexible, and democratized process.FeaturesGeniA's unique features include:Production-Grade: Engineered for real-world applications.Collaborative assistant: Designed to make the development process more interactive and enjoyable.Proactively taking action: building, coding, executing, summarizing. not just giving you a good advice.Customizable and Extensible: As an open-source tool, GeniA can be tailored to your specific needs.Quick Learner: Rapidly adapts to new tools and APIs.Comparison to LLMSafety Prioritized:While LLMs offer suggestions, GeniA goes a step further but with utmost caution. It's designed to function responsibly in live environments, ensuring it doesn't take unrestricted decisions.Beyond Recommendations:Where LLMs provide guidance, GeniA offers proactive assistance. It doesn't just advise on the steps you need to take but goes ahead to perform the tasks itself. You could provide a code snippet, and GeniA will handle its deployment to Lambda, integrating seamlessly with your production environment and CI/CD tools.Intelligent Tool Selection:GeniA is not just another tool, it's also a tool-finding system. It's designed to acquaint itself with an expansive set of tools. However, mindful of the limitations of the LLM context window and token costs, it optimizes and feeds the model with only the most relevant tools. Utilizing vector databases (FAISS by default), GeniA selects tools with descriptions that align best with your intent. This smart selection process allows GeniA to work more efficiently and be more responsive to your specific needs.Supported ToolsArgoCDAWSGitHubJenkinsKubernetesOpen Policy Agent (OPA)PagerDutySlack WebhookDozens of more tools are coming really soonThe details of supported tools can be foundhere.
The list of OpenAI functions spec which used by the tools can be foundhere.Growing GeniA's ToolboxTeaching GeniA new Skills: Adding Tools EffortlesslyAdding a new tool adheres to theOpenAI JSON configurationstandards. This ensures compatibility, making it easy to import any existing function-calling project or ChatGPT plugin.
The only missing component is a brief description guiding the model on when to use the function. We prefer to maintain this in a separate file - refer to thetools.yaml.GeniA is designed to be a quick learner, rapidly acquiring the capability to use new tools. We've made the learning process as straightforward as possible. Here's how you can teach GeniA:Incorporating Code Tools:By adding a simple specification, GeniA can invoke any class and method within your codebase. For instance, below is an example of integrating a utility tool from your software development suite:-tool_name:bug_tracker_apicategory:pythonclass:mypackage.utilities.bugtracker.BugTrackerAPIWrappermethod:runConnecting to URLs:GeniA can perform GET requests with either path or request parameters. You can integrate this by providing a URL, as shown in this example, which fetches the current CI/CD pipeline status:-tool_name:get_pipeline_statustitle:fetch the current pipeline statuscategory:urltemplate:https://ci.yourserver.com/api/v1/pipeline?project_id={project_id}&pipeline_id={pipeline_id}Utilizing OpenAPI Swagger Files:Imagine your AI model being able to invoke any API out there - GeniA is capable of that! You can easily integrate any standard OpenAPI into GeniA using a Swagger file. This feature is still under development, but a working example is provided out of the box.Learning Natural Language Skills:This is where LLM truly shines. GeniA has an experimental feature that allows it to acquire new skills using natural language. It retains the steps taken to accomplish a task in its long-term memory, categorizes them under a new skill, and loads them into memory for future use. In this way, GeniA can learn and execute complex tasks, all in natural language.see complete functiondocumentation hereFuture PlansAzure-based Open AI support.OKTA integration for SSO.RBAC Support.Extending capabilities with thousands of new tools.Can GeniA Interface with Any Existing API?Indeed, GeniA has the capability to connect with any available API. Although it's currently an active area of academic research rather than a full-fledged production-grade tool, we've adapted OpenAI's plugin approach for increased simplicity and wider integration possibilities. You can incorporate GeniA into any existing code classes or APIs.Our ultimate achievement is empowering GeniA to acquire new skills without necessitating model fine-tuning or, in many cases, redeployment of your service. However, it's worth noting that the introduction of a completely new tool might call for some prompt adjustments and testing.Presently, the authentication process for a new tool falls on the tool creator. However, we plan to standardize this aspect within the project framework shortly.SecurityGeniA is stateless. It connects with cloud DBs for conversation storage and handles secrets via environment variables. Plans are in place for standard secrets store provider integration.On the subject of secrets management, the project currently utilizes environment variables, as defined in the.env.templatefile. However, we are actively developing integrations with standard secrets store providers for improved security.We presently advise the integration of GeniA within a designated private channel, accessible exclusively to a whitelist of approved engineers.We are actively developing Single Sign-On (SSO) and Role-Based Access Control (RBAC) features for GeniA. These enhancements are slated for release in the near future.Getting startedThe easiest way to get started with GeniA isStreamlitweb app. Make sure you havepython3&pip3installed, then run:pip3 install streamlit geniaThen you can run the streamlit web app by:geniaYou can also play with GeniA in terminal using the local mode. Once you done to play with it you can move to the collaborative mode as a Slack App Bot. For simplicity, we recommend running it locally usingDocker. If a local installation is desired, please refer to theInstallationsection.When using Azure OpenAI, you need to also configure those environment variables:OPENAI_API_DEPLOYMENT=
OPENAI_API_TYPE="azure"
OPENAI_API_BASE=https://<your-endpoint.openai.azure.com/
OPENAI_API_VERSION="2023-07-01-preview"Note:GeniA uses OpenAI, be mindful of cost implications and ensure you set usage limits. You can configure both soft and hard limits at the following URL:https://platform.openai.com/account/billing/limits.By default, GeniA is set to usegpt-3.5-turbo-0613. We acknowledge thatgpt-4-0613often delivers superior results, but have found the 3.5 version to be a more cost-effective choice.InstallationRun in Slack App BotCreate Slack App BotNote:When it comes toChoosing a protocol to connect to Slack, there are two primary options. In this instance, we utilizeSocket Mode, enabling your app to leverage theEvents APIand the platform's interactive components without the need for a public HTTP Request URL. Instead of sending payloads to a public endpoint, Slack employs a WebSocket URL to communicate with your app.For the Slack GPT Bot to function effectively, it's crucial to establish the correct permissions for your Slack bot. Please follow the forthcoming guidelines to set up the necessary permissions:In the project's root directory, mv the.env.templateinto.envfile and input your Slack keysCreate a newSlack App.Navigate to yourSlack API Dashboardand select the app you've created for this bot.On the left-hand side menu, click onOAuth & Permissions.Within theScopesdivision, there are two categories of scopes:Bot Token ScopesandUser Token Scopes. Append the following scopes underBot Token Scopes:app_mentions:readchat:writechannels:historygroups:historyim:historympim:historyAscend to theOAuth Tokens for Your Workspaceand hit theInstall App To Workspacebutton. This operation will produce theSLACK_BOT_TOKEN.On the left-hand side menu, click onSocket Modeand activate it. You'll be asked toGenerate an app-level token to enable Socket Mode. Generate a token labeledSLACK_APP_TOKENand include theconnections:writescope.In theSocket Modepage'sFeatures affectedsection, hitEvent Subscriptionsand switchEnable Eventsto theOnstate. Append the app_mention event, coupled with theapp_mentions:readscope in theSubscribe to bot eventssubsection below the toggle.Run via DockerHandle secrets by copy the.env.templateinto.env, and put in.envthe minimal secrets which is justOPENAI_API_KEYRun in local terminal modedocker run -p 5001:5001 --env-file ./.env -it geniadev/genia:latestRun in slack app bot modedocker run -p 5001:5001 --env-file ./.env -it geniadev/genia:latest slackDeveloper GuideRun GeniA from source :: Dockergit clone https://github.com/GeniA-dev/GeniA
cd GeniA
docker build -t geniadev/genia:latest .Run viaDockerRun GeniA from source :: PythonPoetry installcurl -sSL https://install.python-poetry.org | python3 -Run in local terminal modepoetry run localRun in slack app bot modeFirst install the botpoetry run slackRun in streamlit modepoetry run streamlitTestingpoetry run pytest testsContributing👩‍💻➕👨‍💻 Fork GeniA repository, make your changes, and submit a pull request! We appreciate your contributions! 🙌🌟💖
More details can be foundhere.LicenseLicensed under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance with the License. You may obtain a copy of the License athttp://www.apache.org/licenses/LICENSE-2.0Unless required by applicable law or agreed to in writing, software distributed under the License is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the License for the specific language governing permissions and limitations under the License.LICENSEContactGot an idea to improve our project? We'd love to hear it and collaborate with you. Don't hesitate to reach out to us! Just open anissueand GeniA will respond to you 🦸‍♀️🦸‍♂️ !
You can see detailshere.