Orchestrator, Generic Agent, and Research Agent components of the Sirji AI agentic framework.
Project description
Sirji is an agentic AI framework for software development.
Built with ❤️ by True Sparrow
Sirji Agents
sirji-agents
is a PyPI package that implements the following components of the Sirji AI agentic framework:
- Orchestrator: The Orchestrator is the central component in the Sirji framework, responsible for managing the flow and execution of tasks across different agents.
- Generic Agent: Run time composable class providing the agent functionality as per the pseudo code provided in the agent.yml file.
By default, it utilizes:
- OpenAI Chat Completions API
- OpenAI Assistants API
Installation
Setup Virtual Environment
We recommend setting up a virtual environment to isolate Python dependencies, ensuring project-specific packages without conflicting with system-wide installations.
python3 -m venv venv
source venv/bin/activate
Install Package
Install the package from PyPi:
pip install sirji-agents
Run the following command to install playwright:
playwright install
Usage
Environment Variables
Ensure that the following environment variables are set:
export SIRJI_PROJECT="Absolute folder path for Sirji to use as its project folder."
export SIRJI_INSTALLATION_DIR='Absolute path of the Sirji installation directory.'
export SIRJI_RUN_PATH='Folder path containing run related logs, etc.'
export SIRJI_MODEL_PROVIDER='Model Provider to be used for LLM inference. Defaults to "openai".'
export SIRJI_MODEL='Model to be used for LLM inference. Defaults to "gpt-4o".'
export SIRJI_MODEL_PROVIDER_API_KEY='API key to be used for LLM inference.'
Orchestrator
The Orchestrator is the central component in the Sirji framework, responsible for managing the flow and execution of tasks across different agents.
from sirji_agents import Orchestrator
agent_output_folder_index = {
"SIRJI/problem.txt": {
"description": "Problem statement from the user.",
"created_by": "SIRJI"
},
"PRODUCT_MANAGER/finalized_epics_user_stories.txt": {
"description": "Finalized Epics and User Stories for the Tic-Tac-Toe game with AI opponent.",
"created_by": "PRODUCT_MANAGER"
},
"ARCHITECT/finalized_architecture_components.txt": {
"description": "Finalized architecture components for the Tic-Tac-Toe game with AI opponent.",
"created_by": "ARCHITECT"
}
}
agent = Orchestrator(agent_output_folder_index)
# History is the array of LLM conversations till now
history = []
# Input message string
message_str = ""
response_message, history, prompt_tokens, completion_tokens = agent.message(message_str, history)
Generic Agent
Run time composable class providing the agent functionality as per the pseudo code provided in the agent.yml file.
# Convert the agent.yml file to a Python dictionary
config = {
"id": "CODER",
"name": "Coding Agent",
"llm": {
"provider": "openai",
"model": "gpt-4o"
},
"skill": "Developing end-to-end working code for the epic & user stories, making use of the finalized architecture components.",
"pseudo_code": "1. Read the problem statement from the Agent Output Folder.\n2. Read the epics & user stories from the Agent Output Folder.\n3. Read the architecture components from the Agent Output Folder.\n4. Write concrete code implementing the epics & user stories and the problem statement, following these rules:\n - Ensure that the code follows secure software development practices.\n - The code files should be created inside the project folder.\n5. Install necessary packages or libraries in local folders.\n - Check if the programming language-specific packages or libraries are already installed.\n - If not installed, install using tools like venv for Python or package.json for Node.js.\n6. Verify system-level command installations.\n - Confirm if required system-level commands are already installed by checking versions to avoid redundant installations.\n7. Execute the written code and evaluate the output.\n - Run the code to check for any errors.\n - If errors are found, solve them before proceeding.\n8. If the code requires a server, ensure to start or restart the server.\n - Run commands compatible with SIRJI_OS.\n - Use the command `npm start` or the relevant command to start the server."
}
agent_output_folder_index = {
"SIRJI/problem.txt": {
"description": "Problem statement from the user.",
"created_by": "SIRJI"
},
"PRODUCT_MANAGER/finalized_epics_user_stories.txt": {
"description": "Finalized Epics and User Stories for the Tic-Tac-Toe game with AI opponent.",
"created_by": "PRODUCT_MANAGER"
},
"ARCHITECT/finalized_architecture_components.txt": {
"description": "Finalized architecture components for the Tic-Tac-Toe game with AI opponent.",
"created_by": "ARCHITECT"
}
}
from sirji_agents import GenericAgent
agent = GenericAgent(config, agent_output_folder_index)
history = []
message_str = "***\nFROM: ORCHESTRATOR\nTO: CODER\nACTION: INVOKE_AGENT\nSUMMARY: Implement the epic & user stories using the architecture components.\nBODY:\nPImplement the epic & user stories using the architecture components.\n***"
response_message, history, prompt_tokens, completion_tokens = agent.message(message_str, history)
For Contributors
- Fork and clone the repository.
- Create and activate the virtual environment as described above.
- Set the environment variables as described above.
- Install the package in editable mode by running the following command from repository root:
pip install -e .
- Run the following command to install playwright:
playwright install
Running Tests and Coverage Analysis
TODO - Introduce test cases.
License
Distributed under the MIT License. See LICENSE
for more information.
Project details
Release history Release notifications | RSS feed
Download files
Download the file for your platform. If you're not sure which to choose, learn more about installing packages.
Source Distribution
Built Distribution
File details
Details for the file sirji_agents-0.0.51.tar.gz
.
File metadata
- Download URL: sirji_agents-0.0.51.tar.gz
- Upload date:
- Size: 24.8 kB
- Tags: Source
- Uploaded using Trusted Publishing? No
- Uploaded via: twine/5.1.1 CPython/3.12.4
File hashes
Algorithm | Hash digest | |
---|---|---|
SHA256 | 96ba342f9dd2cfe35d118f37fe8d5adb4255b0b33563d92a45d1a52bf1a62ae4 |
|
MD5 | 2a922b503b5232ab3cb09149c235661f |
|
BLAKE2b-256 | 7f3b48cfc56fdadea2e008e56b79332d7cde9799a175cff8d266a5eaea9cd7cc |
File details
Details for the file sirji_agents-0.0.51-py3-none-any.whl
.
File metadata
- Download URL: sirji_agents-0.0.51-py3-none-any.whl
- Upload date:
- Size: 34.2 kB
- Tags: Python 3
- Uploaded using Trusted Publishing? No
- Uploaded via: twine/5.1.1 CPython/3.12.4
File hashes
Algorithm | Hash digest | |
---|---|---|
SHA256 | ba5b955a40995461449c0e4b61e0db63d28610274f965d3178eb67cdd94bb573 |
|
MD5 | a2239c7e307f9cecfeda79af4c3625ea |
|
BLAKE2b-256 | 324aef4af7db009f077e034336a1ca8eb069167e94bc7e951de6b99ab9724200 |