Skip to content

Commit

Permalink
Merge pull request #218 from sirji-ai/update-skills-to-skill
Browse files Browse the repository at this point in the history
Update skills to skill
  • Loading branch information
kedarchandrayan authored Jul 30, 2024
2 parents e5e5fea + 0823cee commit 1ea6490
Show file tree
Hide file tree
Showing 22 changed files with 245 additions and 258 deletions.
19 changes: 4 additions & 15 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -65,17 +65,16 @@ Let's go step by step in understanding the architecture.

An Agent in the Sirji framework is a modular AI component that performs a specific task based on a custom pseudo code.

An agent defines its skills in an agent.yml file. This file lists the skills of the agent and the pseudo code to follow for each skill. It also specifies the LLM provider and model to be used for inference. Additionally, it lists the sub-agents that can be invoked from within the agent to complete certain parts of the task.
An agent defines its skill and pseudo code to follow for working on that skill in an agent.yml file. It also specifies the LLM provider and model to be used for inference. Additionally, it lists the sub-agents that can be invoked from within the agent to complete certain parts of the task.

### Recipe (recipe.json)

A Recipe is a file that lists prescribed tasks and tips for solving a particular problem. It also indicates which agent should perform each task. The tips provide guidance for addressing issues that arise when tasks are performed out of the prescribed order. Each tip specifies the task and the agent responsible for it.

### Orchestrator

The Orchestrator is the central component in the Sirji framework, responsible for following:
- Gathering requirement from the user.
- Showing list of available recipes to the user and asking for their choice.
The Orchestrator is the central component in the Sirji framework and is responsible for the following:
- Showing the list of available recipes to the user and asking them for their choice.
- Reading the selected recipe and managing the flow & execution of prescribed tasks from the selected recipe.

### Agent Sessions
Expand All @@ -95,7 +94,7 @@ The Agent Output Index is an index file for the Agent Output Folder that keeps t

### PyPI Packages

We have published following 3 PyPI packages, implementing different responsibilities. These packages are invoked by Python Adapter Scripts, which are spawned by the extension.
We have published the following 3 PyPI packages, implementing different responsibilities. These packages are invoked by Python Adapter Scripts, which are spawned by the extension.

#### sirji-agents <a href="https://pypi.org/project/sirji-agents/"><img src="https://img.shields.io/pypi/v/sirji-agents.svg" alt="Sirji Agents on PyPI" height="15"></a>

Expand Down Expand Up @@ -123,16 +122,6 @@ We have published following 3 PyPI packages, implementing different responsibili
### Architecture Diagram
![Sirji - Architecture Diagram](https://github.com/sirji-ai/sirji/assets/7627517/0edd8cfe-1d49-4119-8960-1a3f2bf1f73f)

## Roadmap
We are calling our next release the ‘Core’ Release (ONGOING).

Here is the link to the ‘Core’ release’s roadmap: https://github.com/orgs/sirji-ai/projects/5

This is a significant release focused on the following key areas:
- **User accounts**: Users will be required to create an account with Sirji. They can either bring their own LLM key or subscribe to a free but rate-limited Developer plan.
- **Improve reliability**: The first version of the VS Code extension improved usability, but after using it ourselves for a while, we identified several issues and limitations ranging from incomplete solutions to a lack of web debugging capabilities. We are addressing these issues to make Sirji more reliable in solving software problems.
- **Custom agents and recipes**: We are developing the framework to enable users to create and use custom agents and recipes (instructions on how the agents interact). This involves enhancing the orchestration functionality and refactoring existing base agents.

## Contributing

We welcome contributions to Sirji! If you're interested in helping improve this VS Code extension, please take a look at our [Contributing Guidelines](./CONTRIBUTING.md) for more information on how to get started.
Expand Down
8 changes: 2 additions & 6 deletions agents/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -118,12 +118,8 @@ config = {
"provider": "openai",
"model": "gpt-4o"
},
"skills": [
{
"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."
}
]
"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."
}


Expand Down
2 changes: 1 addition & 1 deletion agents/setup.py
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@

