From 81d12c40b6d8420f2712a2f387a0f5701bdb92f1 Mon Sep 17 00:00:00 2001 From: Your Name Date: Tue, 19 Nov 2024 13:24:13 -0800 Subject: [PATCH] [ENV CONFIG DOCS] --- docs/mkdocs.yml | 1 + docs/swarms/install/workspace_manager.md | 142 +++++++++++++++++++++++ 2 files changed, 143 insertions(+) create mode 100644 docs/swarms/install/workspace_manager.md diff --git a/docs/mkdocs.yml b/docs/mkdocs.yml index 4873ad7f..7af8c09c 100644 --- a/docs/mkdocs.yml +++ b/docs/mkdocs.yml @@ -138,6 +138,7 @@ nav: - Swarm Ecosystem: "swarms/concept/swarm_ecosystem.md" - Onboarding: - Installation: "swarms/install/install.md" + - Environment Configuration: "swarms/install/workspace_manager.md" - Quickstart: "swarms/install/quickstart.md" - Swarms CLI: "swarms/cli/main.md" # - Swarms + Docker: diff --git a/docs/swarms/install/workspace_manager.md b/docs/swarms/install/workspace_manager.md new file mode 100644 index 00000000..b0c0ad25 --- /dev/null +++ b/docs/swarms/install/workspace_manager.md @@ -0,0 +1,142 @@ +# Swarms Framework Environment Configuration + +This guide details the environment variables used in the Swarms framework for configuration and customization of your agent-based applications. + +## Configuration Setup + +Create a `.env` file in your project's root directory to configure the Swarms framework. This file will contain all necessary environment variables for customizing your agent's behavior, logging, and analytics. + +## Environment Variables + +### Core Variables + +#### `WORKSPACE_DIR` +- **Purpose**: Defines the directory where all agent states and execution logs are stored +- **Type**: String (path) +- **Default**: `./workspace` +- **Example**: +```bash +WORKSPACE_DIR=/path/to/your/workspace +``` +- **Usage**: + - Stores JSON files containing agent states + - Maintains execution history + - Keeps track of agent interactions + - Preserves conversation logs + +### Telemetry Configuration + +#### `USE_TELEMETRY` +- **Purpose**: Controls whether telemetry data is collected +- **Type**: Boolean +- **Default**: `false` +- **Example**: +```bash +USE_TELEMETRY=true +``` +- **Data Collected**: + - Agent performance metrics + - Execution time statistics + - Memory usage + - Error rates + - System health indicators + +### Analytics Integration + +#### `SWARMS_API_KEY` +- **Purpose**: Authentication key for the Swarms Analytics Suite +- **Type**: String +- **Required**: Yes, for analytics features +- **Example**: +```bash +SWARMS_API_KEY=your_api_key_here +``` +- **Features**: + - Real-time agent execution tracking + - Usage analytics + - Performance monitoring + - Cost tracking + - Custom metrics + +## Getting Started + +1. Create a new `.env` file: +```bash +touch .env +``` + +2. Add your configuration: +```bash +# Basic configuration +WORKSPACE_DIR=./my_workspace + +# Enable telemetry +USE_TELEMETRY=true + +# Add your Swarms API key +SWARMS_API_KEY=your_api_key_here +``` + +3. Obtain your API key: + - Visit [swarms.ai dashboard](https://swarms.ai) + - Create an account or log in + - Navigate to the API section + - Generate your unique API key + +## Best Practices + +1. **Security**: + - Never commit your `.env` file to version control + - Add `.env` to your `.gitignore` file + - Keep your API keys secure and rotate them periodically + +2. **Workspace Organization**: + - Use descriptive workspace directory names + - Implement regular cleanup of old logs + - Monitor workspace size to prevent disk space issues + +3. **Telemetry Management**: + - Enable telemetry in development for debugging + - Consider privacy implications in production + - Review collected data periodically + +## Examples + +### Basic Development Setup +```bash +WORKSPACE_DIR=./dev_workspace +USE_TELEMETRY=true +SWARMS_API_KEY=sk_test_xxxxxxxxxxxx +``` + +### Production Setup +```bash +WORKSPACE_DIR=/var/log/swarms/prod_workspace +USE_TELEMETRY=true +SWARMS_API_KEY=sk_prod_xxxxxxxxxxxx +``` + +## Troubleshooting + +Common issues and solutions: + +1. **Workspace Access Issues**: + - Ensure proper file permissions + - Verify the directory exists + - Check disk space availability + +2. **API Key Problems**: + - Confirm key is properly formatted + - Verify key hasn't expired + - Check for proper environment variable loading + +3. **Telemetry Issues**: + - Confirm network connectivity + - Verify firewall settings + - Check for proper boolean values + +## Additional Resources + +- [Swarms Framework Documentation](https://github.com/kyegomez/swarms) +- [Swarms Analytics Dashboard](https://swarms.ai) +- [API Reference](https://swarms.ai/docs/api) \ No newline at end of file