{"id":30587335,"url":"https://github.com/deepset-ai/dap-github-agent-template","last_synced_at":"2026-06-21T18:32:04.228Z","repository":{"id":289495158,"uuid":"970647175","full_name":"deepset-ai/dap-github-agent-template","owner":"deepset-ai","description":"A template repository showing how to build a Github Agent and deploy it on the deepset AI platform","archived":false,"fork":false,"pushed_at":"2025-04-24T09:26:26.000Z","size":109,"stargazers_count":0,"open_issues_count":4,"forks_count":2,"subscribers_count":2,"default_branch":"main","last_synced_at":"2026-03-07T04:48:03.897Z","etag":null,"topics":[],"latest_commit_sha":null,"homepage":null,"language":"Python","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":null,"status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/deepset-ai.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":null,"license":null,"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,"zenodo":null,"notice":null,"maintainers":null,"copyright":null,"agents":null,"dco":null,"cla":null}},"created_at":"2025-04-22T10:23:13.000Z","updated_at":"2025-04-23T17:08:00.000Z","dependencies_parsed_at":"2025-10-14T12:18:54.972Z","dependency_job_id":"9305f7ca-d5c0-4939-8b7b-5deae1f065df","html_url":"https://github.com/deepset-ai/dap-github-agent-template","commit_stats":null,"previous_names":["deepset-ai/dap-github-agent-template"],"tags_count":4,"template":true,"template_full_name":null,"purl":"pkg:github/deepset-ai/dap-github-agent-template","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/deepset-ai%2Fdap-github-agent-template","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/deepset-ai%2Fdap-github-agent-template/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/deepset-ai%2Fdap-github-agent-template/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/deepset-ai%2Fdap-github-agent-template/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/deepset-ai","download_url":"https://codeload.github.com/deepset-ai/dap-github-agent-template/tar.gz/refs/heads/main","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/deepset-ai%2Fdap-github-agent-template/sbom","scorecard":null,"host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":286080680,"owners_count":34622271,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2026-05-26T15:22:16.424Z","status":"online","status_checked_at":"2026-06-21T02:00:05.568Z","response_time":54,"last_error":null,"robots_txt_status":"success","robots_txt_updated_at":"2025-07-24T06:49:26.215Z","robots_txt_url":"https://github.com/robots.txt","online":true,"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":[],"created_at":"2025-08-29T12:08:53.480Z","updated_at":"2026-06-21T18:32:04.203Z","avatar_url":"https://github.com/deepset-ai.png","language":"Python","funding_links":[],"categories":[],"sub_categories":[],"readme":"# deepset Github Agent\n_Template repository showcasing an Agent that can work with GitHub repositories and runs on the deepset AI platform_\n\n## What can I use this for?\n\nThe deepset GitHub Agent can independently write code to resolve GitHub issues and create a PR so that a human can\nreview the changes before they are merged into the main branch.\n\nThe Agent can perform the following actions:\n- it is triggered by a GitHub actions workflow and receives a GitHub issue as an input\n- it extracts the issue body and all issue comments from the issue that triggered it\n- it explores directories and files in the repository to build up relevant complex that is needed to resolve the issue\n- it creates a feature branch for the issue\n- it creates, updates or deletes files as needed to resolve the issue\n- it commits any changes to the feature branch that it created\n- it creates a PR upon completion that describes the changes made\n\nThis repository also allows developers to manage custom components and pipelines for the [deepset AI platform](https://www.deepset.ai/products-and-services/deepset-ai-platform)\ndirectly from GitHub.\n\nUsing this template, you can:\n- create custom components and push them to the deepset AI platform\n- create pipelines in Python; auto-serialize for deployment\n- create or update pipelines on the deepset AI platform\n\nBenefits:\n- one code base as the single-source of truth for all of your deepset AI platform artifacts\n- work in the comfort and speed of your local IDE; deploy to deepset's production-grade infrastructure via GitHub\n- versioning for your pipelines and custom components\n- roll-back changes to your pipelines through git-based workflows\n\n\n## Setup\n\n### 1. Create a new repository from this template\n\n\u003cimg src=\"https://docs.github.com/assets/cb-76823/mw-1440/images/help/repository/use-this-template-button.webp\" width=\"350\"\u003e\n\nSee detailed documentation for [creating repositories from a template](https://docs.github.com/en/repositories/creating-and-managing-repositories/creating-a-repository-from-a-template).\n\n### 2. Configure your repository\n\n1. Go to the deepset AI platform and [create an API-key](https://docs.cloud.deepset.ai/docs/generate-api-key).\n2. Add the API-key as a secret named `DP_API_KEY` [to your repository](https://docs.github.com/en/actions/security-for-github-actions/security-guides/using-secrets-in-github-actions).\n(To add a secret, go to your repository and choose _Settings \u003e Secrets and variables \u003e Actions \u003e New repository secret_.)\n3. Enable workflows for your repository by going to _Actions \u003e Enable workflows_.\n4. (Optional) Adjust the workflow files in `.github/workflows/` as needed.\n\n\n### 3. Install dependencies (locally on your machine)\n\n_requires Python\u003e=3.11_\n\n```bash\ngit clone \u003cyour-repository\u003e\ncd \u003cyour-repository\u003e\npip install hatch\n```\n\nCreate a virtual environment\n\n```bash\nhatch shell\n```\n\nThis installs all the necessary packages. You can reference this virtual environment in your IDE.\n\nFor more information on `hatch`, please refer to the [official Hatch documentation](https://hatch.pypa.io/).\n\n\n## Getting Started\n\n### Creating Pipelines\n\nGo to `src/pipelines` to view some example pipelines.\nTo make your own pipeline:\n- create and checkout a new branch\n- create a new directory under `src/dc_custom_component/pipelines`\n\nWe recommend to use the pipeline name as the name of the directory.\n\nCreate your pipelines just as you would create any normal Haystack pipelines.\nThe only addition is that you need to add an `inputs` and `outputs` key to the pipeline's metadata.\nThis is because the deepset AI platform needs to map API inputs and outputs to your pipeline.\n\n```python\nfrom haystack import Pipeline\nfrom haystack.components.generators.openai import OpenAIGenerator\nfrom haystack.components.builders import PromptBuilder, AnswerBuilder\nfrom haystack.utils import Secret\n\nfrom haystack_integrations.document_stores.opensearch import OpenSearchDocumentStore\nfrom haystack_integrations.components.retrievers.opensearch.bm25_retriever import (\n    OpenSearchBM25Retriever,\n)\n\n\ndef get_pipeline() -\u003e Pipeline:\n    retriever = OpenSearchBM25Retriever(document_store=OpenSearchDocumentStore())\n    builder_template = \"\"\"\n{% for doc in documents %}\n{{ doc.content }}\n{% endfor %}\n\nAnswer the question based on the documents.\n\nQuestion: {{query}}\n    \"\"\"\n    builder = PromptBuilder(template=builder_template)\n    llm = OpenAIGenerator(api_key=Secret.from_env_var([\"OPENAI_API_KEY\"], strict=False))\n    answer_builder = AnswerBuilder()\n\n    pp = Pipeline(\n        metadata={\n            \"inputs\": {\n                \"query\": [\n                    \"retriever.query\",\n                    \"builder.query\",\n                    \"answer_builder.query\",\n                ],\n                \"filters\": [\"retriever.filters\"],\n            },\n            \"outputs\": {\"answers\": \"answer_builder.answers\"},\n        }\n    )\n\n    pp.add_component(\"retriever\", retriever)\n    pp.add_component(\"builder\", builder)\n    pp.add_component(\"llm\", llm)\n    pp.add_component(\"answer_builder\", answer_builder)\n\n    pp.connect(\"retriever.documents\", \"builder.documents\")\n    pp.connect(\"builder.prompt\", \"llm.prompt\")\n    pp.connect(\"llm.replies\", \"answer_builder.replies\")\n\n    return pp\n\n\nquery_pipeline = get_pipeline()\n\n```\n\n\nTo prepare your pipeline for upload to the deepset AI platform, you have to add it to `pipelines/__init__.py`.\n\n```python\nfrom dc_custom_component.pipelines.hn_deep_research.query_gpt4o import query_pipeline\nfrom dc_custom_component.pipelines.hn_deep_research.indexing import indexing_pipeline\n\nsimple_rag = {\n    \"name\": \"simple-rag-v2\",\n    \"workspace\": \"test-workspace\",\n    \"query\": query_pipeline,\n    \"indexing\": indexing_pipeline,\n}\n\n# Any pipeline configuration added to this list will be uploaded to the deepset AI platform\ndp_pipelines = [simple_rag]\n```\n\nEach pipeline configuration added to `dp_pipelines` will be uploaded to the deepset AI platform.\n`name`, `workspace`, and `query` are mandatory fields in the configuration dictionary.\n`indexing` is optional.\n\n\n### Uploading Pipelines\n\n1. Git commit all your local changes. Make sure you have added all pipelines that you want to create or update to\n`pipelines/__init__.py`.\n2. Push your changes to a GitHub repository.\n3. Go to the GitHub UI and create a Pull Request.\n\nOnce you created your pull request, the CI-workflow will run.\nThe CI runs code-quality checks and tests. For pull requests, it validates that your pipeline definitions can be serialized, but it doesn't actually write the serialized files.\nWhen you merge your pull request to the main branch, the CI will then serialize your pipelines and save them to the `dist/pipelines` directory.\nYou will see a commit from the GitHub-Actions Bot that places these serialized pipelines into the `dist/pipelines` directory.\nIf no pipelines were added or existing pipelines haven't changed, the Bot will skip serialization.\nOnce all checks pass, merge your pull request.\n\nTo sync your changes to the deepset AI platform:\n1. Go to the releases tab in GitHub and [create a new release](https://docs.github.com/en/repositories/releasing-projects-on-github/managing-releases-in-a-repository#creating-a-release).\n2. Create a new tag following this schema: `pipelines-*.*.*` (e.g. `pipelines-1.0.0` for version one).\n3. Name the release, then publish it.\n\n\nPublishing the release will automatically tag the latest commit on the main-branch.\nThe tag triggers the `.github/workflows/publish_pipelines_on_tag.yaml`-workflow.\nThe workflow will scan your `dist/pipelines` directory and for each pipeline, it will check against the deepset API if the pipeline is new or was updated.\nIf the pipeline does not exist yet or the version in your repository differs from the version running in the deepset platform,\nthe workflow will create or update the pipeline.\n\nOnce the workflow finished, log in to the deepset AI platform and verify that your pipelines have been created or updated.\n\n\n\n### Creating Custom Components\n\nFor more information about custom components, see [Custom Components](https://docs.cloud.deepset.ai/docs/custom-components). \n\nFor a step-by-step guide on creating custom components, see [Create a Custom Component](https://docs.cloud.deepset.ai/docs/create-a-custom-component).\n\nSee also our tutorial for [creating a custom RegexBooster component](https://docs.cloud.deepset.ai/docs/tutorial-creating-a-custom-component).\n\n**Directory Structure**\n\n\n| File | Description |\n|------|-------------|\n| `/src/dc_custom_component/components` | Directory for implementing custom components. You can logically group custom components in sub-directories. See how sample components are grouped by type. |\n| `/src/dc_custom_component/__about__.py` | Your custom components' version. Bump the version every time you update your component before uploading it to deepset Cloud. This is not needed if you are using the GitHub action workflow (in this case the version will be determined by the GitHub release tag). |\n| `/pyproject.toml` | Information about the project. If needed, add your components' dependencies in this file in the `dependencies` section. |\n\nThe directory where your custom component is stored determines the name of the component group in Pipeline Builder. For example, the `CharacterSplitter` component would appear in the `Preprocessors` group, while the `KeywordBooster` component would be listed in the `Rankers` group. You can drag these components onto the canvas to use them.\n\nWhen working with YAML, the location of your custom component implementation defines your component's `type`. For example, the sample components have the following types because of their location:\n  - `dc_custom_component.components.example_components.preprocessors.character_splitter.CharacterSplitter`\n  - `dc_custom_component.components.example_components.rankers.keyword_booster.KeywordBooster`\n\nHere is how you would add them to a pipeline:\n```yaml\ncomponents:\n  splitter:\n    type: dc_custom_component.example_components.preprocessors.character_splitter.CharacterSplitter\n    init_parameters: {}\n  ...\n    \n```\n\nWhen working with Python, you can just import your custom components.\nHere is how you would use a custom component in your pipeline:\n\n```python\nfrom dc_custom_component.components.example_components.rankers.keyword_booster import KeywordBooster\n\nfrom haystack import Pipeline\n\npp = Pipeline()\n\npp.add_component(\"booster\", KeywordBooster({\"deepset\": 2.0}))\n```\n\n### Uploading Custom Components\n\n1. Git commit your local changes.\n2. Push the changes to a GitHub repository. \n3. Create a pull request, wait for the CI-workflow to pass and merge your changes. \n4. Once your pull request is merged, [create a new release](https://docs.github.com/en/repositories/releasing-projects-on-github/managing-releases-in-a-repository#creating-a-release) with a new tag following this schema:\n`components-*.*.*` (e.g. `components-1.0.0` for version one).\n5. Name and publish the release.\n\nPublishing the release will automatically tag the latest commit on the main-branch.\nThe tag triggers the `.github/workflows/publish_components_on_tag.yaml`-workflow.\nThe workflow will upload all Haystack components in  the `src/dc_custom_component/components`-directory.\nA few minutes after the components were uploaded, the components should be available in the deepset AI platform.\n\n\n\n### Developer tools\n\nWe provide a suite of tools for your development workflow with this template.\n\nLinting and formatting:\n\n```bash\nhatch run code-quality:all\n```\n\nTesting:\n\n```bash\nhatch run tests\n```\n\nAll provided tools are defined as scripts in the `pyproject.toml`.\n\n\n### Troubleshooting\n\nTo debug the installation of custom components on the deepset platform, you can run:\n\n- On Linux and macOS: `hatch run dc:logs` \n- On Windows: `hatch run dc:logs-windows`\n\nThis will print the installation logs of the latest version of your custom components.\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fdeepset-ai%2Fdap-github-agent-template","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fdeepset-ai%2Fdap-github-agent-template","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fdeepset-ai%2Fdap-github-agent-template/lists"}