{"id":18223054,"url":"https://github.com/giulianodigiuseppe/agentforfilecommands","last_synced_at":"2026-05-06T04:02:53.702Z","repository":{"id":260929517,"uuid":"879868029","full_name":"GiulianoDiGiuseppe/AgentForFileCommands","owner":"GiulianoDiGiuseppe","description":"A Python server that enables an LLM-based agent to perform operations on files and folders through a REST API.","archived":false,"fork":false,"pushed_at":"2024-11-03T16:51:19.000Z","size":171,"stargazers_count":1,"open_issues_count":0,"forks_count":0,"subscribers_count":1,"default_branch":"main","last_synced_at":"2025-04-08T01:42:27.728Z","etag":null,"topics":["agents","langchain","langgraph","langgraph-python","poetry","python","rag"],"latest_commit_sha":null,"homepage":"","language":"Python","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"gpl-3.0","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/GiulianoDiGiuseppe.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":null,"license":"LICENSE","code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null,"governance":null,"roadmap":null,"authors":null,"dei":null,"publiccode":null,"codemeta":null}},"created_at":"2024-10-28T17:27:59.000Z","updated_at":"2025-03-09T09:43:07.000Z","dependencies_parsed_at":"2024-11-03T17:39:32.965Z","dependency_job_id":null,"html_url":"https://github.com/GiulianoDiGiuseppe/AgentForFileCommands","commit_stats":null,"previous_names":["giulianodigiuseppe/agentforfilecommands"],"tags_count":0,"template":false,"template_full_name":null,"purl":"pkg:github/GiulianoDiGiuseppe/AgentForFileCommands","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/GiulianoDiGiuseppe%2FAgentForFileCommands","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/GiulianoDiGiuseppe%2FAgentForFileCommands/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/GiulianoDiGiuseppe%2FAgentForFileCommands/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/GiulianoDiGiuseppe%2FAgentForFileCommands/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/GiulianoDiGiuseppe","download_url":"https://codeload.github.com/GiulianoDiGiuseppe/AgentForFileCommands/tar.gz/refs/heads/main","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/GiulianoDiGiuseppe%2FAgentForFileCommands/sbom","scorecard":null,"host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":286080680,"owners_count":32677933,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2026-05-06T02:33:58.958Z","status":"ssl_error","status_checked_at":"2026-05-06T02:33:39.611Z","response_time":117,"last_error":"SSL_connect returned=1 errno=0 peeraddr=140.82.121.5:443 state=error: unexpected eof while reading","robots_txt_status":"success","robots_txt_updated_at":"2025-07-24T06:49:26.215Z","robots_txt_url":"https://github.com/robots.txt","online":false,"can_crawl_api":true,"host_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub","repositories_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories","repository_names_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repository_names","owners_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners"}},"keywords":["agents","langchain","langgraph","langgraph-python","poetry","python","rag"],"created_at":"2024-11-04T00:03:50.573Z","updated_at":"2026-05-06T04:02:53.663Z","avatar_url":"https://github.com/GiulianoDiGiuseppe.png","language":"Python","funding_links":[],"categories":[],"sub_categories":[],"readme":"# AgentForFileCommands\n\nLLM File System Agent: A Python server that enables an LLM-based agent to perform operations on files and folders through a REST API.\n\n\n## Guide to Clone and Activate a Project with Poetry\n\n* **Open Terminal or Command Prompt**:\n* **Clone the Repository**:\n\n  Run the following command, replacing `\u003crepository_url\u003e` with the actual URL of the repository:\n\n  ```bash\n\n  git clone \u003crepository_url\u003e\n\n  cd \u003crepository_name\u003e\n\n  ```\n* **Install Dependencies**:\n\n  Install all dependencies listed in `pyproject.toml`:\n\n  ```bash\n\n  poetry install\n\n  ```\n* **Activate the Virtual Environment**:\n\n  Activate the Poetry virtual environment:\n\n  ```bash\n\n  poetry shell\n\n  ```\n\n## Run Code\n\nTo start the backend, use the following command:\n\n```bash\npoetry run python -m uvicorn src.app:app --reload\n```\n\nOnce the server is running, you can make POST requests to the following endpoint:  **[http://0.0.0.0:8000/agent](http://0.0.0.0:8000/agents)** .\n\n### Request Body\n\nThe body of the request should be formatted as follows:\n\n```\n{\n    \"msg\" :    \"I want to find all files in directory \u003cPATH_DIRECTORY\u003e with txt extension. Then for those of these files which contain at least 1 word log, change their extension to .log\"\n}\n```\n\nThe result will be provided in the response from the last agent.\n\n## Workflow\n\nThe system consists of a supervisor agent and four executor agents. The supervisor agent's code can be found in `src/agents/supervisor_agent.py`. Each executor agent has its own set of functions located in `src/tools`.\n\n### Process Overview\n\n1. The supervisor agent receives the initial message.\n2. Based on the message, it decides which executor agent should handle the request or sends a \"FINISH\" message to conclude the workflow.\n3. The supervisor monitors the responses from the executor agents and determines whether to continue or halt the process.\n\nThis design ensures clear control over the execution flow and allows for effective management of the agents.\n\n# Conclusions\n\n* **Performance Comparison** : The **gpt4o-mini** often created infinite loops and failed to terminate, while **gpt4o** demonstrated significantly higher accuracy.\n  * **Improvement Suggestion** : Consider developing an additional agent to refine and clarify the outputs from the executor agents.\n  * **Prompt Optimization** : Further optimization of the supervisor agent's prompts could enhance its decision-making capabilities.\n* **Agent Organization** : Initially, I tested integrating all tools into a single executor agent. However, I opted to separate the tools into multiple executor agents for better modularity and management.\n* **Security Measures** : The current design lacks safeguards against potentially malicious requests and does not incorporate oversight before executing certain actions. Implementing such measures would significantly improve system integrity.\n* **Functionality Improvements** : The functions developed are quite basic and present opportunities for optimization:\n  * **Enhanced File Search** : Implement recursive searching using functions like `os.walk` to traverse deeper file structures rather than limiting the search to the top level with `os.listdir`.\n  * **Path Optimization** : Improve the concatenation of file paths for efficiency and readability.\n\n\n## Future Work\n\n1. **Self-Reflection** : Adopt **ReAct** to specify how the supervisor divides tasks step-by-step and communicate what is missing after each action of the executors, improving transparency in the workflow for Explainable AI. [Langchain create react agent](https://python.langchain.com/v0.1/docs/modules/agents/agent_types/react/)\n2. **User Interaction** : Request permission for operations and utilize **Chain of Hindsight (CoH)** for improvements.\n3. **Memory Evolution** : Update the operational context and apply **Algorithm Distillation (AD)** to learn from past stories.\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fgiulianodigiuseppe%2Fagentforfilecommands","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fgiulianodigiuseppe%2Fagentforfilecommands","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fgiulianodigiuseppe%2Fagentforfilecommands/lists"}