setup(
name='sirji-agents',
version='0.0.47',
version='0.0.48',
author='Sirji',
description='Orchestrator, Generic Agent, and Research Agent components of the Sirji AI agentic framework.',
license='MIT',
Expand Down
2 changes: 2 additions & 0 deletions agents/sirji_agents/llm/generic/infer.py
Original file line number Diff line number Diff line change
Expand Up @@ -50,6 +50,8 @@ def __get_response(self, conversation):

while(True):
response_message, current_prompt_tokens, current_completion_tokens = self.__call_llm(conversation)

self.logger.info(f"Completions API Raw Response: \n{response_message}\n")

prompt_tokens += current_prompt_tokens
completion_tokens += current_completion_tokens
Expand Down
4 changes: 2 additions & 2 deletions agents/sirji_agents/llm/generic/system_prompts/anthropic.py
Original file line number Diff line number Diff line change
Expand Up @@ -17,15 +17,15 @@ def system_prompt(self):
Your Agent ID: {self.config['id']}
Your OS (referred as SIRJI_OS later): {os.name}
You are an expert having skill: {self.config['skills'][0]['skill']}""")
You are an expert having skill: {self.config['skill']}""")

instructions = textwrap.dedent(f"""
You must follow these instructions:
1. Convert all points in your pseudo code into plain English steps with a maximum of 10 words each. Log these steps using the LOG_STEPS action.
2. After logging the steps, follow your pseudo code step by step to the best of your ability. Following each pseudo code step in the specified order is mandatory. Dont miss to follow any of these steps.
3. If any step is not applicable or cannot be followed, use the DO_NOTHING action to skip it.""")

pseudo_code = "\nYour pseudo code which you must follow:\n" + self.config['skills'][0]['pseudo_code']
pseudo_code = "\nYour pseudo code which you must follow:\n" + self.config['pseudo_code']

