Skip to content

Commit cea1a77

Browse files
Merge pull request #50 from Knowledge-Graph-Hub/enable_ai
Add agentic AI
2 parents 7e505d2 + cfdcb00 commit cea1a77

File tree

7 files changed

+260
-8
lines changed

7 files changed

+260
-8
lines changed

.config/goose/config.yaml

Lines changed: 55 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,55 @@
1+
OPENAI_HOST: https://api.cborg.lbl.gov
2+
OPENAI_BASE_PATH: v1/chat/completions
3+
GOOSE_MODEL: anthropic/claude-sonnet
4+
GOOSE_PROVIDER: openai
5+
extensions:
6+
developer:
7+
bundled: true
8+
display_name: Developer
9+
enabled: true
10+
name: developer
11+
timeout: 300
12+
type: builtin
13+
git:
14+
args:
15+
- mcp-server-git
16+
bundled: null
17+
cmd: uvx
18+
description: Git version control system integration
19+
enabled: false
20+
env_keys: []
21+
envs: {}
22+
name: git
23+
timeout: 300
24+
type: stdio
25+
memory:
26+
bundled: true
27+
display_name: Memory
28+
enabled: true
29+
name: memory
30+
timeout: 300
31+
type: builtin
32+
owlmcp:
33+
args:
34+
- owl-mcp
35+
bundled: null
36+
cmd: uvx
37+
description: ''
38+
enabled: false
39+
env_keys: []
40+
envs: {}
41+
name: owlmcp
42+
timeout: 300
43+
type: stdio
44+
pdfreader:
45+
args:
46+
- mcp-read-pdf
47+
bundled: null
48+
cmd: uvx
49+
description: Read large and complex PDF documents
50+
enabled: false
51+
env_keys: []
52+
envs: {}
53+
name: pdfreader
54+
timeout: 300
55+
type: stdio

.github/workflows/ai-agent.yml

Lines changed: 62 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,62 @@
1+
name: Alzheimer's AI Assistant GitHub Mentions
2+
3+
on:
4+
issues:
5+
types: [opened, edited]
6+
issue_comment:
7+
types: [created, edited]
8+
pull_request:
9+
types: [opened, edited]
10+
pull_request_review_comment:
11+
types: [created, edited]
12+
13+
jobs:
14+
check-mention:
15+
runs-on: ubuntu-latest
16+
outputs:
17+
qualified-mention: ${{ steps.detect.outputs.qualified-mention }}
18+
prompt: ${{ steps.detect.outputs.prompt }}
19+
user: ${{ steps.detect.outputs.user }}
20+
item-type: ${{ steps.detect.outputs.item-type }}
21+
item-number: ${{ steps.detect.outputs.item-number }}
22+
controllers: ${{ steps.detect.outputs.controllers }}
23+
steps:
24+
- name: Checkout repository
25+
uses: actions/checkout@v4
26+
27+
- name: Detect AI mention
28+
id: detect
29+
uses: dragon-ai-agent/github-mention-detector@v1.0.0
30+
with:
31+
github-token: ${{ secrets.PAT_FOR_PR }}
32+
fallback-controllers: 'jtr4v'
33+
34+
respond-to-mention:
35+
needs: check-mention
36+
if: needs.check-mention.outputs.qualified-mention == 'true'
37+
permissions:
38+
contents: write
39+
pull-requests: write
40+
issues: write
41+
runs-on: ubuntu-latest
42+
steps:
43+
- name: Checkout repository
44+
uses: actions/checkout@v4
45+
with:
46+
fetch-depth: 0
47+
token: ${{ secrets.PAT_FOR_PR }}
48+
49+
- name: Respond with AI Agent
50+
uses: dragon-ai-agent/run-goose-obo@v1.0.4
51+
with:
52+
anthropic-api-key: ${{ secrets.ANTHROPIC_API_KEY }}
53+
openai-api-key: ${{ secrets.CBORG_API_KEY }}
54+
github-token: ${{ secrets.PAT_FOR_PR }}
55+
prompt: ${{ needs.check-mention.outputs.prompt }}
56+
user: ${{ needs.check-mention.outputs.user }}
57+
item-type: ${{ needs.check-mention.outputs.item-type }}
58+
item-number: ${{ needs.check-mention.outputs.item-number }}
59+
controllers: ${{ needs.check-mention.outputs.controllers }}
60+
agent-name: 'alzassistant'
61+
branch-prefix: 'alzassistant'
62+
robot-version: 'v1.9.7'

