### Install Frontend Dependencies and Run Dev Server Source: https://github.com/arc53/docsgpt/blob/main/AGENTS.md Navigates to the frontend directory, installs development dependencies, and starts the frontend development server. ```bash cd frontend npm install --include=dev npm run dev ``` -------------------------------- ### Run macOS/Linux Setup Script Source: https://github.com/arc53/docsgpt/blob/main/README.md Execute the setup script on macOS or Linux systems. This script automates the configuration and installation process. ```bash ./setup.sh ``` -------------------------------- ### Start Local Development Server Source: https://github.com/arc53/docsgpt/blob/main/docs/README.md Start the local development server to view the documentation in your browser. Access it at http://localhost:3000. ```bash yarn dev ``` -------------------------------- ### Run Docker Compose for PostgreSQL Setup Source: https://github.com/arc53/docsgpt/blob/main/docs/content/Deploying/Postgres-Migration.mdx Use this command to start the application with the bundled PostgreSQL service using Docker Compose. Assumes Postgres 13+ and default environment variables for auto-migration and database creation. ```bash cd deployment && docker compose up ``` -------------------------------- ### Install Frontend Dependencies Source: https://github.com/arc53/docsgpt/blob/main/docs/content/Deploying/Development-Environment.mdx Install all frontend dependencies, including development dependencies, by running this command in the 'frontend' directory. It reads the package.json file. ```bash npm install --include=dev ``` -------------------------------- ### Example .env File Structure Source: https://github.com/arc53/docsgpt/blob/main/docs/content/Deploying/DocsGPT-Settings.mdx This is an example of how to structure your .env file to configure basic DocsGPT settings. Place this file in the root directory of your project. ```dotenv LLM_PROVIDER=openai API_KEY=YOUR_OPENAI_API_KEY LLM_NAME=gpt-4o ``` -------------------------------- ### Install Docs Site Dependencies Source: https://github.com/arc53/docsgpt/blob/main/AGENTS.md Navigates to the docs directory and installs the necessary npm packages for the documentation site. ```bash cd docs npm install ``` -------------------------------- ### Install Docker and Docker Compose Source: https://github.com/arc53/docsgpt/blob/main/docs/content/Deploying/Amazon-Lightsail.mdx Install Docker and Docker Compose on your instance. These are required for running the containerized DocsGPT application. ```bash sudo apt install docker.io ``` ```bash sudo apt install docker-compose ``` -------------------------------- ### Install Backend Dependencies Source: https://github.com/arc53/docsgpt/blob/main/AGENTS.md Installs backend Python dependencies from the requirements file. Use this after activating the virtual environment. ```bash uv pip install -r application/requirements.txt # or: pip install -r application/requirements.txt ``` -------------------------------- ### Start the Chatwoot Extension Source: https://github.com/arc53/docsgpt/blob/main/docs/content/Extensions/Chatwoot-extension.mdx Use this command to run the Chatwoot extension after configuring your environment variables. This command assumes you have Flask installed and configured. ```bash flask run ``` -------------------------------- ### Install Project Dependencies Source: https://github.com/arc53/docsgpt/blob/main/docs/README.md Install all the necessary project dependencies using Yarn. ```bash yarn install ``` -------------------------------- ### Install Backend Dependencies Source: https://github.com/arc53/docsgpt/blob/main/docs/content/Deploying/Development-Environment.mdx Installs all necessary Python packages for the DocsGPT backend from the requirements file. Run this from the root of your DocsGPT repository. ```bash pip install -r application/requirements.txt ``` -------------------------------- ### Install DocsGPT Daemon as a Service Source: https://github.com/arc53/docsgpt/blob/main/docs/content/Tools/remote-device.mdx Install the DocsGPT daemon as a system service to ensure it runs across reboots. The command varies slightly by operating system. Use --system and --user flags for specific system-wide or user-level installations. ```bash # Linux (systemd). As root this installs a system service; otherwise a user service. docsgpt-cli host install-service # macOS (launchd). The default is a per-user LaunchAgent that starts on login. docsgpt-cli host install-service # Always-on machine that starts at boot (Linux example): sudo docsgpt-cli host install-service --system --user $USER ``` -------------------------------- ### Install Global Packages (Husky and Vite) Source: https://github.com/arc53/docsgpt/blob/main/docs/content/Deploying/Development-Environment.mdx Install husky and vite globally using npm. This step is optional if you already have these packages installed globally or prefer local installations. ```bash npm install husky -g ``` ```bash npm install vite -g ``` -------------------------------- ### Install Python Dependencies Source: https://github.com/arc53/docsgpt/wiki/Hosting-the-app Install all the Python dependencies required to run the DocsGPT application. This command should be executed from within the application directory. ```bash pip3 install -r requirements.txt ``` -------------------------------- ### Example Rendered System Prompt Source: https://github.com/arc53/docsgpt/blob/main/docs/content/Guides/Customising-prompts.mdx An example of the detailed output you can expect in the logs when the log level is set to INFO, showing the rendered system prompt. ```text INFO - Rendered system prompt for agent (length: 1234 chars): ================================================================================ You are a helpful assistant for Acme Corp. Current date: 2025-10-30 Request ID: req_abc123 Documents: Technical documentation about... ================================================================================ ``` -------------------------------- ### Install DocsGPT Package (npm) Source: https://github.com/arc53/docsgpt/blob/main/docs/content/Extensions/search-widget.mdx Install the docsgpt package using npm for React projects. ```bash npm install docsgpt ``` -------------------------------- ### Install JS Dependencies Source: https://github.com/arc53/docsgpt/blob/main/tests/e2e/README.md Run this command to install JavaScript dependencies for the E2E tests. ```bash npm install ``` -------------------------------- ### Run Windows PowerShell Setup Script Source: https://github.com/arc53/docsgpt/blob/main/README.md Execute the setup script on Windows using PowerShell. This script handles the necessary configurations for Windows environments. ```powershell PowerShell -ExecutionPolicy Bypass -File .\setup.ps1 ``` -------------------------------- ### Install Yarn Package Manager Source: https://github.com/arc53/docsgpt/blob/main/docs/README.md Install Yarn, a package manager for JavaScript, globally using npm. ```bash npm install --global yarn ``` -------------------------------- ### Navigate to Frontend Directory Source: https://github.com/arc53/docsgpt/blob/main/docs/content/Deploying/Development-Environment.mdx Change your current directory to the 'frontend' folder within the DocsGPT repository. This is the first step before installing dependencies or running the application. ```bash cd frontend ``` -------------------------------- ### Technical Documentation Assistant Prompt Example Source: https://github.com/arc53/docsgpt/blob/main/docs/content/Guides/Customising-prompts.mdx A Jinja template for a technical documentation assistant, specifying the target language and framework, and requesting code examples and relevant links. ```jinja You are a technical documentation expert. **Available Documentation ({{ source.count }} documents):** {{ source.content }} **Requirements:** - Provide code examples in {{ passthrough.language }} - Focus on {{ passthrough.framework }} best practices - Include relevant links when possible ``` -------------------------------- ### Access DocsGPT Application Directory Source: https://github.com/arc53/docsgpt/wiki/Hosting-the-app Navigate into the application directory within the cloned DocsGPT repository. This is necessary before installing dependencies. ```bash cd DocsGPT/application ``` -------------------------------- ### Check Node.js and npm Versions Source: https://github.com/arc53/docsgpt/blob/main/docs/README.md Verify that Node.js and npm are installed and check their versions. ```bash node --version npm --version ``` -------------------------------- ### Prompt with Clear Instructions and Documents Source: https://github.com/arc53/docsgpt/blob/main/docs/content/Guides/Customising-prompts.mdx An example prompt that sets the AI's role and provides clear guidelines, including referencing specific documents. ```jinja You are a technical support assistant. **Guidelines:** 1. Always reference the documents below 2. Provide step-by-step instructions 3. Include code examples when relevant **Reference Documents:** {{ source.content }} ``` -------------------------------- ### Legacy Prompt Format Example Source: https://github.com/arc53/docsgpt/blob/main/docs/content/Guides/Customising-prompts.mdx Shows the older `{summaries}` format for backward compatibility, which automatically substitutes with document content. ```markdown You are a helpful assistant. Documents: {summaries} ``` -------------------------------- ### Start DocsGPT Application with Tmux Source: https://github.com/arc53/docsgpt/wiki/Hosting-the-app Start a new tmux session to run the Flask development server. This allows the application to continue running in the background after disconnecting from SSH. ```bash tmux new ``` -------------------------------- ### Trigger Agent Task via GET (Query Parameters) Source: https://github.com/arc53/docsgpt/blob/main/docs/content/Agents/webhooks.mdx Initiate a task by sending a GET request to the webhook URL, passing the payload as query parameters. This is useful for systems with limited request capabilities. ```bash curl "http://localhost:7091/api/webhooks/agents/your_webhook_token?question=Your+message+to+agent" ``` -------------------------------- ### Build and Start Development Docker Containers Source: https://github.com/arc53/docsgpt/blob/main/docs/content/Deploying/Development-Environment.mdx Builds the Docker images and starts the Postgres and Redis containers in detached mode using the development Docker Compose file. The backend will automatically apply database migrations on first boot. ```bash docker compose -f deployment/docker-compose-dev.yaml build docker compose -f deployment/docker-compose-dev.yaml up -d ``` -------------------------------- ### Advanced Prompt with All Namespaces Source: https://github.com/arc53/docsgpt/blob/main/docs/content/Guides/Customising-prompts.mdx An example of an advanced prompt utilizing system, passthrough, source, and tools namespaces for comprehensive context. ```jinja You are an AI assistant for {{ passthrough.company }}. **System Info:** - Date: {{ system.date }} - Request ID: {{ system.request_id }} **User Context:** - User: {{ passthrough.user_name }} - Role: {{ passthrough.role }} **Available Documents ({{ source.count }}):** {{ source.content }} **Memory Context:** {% if tools.memory.available %} {{ tools.memory.root }} {% else %} No saved context available. {% endif %} Please provide detailed, accurate answers based on the documents above. ``` -------------------------------- ### Run DocsGPT Daemon in Foreground Source: https://github.com/arc53/docsgpt/blob/main/docs/content/Tools/remote-device.mdx Start the DocsGPT daemon in the foreground. Press Ctrl-C to stop it. This is useful for testing or temporary use. ```bash docsgpt-cli host ``` -------------------------------- ### Example OPENAI_BASE_URL for Local Inference Engines Source: https://github.com/arc53/docsgpt/blob/main/docs/content/Models/local-inference.mdx These are example OPENAI_BASE_URL values for various local inference engines that communicate via the OpenAI API format. If running DocsGPT in Docker, replace 'localhost' with 'host.docker.internal'. ```text http://localhost:8000/v1 ``` ```text http://localhost:11434/v1 ``` ```text http://localhost:8080/v1 ``` ```text http://localhost:30000/v1 ``` ```text http://localhost:8000/v1 ``` ```text http://localhost:2242/v1 ``` ```text http://localhost:8997/v1 ``` ```text http://localhost:23333/v1 ``` -------------------------------- ### Launch DocsGPT with Docker Compose Source: https://github.com/arc53/docsgpt/blob/main/docs/content/Deploying/Docker-Deploying.mdx Start DocsGPT using Docker Compose in detached mode. Ensure you are in the root directory of the DocsGPT repository. ```bash docker compose -f deployment/docker-compose.yaml up -d ``` -------------------------------- ### Configure DocsGPT for Public API Source: https://github.com/arc53/docsgpt/blob/main/docs/content/Deploying/Docker-Deploying.mdx Create a .env file in the root of your DocsGPT repository and add these configurations to use the public API endpoint. This requires no local LLM setup. ```env LLM_PROVIDER=docsgpt VITE_API_STREAMING=true ``` -------------------------------- ### Prompt with Descriptive Context Source: https://github.com/arc53/docsgpt/blob/main/docs/content/Guides/Customising-prompts.mdx Example of a prompt that includes both retrieved documents and user-specific context from passthrough variables. ```jinja **Retrieved Documents:** {{ source.content }} **User Query Context:** - Company: {{ passthrough.company }} - Department: {{ passthrough.department }} ``` -------------------------------- ### Run Backend API with Uvicorn Source: https://github.com/arc53/docsgpt/blob/main/AGENTS.md Starts the ASGI application using uvicorn for local development. This command enables hot-reloading and serves the whole app, matching production. ```bash uvicorn application.asgi:asgi_app --host 0.0.0.0 --port 7091 --reload ``` -------------------------------- ### Run DocsGPT Application Source: https://github.com/arc53/docsgpt/blob/main/docs/content/Deploying/Amazon-Lightsail.mdx Start the DocsGPT application using Docker Compose in detached mode. This command will download dependencies and build the application. ```bash sudo docker compose -f deployment/docker-compose.yaml up -d ``` -------------------------------- ### Bake Postgres Template DB Source: https://github.com/arc53/docsgpt/blob/main/tests/e2e/README.md Creates a template PostgreSQL database for E2E testing. This is an idempotent, one-time setup command. ```bash ../../scripts/e2e/bake_template.sh ``` -------------------------------- ### Docker Host Access Example Source: https://github.com/arc53/docsgpt/blob/main/docs/content/Models/local-inference.mdx When running DocsGPT within Docker and connecting to a local inference engine on the host machine, use 'host.docker.internal' instead of 'localhost' in the OPENAI_BASE_URL. ```text http://host.docker.internal:11434/v1 ``` -------------------------------- ### Run the Frontend Development Server Source: https://github.com/arc53/docsgpt/blob/main/docs/content/Deploying/Development-Environment.mdx Start the Vite development server to run the frontend application locally. The terminal will display the exact URL, typically http://localhost:5173/, where the application is accessible. ```bash npm run dev ``` -------------------------------- ### API Tool JSON Response Example Source: https://github.com/arc53/docsgpt/blob/main/docs/content/Tools/api-tool.mdx This is an example of a JSON response from an external API after the API Tool executes an HTTP GET request. The LLM uses this data to formulate its answer. ```json { "phone": "+14155555555", "valid": true, "format": { "international": "+1 415-555-5555", "national": "(415) 555-5555" }, "country": { "code": "US", "name": "United States", "prefix": "+1" }, "location": "California", "type": "Landline" } ``` -------------------------------- ### Build Documentation Site Source: https://github.com/arc53/docsgpt/blob/main/AGENTS.md Navigates to the docs directory and builds the documentation site. ```bash cd docs && npm run build ``` -------------------------------- ### Basic HTML Embedding for DocsGPT Widget Source: https://github.com/arc53/docsgpt/blob/main/extensions/react-widget/README.md Embed the DocsGPT widget in an HTML page by including the script and calling the renderDocsGPTWidget function. This example shows the minimal setup. ```html