response_specifications = textwrap.dedent(f"""
Your response must adhere rigorously to the following rules, without exception, to avoid critical system failures:
Expand Down
14 changes: 7 additions & 7 deletions agents/sirji_agents/llm/generic/system_prompts/default.py
Original file line number Diff line number Diff line change
Expand Up @@ -114,13 +114,13 @@ def __format_skills(self):
output_text += "Here are your skills details:\n\n"

# Check if 'skills' exists in the config and is not empty
if "skills" in self.config and self.config["skills"]:
for skill in self.config["skills"]:
output_text += f"Skill: {skill['skill']}\n"
if "skill" in self.config and self.config["skill"]:

output_text += f"Skill: {self.config['skill']}\n"

output_text += "Make sure to first convert all the points mentioned in Pseudo code in plain english to steps having at max 10 words each and log these steps using LOG_STEPS action.\n"
output_text += "Then, execute the steps in the order they are logged.\n"
output_text += f"Pseudo code which you must follow:\n{skill['pseudo_code']}"
output_text += "\n"
output_text += "Make sure to first convert all the points mentioned in Pseudo code in plain english to steps having at max 10 words each and log these steps using LOG_STEPS action.\n"
output_text += "Then, execute the steps in the order they are logged.\n"
output_text += f"Pseudo code which you must follow:\n{self.config['pseudo_code']}"
output_text += "\n"

return output_text
5 changes: 2 additions & 3 deletions docs/How to Write an Agent.md
Original file line number Diff line number Diff line change
Expand Up @@ -32,9 +32,8 @@ This YML file has these mandatory fields:
- **model**: Specifies the model to be used for inference. Possible values: gpt-4o, deepseek-coder, etc.
- **sub_agents**: Optional list of sub_agent objects each having these keys:
- **id**: ID of the sub agent.
- **skills**: Array of skill objects, each having these keys:
- **skill**: Specifies the skill of the agent.
- **pseudo_code**: Specifies the point-wise pseudo-code which the agent follows to work on the task.
- **skill**: Specifies the skill of the agent.
- **pseudo_code**: Specifies the point-wise pseudo-code which the agent follows to work on the task.

## Pseudocode Use Cases

Expand Down
2 changes: 1 addition & 1 deletion sirji/vscode-extension/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@
"name": "sirji",
"displayName": "Sirji",
"description": "Sirji is an AI Software Development Agent.",
"version": "0.0.31-beta.1",
"version": "0.0.31-beta.2",
"publisher": "TrueSparrow",
"icon": "out/assets/sirji.png",
"repository": {
Expand Down
39 changes: 19 additions & 20 deletions sirji/vscode-extension/src/defaults/agents/ARCHITECT.yml
Original file line number Diff line number Diff line change
Expand Up @@ -3,23 +3,22 @@ name: Architect Agent
llm:
provider: openai
model: gpt-4o
skills:
- skill: Plan and finalize architecture
pseudo_code: |
1. Read the problem statement from the Agent Output Folder.
2. Read the epics and user stories from the Agent Output Folder.
3. Elaborate on the architecture components required to implement the epics, user stories, and problem statement. This includes:
- Programming language
- Framework
- Database
- Cache
- Any other applicable components
4. Ask SIRJI_USER to provide feedback on the detailed architecture components.
Use the following template to ask for finalization:
Ask SIRJI_USER to provide feedback with the message:
"Here are the architecture components:
<<detailed architecture components>>
<<confirmation question for the user>>"
5. Adjust the architecture components based on SIRJI_USER's feedback.
6. Repeat steps 4-5 until SIRJI_USER confirms the finalization.
7. Store the finalized architecture components in the Agent Output Folder.
skill: Plan and finalize architecture
pseudo_code: |
1. Read the problem statement from the Agent Output Folder.
2. Read the epics and user stories from the Agent Output Folder.
3. Elaborate on the architecture components required to implement the epics, user stories, and problem statement. This includes:
- Programming language
- Framework
- Database
- Cache
- Any other applicable components
4. Ask SIRJI_USER to provide feedback on the detailed architecture components.
Use the following template to ask for finalization:
Ask SIRJI_USER to provide feedback with the message:
"Here are the architecture components:
<<detailed architecture components>>
<<confirmation question for the user>>"
5. Adjust the architecture components based on SIRJI_USER's feedback.
6. Repeat steps 4-5 until SIRJI_USER confirms the finalization.
7. Store the finalized architecture components in the Agent Output Folder.
39 changes: 19 additions & 20 deletions sirji/vscode-extension/src/defaults/agents/CODER.yml
Original file line number Diff line number Diff line change
Expand Up @@ -3,23 +3,22 @@ name: Coding Agent
llm:
provider: openai
model: gpt-4o
skills:
- 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.
2. Read the epics & user stories from the Agent Output Folder.
3. Read the architecture components from the Agent Output Folder.
4. Write concrete code implementing the epics & user stories and the problem statement, following these rules:
- Ensure that the code follows secure software development practices.
- The code files should be created inside the project folder.
5. Install necessary packages or libraries in local folders.
- Check if the programming language-specific packages or libraries are already installed.
- If not installed, install using tools like venv for Python or package.json for Node.js.
6. Verify system-level command installations.
- Confirm if required system-level commands are already installed by checking versions to avoid redundant installations.
7. Execute the written code and evaluate the output.
- Run the code to check for any errors.
- If errors are found, solve them before proceeding.
8. If the code requires a server, ensure to start or restart the server.
- Run commands compatible with SIRJI_OS.
- Use the command `npm start` or the relevant command to start the server.
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.
2. Read the epics & user stories from the Agent Output Folder.
3. Read the architecture components from the Agent Output Folder.
4. Write concrete code implementing the epics & user stories and the problem statement, following these rules:
- Ensure that the code follows secure software development practices.
- The code files should be created inside the project folder.
5. Install necessary packages or libraries in local folders.
- Check if the programming language-specific packages or libraries are already installed.
- If not installed, install using tools like venv for Python or package.json for Node.js.
6. Verify system-level command installations.
- Confirm if required system-level commands are already installed by checking versions to avoid redundant installations.
7. Execute the written code and evaluate the output.
- Run the code to check for any errors.
- If errors are found, solve them before proceeding.
8. If the code requires a server, ensure to start or restart the server.
- Run commands compatible with SIRJI_OS.
- Use the command `npm start` or the relevant command to start the server.
Loading

0 comments on commit 1ea6490

Please sign in to comment.