### Install and Run Agent with Go Source: https://github.com/inference-gateway/documentation-agent/blob/main/AGENTS.md Install dependencies and run the agent using Go commands. Alternatively, use the 'task run' command if Task is configured. ```bash # Install dependencies go mod download # Run the agent go run main.go # Or use Task task run ``` -------------------------------- ### Install Documentation-Agent CLI Source: https://github.com/inference-gateway/documentation-agent/blob/main/README.md Add the documentation-agent to your Inference Gateway CLI. This command registers the agent and starts it. ```bash infer agents add documentation-agent http://localhost:8080 \ --oci ghcr.io/inference-gateway/documentation-agent:latest \ --run ``` -------------------------------- ### Start Agent Service Individually Source: https://github.com/inference-gateway/documentation-agent/blob/main/example/README.md Start only the Documentation Agent service using Docker Compose. This is useful for testing or debugging the agent in isolation. ```bash docker compose up agent ``` -------------------------------- ### Copy Environment Files Source: https://github.com/inference-gateway/documentation-agent/blob/main/example/README.md Copy example environment files to your local directory for configuration. These files are essential for setting up API keys and service parameters. ```bash cp .env.agent.example .env.agent cp .env.gateway.example .env.gateway ``` -------------------------------- ### Start Services with Docker Compose Source: https://github.com/inference-gateway/documentation-agent/blob/main/example/README.md Launch all required services, including the Documentation Agent and Inference Gateway, using Docker Compose. This command builds the images if necessary and starts the containers. ```bash docker compose up --build ``` -------------------------------- ### Start Inference Gateway Service Individually Source: https://github.com/inference-gateway/documentation-agent/blob/main/example/README.md Start only the Inference Gateway service using Docker Compose. This allows for focused testing or debugging of the gateway component. ```bash docker compose up inference-gateway ``` -------------------------------- ### Basic Documentation Query Source: https://github.com/inference-gateway/documentation-agent/blob/main/example/README.md Perform a basic documentation search query using the A2A debugger. This example demonstrates how to ask general questions about libraries or frameworks. ```bash docker compose run --rm a2a-debugger tasks submit-streaming "How do I use React hooks?" ``` -------------------------------- ### Get Library Docs Tool Source: https://github.com/inference-gateway/documentation-agent/blob/main/AGENTS.md Fetches up-to-date documentation for a library using its Context7-compatible library ID. ```APIDOC ## Tool: get_library_docs ### Description Fetches up-to-date documentation for a library using Context7-compatible library ID ### Tags docs, libraries ### Input Schema Defined in agent configuration ### Output Schema Defined in agent configuration ``` -------------------------------- ### Get Agent Information via Curl Source: https://github.com/inference-gateway/documentation-agent/blob/main/AGENTS.md Retrieve agent metadata and capabilities by sending a GET request to the agent's well-known agent card endpoint. ```bash # Get agent information curl http://localhost:8080/.well-known/agent-card.json ``` -------------------------------- ### Get Specific Task Details via Debugger Source: https://github.com/inference-gateway/documentation-agent/blob/main/README.md Retrieve detailed information about a specific task using its ID with the A2A Debugger. Replace `` with the actual task identifier. ```bash docker run --rm -it --network host ghcr.io/inference-gateway/a2a-debugger:latest --server-url http://localhost:8080 tasks get ``` -------------------------------- ### Build and Run Agent with Docker Source: https://github.com/inference-gateway/documentation-agent/blob/main/AGENTS.md Build the Docker image for the documentation-agent and run it as a container, mapping the agent's port to the host. ```bash # Build image docker build -t documentation-agent . # Run container docker run -p 8080:8080 documentation-agent ``` -------------------------------- ### Run Documentation-Agent Source: https://github.com/inference-gateway/documentation-agent/blob/main/README.md Instructions for running the agent locally using Go or Docker. Ensure the agent is accessible on port 8080. ```bash # Run the agent go run . # Or with Docker docker build -t documentation-agent . docker run -p 8080:8080 documentation-agent ``` -------------------------------- ### Build Docker Image with Custom Version Source: https://github.com/inference-gateway/documentation-agent/blob/main/README.md Build the Docker image for the documentation agent with custom version information, agent name, and description using build arguments. ```bash # Build with custom version information docker build \ --build-arg VERSION=1.2.3 \ --build-arg AGENT_NAME="My Custom Agent" \ --build-arg AGENT_DESCRIPTION="Custom agent description" \ -t documentation-agent:1.2.3 . ``` -------------------------------- ### Project Structure Overview Source: https://github.com/inference-gateway/documentation-agent/blob/main/AGENTS.md Illustrates the directory layout of the inference gateway agent project, highlighting the purpose of main files and directories like server entry point, tools, skills, and configuration. ```bash . ├── main.go # Server entry point ├── tools/ # Function-call tools │ └── read.go # Read a file from disk. Returns its contents, optionally sliced by line offset/limit. Use this to load SKILL.md bodies on demand. │ └── resolve_library_id.go # Resolves library name to Context7-compatible library ID and returns matching libraries │ └── get_library_docs.go # Fetches up-to-date documentation for a library using Context7-compatible library ID ├── skills/ # Skill directories (SKILL.md + optional assets) │ └── library-documentation-lookup/# Use this when you need up-to-date documentation for a third-party library or framework before writing code against it. First resolves the library name to a Context7-compatible ID via resolve_library_id when the caller does not already know it (format '/org/project' or '/org/project/version'), then fetches focused, topic-scoped documentation via get_library_docs. Good for filling in unknowns about specific APIs, hooks, configuration options, or version-specific behavior. │ └── SKILL.md # Playbook prepended to the system prompt ├── .well-known/ # Agent configuration │ └── agent-card.json # Agent metadata ├── go.mod # Go module definition └── README.md # Project documentation ``` -------------------------------- ### Build Docker Image with Default Version Source: https://github.com/inference-gateway/documentation-agent/blob/main/README.md Build the Docker image for the documentation agent using default version information specified in the ADL. ```bash # Build with default values from ADL docker build -t documentation-agent . ``` -------------------------------- ### List Available Tools Source: https://github.com/inference-gateway/documentation-agent/blob/main/example/README.md View all the tools and functionalities exposed by the Documentation Agent via the A2A debugger. This helps in understanding the agent's capabilities. ```bash docker compose run --rm a2a-debugger tools list ``` -------------------------------- ### Development Commands for documentation-agent Source: https://github.com/inference-gateway/documentation-agent/blob/main/CLAUDE.md Common tasks for managing the documentation-agent project, including code generation, running the server, testing, linting, formatting, building, and cleaning artifacts. ```bash # Generate/regenerate code from ADL specification task generate # Run the agent in development mode (debug enabled, port 8080) task run # Run tests (note: no tests currently exist) task test task test:cover # with coverage # Code quality task lint # Run golangci-lint task fmt # Format code with go fmt # Build task build # Creates bin/documentation-agent task docker:build # Build Docker image # Clean build artifacts task clean ``` -------------------------------- ### Build Agent Docker Image Source: https://github.com/inference-gateway/documentation-agent/blob/main/example/README.md Build only the Docker image for the Documentation Agent. This is useful for development when only the agent needs to be updated. ```bash docker compose build agent ``` -------------------------------- ### Testing Commands for Inference Gateway Agent Source: https://github.com/inference-gateway/documentation-agent/blob/main/AGENTS.md Provides commands to run tests for the agent, including running all tests and running tests with coverage reporting. ```bash # Run tests task test go test ./... ``` ```bash # Run with coverage task test:coverage ``` -------------------------------- ### Run A2A Debugger Help Command Source: https://github.com/inference-gateway/documentation-agent/blob/main/example/README.md Execute the help command for the A2A debugger to see available options. ```bash docker compose run --rm a2a-debugger --help ``` -------------------------------- ### Testing Individual Components with Go and A2A Debugger Source: https://github.com/inference-gateway/documentation-agent/blob/main/CLAUDE.md Commands for running specific Go test files and debugging the agent using the A2A Debugger. Ensure tests are added before using the `go test` command. ```bash # Run specific test file (when tests are added) go test -v ./path/to/package -run TestFunctionName # Debug with A2A Debugger docker run --rm -it --network host ghcr.io/inference-gateway/a2a-debugger:latest \ --server-url http://localhost:8080 tasks submit "Your query" ``` -------------------------------- ### Configure Direct OpenAI Connection Source: https://github.com/inference-gateway/documentation-agent/blob/main/example/README.md Modify the agent's environment variables to connect directly to an OpenAI-compatible API, bypassing the Inference Gateway. This requires updating the base URL, provider, and model. ```bash # Example: Direct OpenAI connection A2A_AGENT_CLIENT_BASE_URL=https://api.openai.com/v1 A2A_AGENT_CLIENT_PROVIDER=openai A2A_AGENT_CLIENT_MODEL=gpt-4 ``` -------------------------------- ### Development Tasks for Documentation Agent Source: https://github.com/inference-gateway/documentation-agent/blob/main/README.md Common development tasks for the Documentation Agent, including code generation, testing, building, linting, and formatting. ```bash # Generate code from ADL task generate ``` ```bash # Run tests task test ``` ```bash # Build the application task build ``` ```bash # Run linter task lint ``` ```bash # Format code task fmt ``` -------------------------------- ### Submit Streaming Task with A2A Debugger Source: https://github.com/inference-gateway/documentation-agent/blob/main/example/README.md Submit a streaming task to the Documentation Agent using the A2A debugger CLI. This is useful for interactive queries where results are received incrementally. ```bash docker compose run --rm a2a-debugger tasks submit-streaming "What's the latest version of NextJS?" ``` -------------------------------- ### Read File Tool Source: https://github.com/inference-gateway/documentation-agent/blob/main/AGENTS.md Reads a file from disk, optionally sliced by line offset/limit. ```APIDOC ## Tool: Read (built-in) ### Description Read a file from disk. Returns its contents, optionally sliced by line offset/limit. Use this to load SKILL.md bodies on demand. ### Parameters - **file_path** (string) - Required - The path to the file. - **offset** (integer) - Optional - The starting line number. - **limit** (integer) - Optional - The maximum number of lines to return. ``` -------------------------------- ### List Tasks on A2A Agent via Debugger Source: https://github.com/inference-gateway/documentation-agent/blob/main/README.md Use the A2A Debugger to list all tasks currently managed by your agent. This is useful for monitoring and tracking task status. ```bash docker run --rm -it --network host ghcr.io/inference-gateway/a2a-debugger:latest --server-url http://localhost:8080 tasks list ``` -------------------------------- ### Submit a Task to A2A Agent via Debugger Source: https://github.com/inference-gateway/documentation-agent/blob/main/README.md Use the A2A Debugger to submit a task to your agent. Ensure the agent is running and accessible at the specified server URL. ```bash docker run --rm -it --network host ghcr.io/inference-gateway/a2a-debugger:latest --server-url http://localhost:8080 tasks submit "What are your skills?" ``` -------------------------------- ### Agent Metadata and Capabilities Source: https://github.com/inference-gateway/documentation-agent/blob/main/AGENTS.md Retrieve metadata and capabilities of the agent. ```APIDOC ## GET /.well-known/agent-card.json ### Description Agent metadata and capabilities ### Method GET ### Endpoint /.well-known/agent-card.json ``` -------------------------------- ### Library-Specific Search Source: https://github.com/inference-gateway/documentation-agent/blob/main/example/README.md Execute a targeted search within the documentation of a specific library using the A2A debugger. This allows for precise information retrieval. ```bash docker compose run --rm a2a-debugger tasks submit-streaming "Search Vue.js documentation for composition API" ``` -------------------------------- ### Build Docker Images with No Cache Source: https://github.com/inference-gateway/documentation-agent/blob/main/example/README.md Build Docker images without using the cache. This ensures that all layers are rebuilt, which can be helpful for troubleshooting build issues. ```bash docker compose build --no-cache ``` -------------------------------- ### Submit Non-Streaming Task Source: https://github.com/inference-gateway/documentation-agent/blob/main/example/README.md Submit a non-streaming task to the Documentation Agent. This is suitable for queries where the entire response is expected at once. ```bash docker compose run --rm a2a-debugger tasks submit "What is TypeScript?" ``` -------------------------------- ### Stop All Docker Compose Services Source: https://github.com/inference-gateway/documentation-agent/blob/main/example/README.md Use this command to gracefully stop all services defined in your Docker Compose file. ```bash docker compose down ``` -------------------------------- ### Resolve Library ID Tool Source: https://github.com/inference-gateway/documentation-agent/blob/main/AGENTS.md Resolves a library name to its Context7-compatible library ID. ```APIDOC ## Tool: resolve_library_id ### Description Resolves library name to Context7-compatible library ID and returns matching libraries. ### Tags docs, libraries ### Input Schema Defined in agent configuration ### Output Schema Defined in agent configuration ``` -------------------------------- ### Stop Docker Compose Services and Remove Volumes Source: https://github.com/inference-gateway/documentation-agent/blob/main/example/README.md This command stops all services and removes associated Docker volumes, ensuring a clean state. ```bash docker compose down -v ``` -------------------------------- ### Health Check Source: https://github.com/inference-gateway/documentation-agent/blob/main/AGENTS.md Check the health status of the agent. ```APIDOC ## GET /health ### Description Health check endpoint ### Method GET ### Endpoint /health ``` -------------------------------- ### A2A Operations Source: https://github.com/inference-gateway/documentation-agent/blob/main/AGENTS.md Perform A2A operations including skill execution and streaming. ```APIDOC ## POST /a2a ### Description JSON-RPC endpoint for all A2A operations (skill execution, streaming, etc.) ### Method POST ### Endpoint /a2a ### Request Body - **method** (string) - Required - The A2A method to call. - **params** (object) - Optional - Parameters for the A2A method. ### Response #### Success Response (200) - **result** (any) - The result of the A2A operation. - **error** (object) - An error object if the operation failed. ``` === COMPLETE CONTENT === This response contains all available snippets from this library. No additional content exists. Do not make further requests.