.goosehints

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1 @@
1+
/Users/jtr4v/CLAUDE.md

AI_AGENT_SETUP.md

Lines changed: 51 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,51 @@
1+
# AI Agent Setup Instructions
2+
3+
This repository has been configured with a GitHub Actions workflow for AI agent integration using the Dragon AI Agent.
4+
5+
## Files Created
6+
7+
1. **`.github/workflows/ai-agent.yml`** - GitHub Actions workflow that triggers the AI agent on issue/PR mentions
8+
2. **`.config/goose/config.yaml`** - Configuration for the goose AI agent
9+
3. **`.goosehints`** - Symlink to CLAUDE.md containing project-specific instructions
10+
11+
## Required Repository Secrets
12+
13+
To complete the setup, you need to configure the following secrets in your GitHub repository settings:
14+
15+
**Navigate to:** `https://github.com/YOUR_USERNAME/kg-alzheimers/settings/secrets/actions`
16+
17+
### Required Secrets:
18+
19+
1. **`ANTHROPIC_API_KEY`**
20+
- Your Anthropic API key for Claude access
21+
- Get from: https://console.anthropic.com/
22+
23+
2. **`CBORG_API_KEY`**
24+
- API key for the CBORG LiteLLM proxy
25+
- This enables access to multiple AI models through a unified interface
26+
27+
3. **`PAT_FOR_PR`**
28+
- Personal Access Token for GitHub operations
29+
- Needs permissions: `contents:write`, `pull-requests:write`, `issues:write`
30+
- Generate at: https://github.com/settings/tokens
31+
32+
## How It Works
33+
34+
- When someone mentions `@alzassistant` in issues, PRs, or comments, the workflow triggers
35+
- The AI agent can read the context, understand requests, and create pull requests with changes
36+
- The agent uses the instructions in `.goosehints` (linked to CLAUDE.md) to understand the project
37+
- Fallback controller is set to `jtr4v` for permissions management
38+
39+
## Testing
40+
41+
Once secrets are configured, test by:
42+
1. Creating an issue
43+
2. Commenting with `@alzassistant help me with X`
44+
3. The agent should respond with a PR addressing the request
45+
46+
## Configuration Notes
47+
48+
- Uses `anthropic/claude-sonnet` model via CBORG proxy
49+
- Agent name: "alzassistant"
50+
- Branch prefix: "alzassistant"
51+
- Robot version: v1.9.7

README.md

