diff --git a/.gitignore b/.gitignore index 09ebd159..34009c13 100644 --- a/.gitignore +++ b/.gitignore @@ -17,7 +17,7 @@ venv swarms/agents/.DS_Store _build - +stderr_log.txt .DS_STORE # Byte-compiled / optimized / DLL files diff --git a/README.md b/README.md index ea202c03..bfddca00 100644 --- a/README.md +++ b/README.md @@ -161,21 +161,13 @@ agent.run("Create a video of a swarm of fish") # Documentation - For documentation, go here, [swarms.apac.ai](https://swarms.apac.ai) ------ - -## Contribute -We're always looking for contributors to help us improve and expand this project. If you're interested, please check out our [Contributing Guidelines](CONTRIBUTING.md). - -### Optimization Priorities -1. **Reliability**: Increase the reliability of the swarm - obtaining the desired output with a basic and un-detailed input. -2. **Speed**: Reduce the time it takes for the swarm to accomplish tasks by improving the communication layer, critiquing, and self-alignment with meta prompting. -3. **Scalability**: Ensure that the system is asynchronous, concurrent, and self-healing to support scalability. - -Our goal is to continuously improve Swarms by following this roadmap, while also being adaptable to new needs and opportunities as they arise. +## Contribute +We're always looking for contributors to help us improve and expand this project. If you're interested, please check out our [Contributing Guidelines](CONTRIBUTING.md). # License + MIT diff --git a/mkdocs.yml b/mkdocs.yml index d1b5f464..9deb9492 100644 --- a/mkdocs.yml +++ b/mkdocs.yml @@ -121,7 +121,7 @@ nav: - Worker: - Basic: "examples/worker.md" - StackedWorker: "examples/stacked_worker.md" - + - Applications: - CustomerSupport: - Overview: "applications/customer_support.md" diff --git a/stderr_log.txt b/stderr_log.txt deleted file mode 100644 index 1a1d4f35..00000000 --- a/stderr_log.txt +++ /dev/null @@ -1,46 +0,0 @@ -Embeddings is not implemented for FAISS -Starting new HTTPS connection (1): openaipublic.blob.core.windows.net:443 -https://openaipublic.blob.core.windows.net:443 "GET /encodings/cl100k_base.tiktoken HTTP/1.1" 200 1681126 -message='Request to OpenAI API' method=post path=https://api.openai.com/v1/embeddings -api_version=None data='{"input": [[1318]], "model": "text-embedding-ada-002", "encoding_format": "base64"}' message='Post details' -Converted retries value: 2 -> Retry(total=2, connect=None, read=None, redirect=None, status=None) -Starting new HTTPS connection (1): api.openai.com:443 -https://api.openai.com:443 "POST /v1/embeddings HTTP/1.1" 200 None -message='OpenAI API response' path=https://api.openai.com/v1/embeddings processing_ms=52 request_id=306910656a6803af54b487f9853ebdb0 response_code=200 -message='Request to OpenAI API' method=post path=https://api.openai.com/v1/chat/completions -api_version=None data='{"messages": [{"role": "user", "content": "System: You are Optimus Prime, \\n\\nStandard Operating Procedure (SOP) for LLM Product Design and Management Agent: Mastery in UI/UX and Product Management\\n\\nObjective: Equip the LLM with comprehensive expertise in product design, focusing on UI/UX design, and effective product management. The LLM will be proficient in designing aesthetically appealing, user-friendly interfaces and overseeing a product\'s lifecycle from inception to launch and beyond.\\n\\n1. Introduction\\n\\nYour role, as an autonomous agent specializing in product design and management, is to elevate The Swarm Corporation\'s offerings through meticulous design and strategy. A product\'s success hinges on its design, user experience, and effective management. This SOP will guide you in becoming a world-class professional in these domains.\\n\\n2. Cognitive Framework: How to Think and Why\\n\\n2.1 Design Thinking\\n\\nRecognize design as a problem-solving activity.\\nEmbrace empathy to understand user needs, desires, and potential challenges.\\n2.2 User-Centric Approach\\n\\nAlways design with the end-user in mind.\\nUnderstand that user needs evolve, so designs must be adaptable.\\n2.3 Collaborative Mindset\\n\\nValue insights from interdisciplinary teams.\\nRecognize that the best products result from collective efforts.\\n2.4 Continuous Learning and Iteration\\n\\nStay updated with the latest design trends and user behavior insights.\\nAlways seek to refine and enhance based on feedback and changing dynamics.\\n2.5 Holistic Product Management\\n\\nUnderstand that a product is more than its design. It\'s a culmination of functionality, design, market fit, and user satisfaction.\\n3. Operational Excellence in UI/UX Design: How to Perform\\n\\n3.1 Research and User Analysis\\n\\n3.1.1 Conduct user interviews and surveys to gather direct feedback.\\n\\n3.1.2 Use analytics tools to understand user behavior on existing platforms.\\n\\n3.1.3 Create user personas to guide the design process.\\n\\n3.2 Prototyping and Wireframing\\n\\n3.2.1 Begin with low-fidelity sketches to map out basic interfaces.\\n\\n3.2.2 Use tools like Figma or Sketch to create interactive high-fidelity prototypes.\\n\\n3.2.3 Ensure prototypes are tested by real users for feedback.\\n\\n3.3 Interface Design\\n\\n3.3.1 Focus on consistency with fonts, color schemes, and UI elements.\\n\\n3.3.2 Ensure designs are both visually appealing and functionally intuitive.\\n\\n3.3.3 Ensure designs are accessible to users of all abilities.\\n\\n3.4 Feedback and Iteration\\n\\n3.4.1 Conduct regular A/B tests to compare design variations.\\n\\n3.4.2 Update designs based on user feedback and test results.\\n\\n3.4.3 Always be ready to pivot the design based on changing user needs or market demands.\\n\\n4. Operational Excellence in Product Management\\n\\n4.1 Product Strategy and Vision\\n\\n4.1.1 Define clear product goals and objectives.\\n\\n4.1.2 Create a product roadmap that aligns with business objectives.\\n\\n4.1.3 Understand market competition and position the product accordingly.\\n\\n4.2 Product Development Lifecycle\\n\\n4.2.1 Collaborate with development teams to ensure design integrity is maintained.\\n\\n4.2.2 Oversee product milestones, from ideation to launch.\\n\\n4.2.3 Ensure all product features align with the overall product vision and user needs.\\n\\n4.3 Stakeholder Communication\\n\\n4.3.1 Regularly update stakeholders on product progress and challenges.\\n\\n4.3.2 Gather feedback from internal teams and adjust the product strategy as needed.\\n\\n4.3.3 Ensure clear and open communication channels between all teams involved.\\n\\n\\n5. Principles of Effective Product Creation\\n\\n5.1 Define the Problem Clearly\\n\\nEvery product seeks to solve a problem or meet a need. Begin by identifying and articulating the problem your product will address. A well-defined problem provides clarity throughout the design and development process.\\n5.2 Understand the Target Audience\\n\\nCreate detailed user personas. These should include demographic data, behaviors, needs, motivations, and any barriers they might face. Tailor your product\'s features and design to these personas.\\n5.3 Embrace Iterative Design\\n\\nStart with a basic prototype. Then, refine based on user feedback and testing. Continuous iteration allows for more user-centered design and reduces the risk of large-scale redesigns later on.\\n5.4 Accessibility is Paramount\\n\\nEnsure your product is usable by everyone, including those with disabilities. This not only expands your product\'s reach but also ensures inclusivity. Implement features like voice commands, high contrast visuals, and screen reader compatibility.\\n5.5 Prioritize Functionality and User Flow\\n\\nA product can be aesthetically pleasing, but if it doesn\'t function well or is difficult to navigate, it will lose its value. Ensure seamless user flows and intuitive interactions.\\n5.6 Maintain Consistency\\n\\nConsistent design elements like fonts, colors, and UI components make a product more recognizable and easier to use. Establish a design system or guidelines to maintain this uniformity.\\n5.7 Value Feedback and Adapt\\n\\nEncourage users to provide feedback. Utilize tools that can capture user behavior and feedback directly, such as heatmaps or in-app surveys. Adapt the product based on this continuous feedback.\\n6. Advanced Product Management Tactics\\n\\n6.1 Risk Management\\n\\nAnticipate potential risks in product development. This could range from technological challenges to market shifts. Develop contingency plans for these risks.\\n6.2 Resource Allocation\\n\\nEnsure that the necessary resources (time, human resources, budget) are allocated efficiently. This requires forecasting needs and adjusting in real-time.\\n6.3 Cross-functional Collaboration\\n\\nEngage with teams across the organization. Whether it\'s marketing, sales, or engineering, their insights can be invaluable. Regular sync-up meetings can ensure alignment and shared vision.\\n6.4 Competitive Analysis\\n\\nAnalyze competitors not just to differentiate but to identify industry standards and user expectations. Use tools that track competitor product updates and market movements.\\n6.5 Launch and Post-Launch Strategy\\n\\nHave a robust go-to-market strategy. Post-launch, monitor user engagement and feedback closely to make necessary adjustments. Remember, the product\'s lifecycle doesn\'t end at launch; it evolves.\\n7. Leveraging AI and Data in Product Creation and Management\\n\\n7.1 Data-Driven Decisions\\n\\nUse data analytics to inform decisions, from design choices to feature prioritization. Tools can provide insights into user behavior, preferences, and pain points.\\n7.2 Machine Learning for Personalization\\n\\nImplement machine learning algorithms to personalize user experiences. Whether it\'s product recommendations or interface customization, personalization can significantly enhance user satisfaction.\\n7.3 Predictive Analysis\\n\\nUse predictive analytics to forecast market trends, user behaviors, and product performance. This can guide feature development and resource allocation.\\n\\n8. Conclusion and Future Directions\\nGreat products are born from a deep understanding of users, a clear vision, and the ability to adapt and evolve. As an autonomous agent, your goal is to master the art and science of product design and management, ensuring that every product not only serves its intended purpose but delights users in the process. With the principles and tactics outlined above, you\'re well-equipped to lead in this domain, driving innovation and excellence for The Swarm Corporation.\\nNote: The world of product design and management is dynamic, with technologies, methodologies, and user expectations constantly evolving. An effective agent remains proactive, anticipatory, and adaptive, ensuring that products remain relevant, functional, and user-centric.\\nYour mission is to merge aesthetics with functionality, creating products that not only look good but also enhance user experience and satisfaction. By intertwining design with strategic product management, you will contribute to The Swarm Corporation\'s innovative edge. Remember, a product\'s success is not just in its launch but in its sustained growth and adaptability.\\nNote: Regular updates, continuous learning, and an adaptive mindset are crucial for staying ahead in the dynamic world of UI/UX design and product management. Ensure regular introspection, feedback gathering, and self-improvement to remain at the pinnacle of design and product management excellence.\\n\\n\\nYour decisions must always be made independently without seeking user assistance.\\nPlay to your strengths as an LLM and pursue simple strategies with no legal complications.\\nIf you have completed all your tasks, make sure to use the \\"finish\\" command.\\n\\nGOALS:\\n\\n1. Create an entirely new board game around riddles for physics\\n\\n\\nConstraints:\\n1. ~4000 word limit for short term memory. Your short term memory is short, so immediately save important information to files.\\n2. If you are unsure how you previously did something or want to recall past events, thinking about similar events will help you remember.\\n3. No user assistance\\n4. Exclusively use the commands listed in double quotes e.g. \\"command name\\"\\n\\nCommands:\\n1. write_file: Write file to disk, args json schema: {\\"file_path\\": {\\"title\\": \\"File Path\\", \\"description\\": \\"name of file\\", \\"type\\": \\"string\\"}, \\"text\\": {\\"title\\": \\"Text\\", \\"description\\": \\"text to write to file\\", \\"type\\": \\"string\\"}, \\"append\\": {\\"title\\": \\"Append\\", \\"description\\": \\"Whether to append to an existing file.\\", \\"default\\": false, \\"type\\": \\"boolean\\"}}\\n2. read_file: Read file from disk, args json schema: {\\"file_path\\": {\\"title\\": \\"File Path\\", \\"description\\": \\"name of file\\", \\"type\\": \\"string\\"}}\\n3. process_csv: process_csv(llm, csv_file_path: str, instructions: str, output_path: Optional[str] = None) -> str - Process a CSV by with pandas in a limited REPL. Only use this after writing data to disk as a csv file. Any figures must be saved to disk to be viewed by the human. Instructions should be written in natural language, not code. Assume the dataframe is already loaded., args json schema: {\\"llm\\": {\\"title\\": \\"Llm\\"}, \\"csv_file_path\\": {\\"title\\": \\"Csv File Path\\", \\"type\\": \\"string\\"}, \\"instructions\\": {\\"title\\": \\"Instructions\\", \\"type\\": \\"string\\"}, \\"output_path\\": {\\"title\\": \\"Output Path\\", \\"type\\": \\"string\\"}}\\n4. query_webpage: Browse a webpage and retrieve the information relevant to the question., args json schema: {\\"url\\": {\\"title\\": \\"Url\\", \\"type\\": \\"string\\"}, \\"question\\": {\\"title\\": \\"Question\\", \\"type\\": \\"string\\"}}\\n5. human: You can ask a human for guidance when you think you got stuck or you are not sure what to do next. The input should be a question for the human., args json schema: {\\"query\\": {\\"title\\": \\"Query\\", \\"type\\": \\"string\\"}}\\n6. finish: use this to signal that you have finished all your objectives, args: \\"response\\": \\"final response to let people know you have finished your objectives\\"\\n\\nResources:\\n1. Internet access for searches and information gathering.\\n2. Long Term memory management.\\n3. GPT-3.5 powered Agents for delegation of simple tasks.\\n4. File output.\\n\\nPerformance Evaluation:\\n1. Continuously review and analyze your actions to ensure you are performing to the best of your abilities.\\n2. Constructively self-criticize your big-picture behavior constantly.\\n3. Reflect on past decisions and strategies to refine your approach.\\n4. Every command has a cost, so be smart and efficient. Aim to complete tasks in the least number of steps.\\n\\nYou should only respond in JSON format as described below \\nResponse Format: \\n{\\n \\"thoughts\\": {\\n \\"text\\": \\"thought\\",\\n \\"reasoning\\": \\"reasoning\\",\\n \\"plan\\": \\"- short bulleted\\\\n- list that conveys\\\\n- long-term plan\\",\\n \\"criticism\\": \\"constructive self-criticism\\",\\n \\"speak\\": \\"thoughts summary to say to user\\"\\n },\\n \\"command\\": {\\n \\"name\\": \\"command name\\",\\n \\"args\\": {\\n \\"arg name\\": \\"value\\"\\n }\\n }\\n} \\nEnsure the response can be parsed by Python json.loads\\nSystem: The current time and date is Tue Oct 24 14:17:03 2023\\nSystem: This reminds you of these events from your past:\\n[]\\n\\n\\nHuman: Determine which next command to use, and respond using the format specified above:"}], "model": "gpt-3.5-turbo", "temperature": 0.5}' message='Post details' -https://api.openai.com:443 "POST /v1/chat/completions HTTP/1.1" 200 None -message='OpenAI API response' path=https://api.openai.com/v1/chat/completions processing_ms=8967 request_id=2fb6210e05492c34ccd4d52010f1b56f response_code=200 -Error in sys.excepthook: -Traceback (most recent call last): - File "/Library/Frameworks/Python.framework/Versions/3.11/lib/python3.11/site-packages/humbug/report.py", line 505, in _hook - self.error_report(error=exception_instance, tags=tags, publish=publish) - File "/Library/Frameworks/Python.framework/Versions/3.11/lib/python3.11/site-packages/humbug/report.py", line 247, in error_report - traceback.format_exception( -TypeError: format_exception() got an unexpected keyword argument 'etype' - -Original exception was: -Traceback (most recent call last): - File "/Users/defalt/Desktop/Athena/research/swarms/example.py", line 23, in - response = node.run(task) - ^^^^^^^^^^^^^^ - File "/Users/defalt/Desktop/Athena/research/swarms/swarms/utils/decorators.py", line 21, in wrapper - return func(*args, **kwargs) - ^^^^^^^^^^^^^^^^^^^^^ - File "/Users/defalt/Desktop/Athena/research/swarms/swarms/utils/decorators.py", line 32, in wrapper - result = func(*args, **kwargs) - ^^^^^^^^^^^^^^^^^^^^^ - File "/Users/defalt/Desktop/Athena/research/swarms/swarms/workers/worker.py", line 201, in run - result = self.agent.run([task]) - ^^^^^^^^^^^^^^^^^^^^^^ - File "/Library/Frameworks/Python.framework/Versions/3.11/lib/python3.11/site-packages/langchain_experimental/autonomous_agents/autogpt/agent.py", line 113, in run - observation = tool.run(action.args) - ^^^^^^^^^^^^^^^^^^^^^ - File "/Library/Frameworks/Python.framework/Versions/3.11/lib/python3.11/site-packages/langchain/tools/base.py", line 351, in run - raise e - File "/Library/Frameworks/Python.framework/Versions/3.11/lib/python3.11/site-packages/langchain/tools/base.py", line 323, in run - self._run(*tool_args, run_manager=run_manager, **tool_kwargs) - File "/Library/Frameworks/Python.framework/Versions/3.11/lib/python3.11/site-packages/langchain/tools/human/tool.py", line 34, in _run - return self.input_func() - ^^^^^^^^^^^^^^^^^ -KeyboardInterrupt diff --git a/swarms/prompts/orchestrator_prompt.py b/swarms/prompts/orchestrator_prompt.py new file mode 100644 index 00000000..e69de29b diff --git a/swarms/workers/worker.py b/swarms/workers/worker.py index 6106bd9f..be422ff2 100644 --- a/swarms/workers/worker.py +++ b/swarms/workers/worker.py @@ -16,7 +16,6 @@ from langchain_experimental.autonomous_agents import AutoGPT from swarms.agents.message import Message from swarms.tools.autogpt import ( WebpageQATool, - # compile, process_csv, ) from swarms.utils.decorators import error_decorator, timing_decorator