Lines changed: 80 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,8 +1,86 @@
11
# KG-Alzheimers
22
[![documentation](https://img.shields.io/badge/-Documentation-purple?logo=read-the-docs&logoColor=white&style=for-the-badge)](https://Knowledge-Graph-Hub.github.io/kg-alzheimers/)
33

4+
KG-Alzheimers builds and distributes an Alzheimer’s disease-focused biomedical
5+
knowledge graph by harmonizing Monarch Initiative and partner data sources into
6+
BioLink Model-compliant KGX exports, DuckDB/SQLite databases, JSONL feeds, and
7+
search indexes.
48

5-
KG-Alzhheimers is a knowledge graph integrating biomedical data related to Alzheimer's
6-
Disease.
9+
## Highlights
710

11+
- Integrates dozens of genomics, phenomics, pathway, and literature resources
12+
behind a repeatable ETL pipeline.
13+
- Ships a Typer-powered CLI (`ingest`) that orchestrates download, transform,
14+
merge, QC, export, and packaging steps.
15+
- Produces denormalized TSV bundles, RDF/JSONL snapshots, and Solr-ready
16+
indexes suitable for analytics or downstream applications.
17+
- Uses Poetry for dependency management and reproducible environments; CI/CD via
18+
Jenkins keeps public releases up to date.
819

20+
## Getting Started
21+
22+
> Requires Python 3.10+ and [Poetry](https://python-poetry.org/).
23+
24+
```bash
25+
git clone https://github.com/Knowledge-Graph-Hub/kg-alzheimers.git
26+
cd kg-alzheimers
27+
poetry install
28+
29+
# Optional: activate the virtual environment created by Poetry
30+
poetry shell
31+
```
32+
33+
To download all referenced datasets and run the full build pipeline locally:
34+
35+
```bash
36+
# Retrieve source data declared in src/kg_alzheimers/download.yaml
37+
poetry run ingest download --all --write-metadata
38+
39+
# Execute Phenio preprocessing plus all Koza ingests
40+
poetry run ingest transform --all --log --rdf --write-metadata
41+
42+
# Merge transformed outputs into a unified KG bundle with QC checks
43+
poetry run ingest merge
44+
45+
# (Optional) Generate closure-enriched denormalized tables
46+
poetry run ingest closure
47+
48+
# Prepare release artifacts (gzipped DuckDB/TSV/JSONL bundles)
49+
poetry run ingest prepare-release
50+
```
51+
52+
Additional commands are documented in [`docs/CLI.md`](docs/CLI.md) and include:
53+
54+
- `poetry run ingest export` — create filtered TSV/JSONL dumps defined in
55+
`src/kg_alzheimers/data-dump-config.yaml`.
56+
- `poetry run ingest report` — run DuckDB QC SQL scripts to audit the merge.
57+
- `poetry run ingest sqlite` / `poetry run ingest solr` — load artifacts into
58+
local SQLite or Solr instances for exploration.
59+
60+
> **Note:** The `ingest release` command is deprecated; releases are created by
61+
> the Jenkins pipeline described in `Jenkinsfile`.
62+
63+
## Documentation
64+
65+
- Detailed guides, modeling principles, and ingest walkthroughs live at
66+
[Knowledge-Graph-Hub.github.io/kg-alzheimers](https://Knowledge-Graph-Hub.github.io/kg-alzheimers/).
67+
- Source for the documentation site resides in the [`docs/`](docs) directory
68+
and is built with MkDocs Material (`mkdocs.yaml`).
69+
70+
## Development
71+
72+
- Run the unit test suite:
73+
74+
```bash
75+
poetry run pytest
76+
```
77+
78+
- Format and lint using the configured tooling (Black and Ruff):
79+
80+
```bash
81+
poetry run black src tests
82+
poetry run ruff check src tests
83+
```
84+
85+
Issues and contributions are welcome via GitHub. To propose a new ingest, follow
86+
the workflow documented under `docs/Create-an-Ingest/`.

docs/CLI.md

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -21,7 +21,7 @@ $ ingest [OPTIONS] COMMAND [ARGS]...
2121
* `jsonl`
2222
* `merge`: Merge nodes and edges into kg
2323
* `prepare-release`
24-
* `release`: Copy data to Monarch GCP data buckets
24+
* `release`: Deprecated wrapper for legacy Monarch uploads
2525
* `report`: Run Koza QC on specified Monarch ingests
2626
* `solr`
2727
* `sqlite`
@@ -111,7 +111,8 @@ $ ingest prepare-release [OPTIONS]
111111

112112
## `ingest release`
113113

114-
Copy data to KG-Alzheimers S3 bucket
114+
Deprecated wrapper for the historical release workflow; Jenkins now handles
115+
remote publication and this command only prints a deprecation notice.
115116

116117
**Usage**:
117118

docs/index.md

Lines changed: 8 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -40,9 +40,9 @@ poetry shell
4040

4141
## Usage
4242

43-
For a detailed tutorial on ingests and how to make one, see the [Create an Ingest tab](Create-an-Ingest/index.md).
43+
For a detailed tutorial on ingests and how to make one, see the [Create an Ingest tab](Create-an-Ingest/index.md).
4444

45-
CLI usage is available in the [CLI tab](CLI.md), gcor by running `ingest --help`.
45+
CLI usage is available in the [CLI tab](CLI.md), or by running `ingest --help`.
4646

4747
??? tip "Run the whole pipeline!"
4848
- Download the source data:
@@ -60,11 +60,15 @@ CLI usage is available in the [CLI tab](CLI.md), gcor by running `ingest --help`
6060
ingest merge
6161
```
6262

63-
- Upload the results to the KG-Alzheimers S3 bucket
63+
- (Optional) Generate closure-enriched denormalized tables and prepare release artifacts
6464
```bash
65-
ingest release
65+
ingest closure
66+
ingest prepare-release
6667
```
6768

69+
- (CI only) Artifact publication to S3 is automated by Jenkins (`Jenkinsfile`); the
70+
local `ingest release` command now emits a deprecation notice.
71+
6872
<meta http-equiv='cache-control' content='no-cache'>
6973
<meta http-equiv='expires' content='0'>
7074
<meta http-equiv='pragma' content='no-cache'>

0 commit comments

Comments
 (0)