llm-change-agent

LLM Change Agent is a command-line interface (CLI) tool designed to interact with various language models for generating and modifying ontology definitions. It offers a range of functionalities to streamline KGCL command generation tasks.

https://github.com/hrshdhgd/llm-change-agent

Science Score: 67.0%

This score indicates how likely this project is to be science-related based on various indicators:

  • CITATION.cff file
    Found CITATION.cff file
  • codemeta.json file
    Found codemeta.json file
  • .zenodo.json file
    Found .zenodo.json file
  • DOI references
    Found 1 DOI reference(s) in README
  • Academic publication links
    Links to: zenodo.org
  • Academic email domains
  • Institutional organization owner
  • JOSS paper metadata
  • Scientific vocabulary similarity
    Low similarity (13.3%) to scientific vocabulary

Keywords

ai artificial-intelligence change-language gpt kgcl llm ontologies ontology
Last synced: 9 months ago · JSON representation ·

Repository

LLM Change Agent is a command-line interface (CLI) tool designed to interact with various language models for generating and modifying ontology definitions. It offers a range of functionalities to streamline KGCL command generation tasks.

Basic Info
Statistics
  • Stars: 3
  • Watchers: 1
  • Forks: 1
  • Open Issues: 0
  • Releases: 14
Topics
ai artificial-intelligence change-language gpt kgcl llm ontologies ontology
Created almost 2 years ago · Last pushed over 1 year ago
Metadata Files
Readme Contributing License Citation

README.md

LLM Change Agent

DOI

Overview

LLM Change Agent is a command-line tool designed to generate knowledge graph change language (KGCL) commands that request changes in a knowledge graph such as an ontology. It generates KGCL commands using specified large language models and providers via prompts. The prompts can be GitHub issue description/comments or natural language text.

Features

  • Given a prompt relevant to making ontology resource changes, the agent responds with KGCL change statements.
  • Supports OpenAI, Ollama, Anthropic and CBORG (LBNL-hosted) models.

:warning: OpenAI, Anthropic and CBORG model use require availability of corresponding keys as environment variables locally.

Installation

To install the dependencies, run: bash pip install llm-change-agent

Usage

The CLI provides several commands to interact with the language models.

List Available Models

To list all available models from supported providers: ```bash llm-change list-models

OpenAI models: gpt-4o-2024-08-06 gpt-4o-mini gpt-4o-mini-2024-07-18 gpt-4o-2024-05-13 gpt-4o gpt-4-turbo-2024-04-09 gpt-4-turbo gpt-4-turbo-preview Anthropic models: claude-3-5-sonnet-20240620 claude-3-opus-20240229 claude-3-sonnet-20240229 claude-3-haiku-20240307 Ollama models: llama3.1 LBL-CBORG models: lbl/cborg-chat:latest lbl/cborg-chat-nano:latest openai/gpt-3.5-turbo openai/gpt-4o openai/gpt-4o-mini anthropic/claude-haiku anthropic/claude-sonnet anthropic/claude-opus google/gemini-pro google/gemini-flash ```

Generate Text

To generate text using a specified model and provider: bash llm-change execute --model <MODEL_NAME> --provider <PROVIDER_NAME> --prompt "<YOUR_PROMPT>" Replace <MODEL_NAME>, <PROVIDER_NAME>, and <YOUR_PROMPT> with your desired values.

Examples

  • Generate text using CBORG's lbl/llama-3 model with a custom prompt: bash llm-change execute --model lbl/llama-3 --prompt "I want to change the definition of class ABC:123 to 'foo bar' and also create a new class labelled 'bar foo' with the curie DEF:123." OR bash llm-change execute --provider cborg --prompt "I want to change the definition of class ABC:123 to 'foo bar' and also create a new class labelled 'bar foo' with the curie DEF:123."

generates

```bash Final Answer:

[ "change definition of ABC:123 to 'foo bar'", "create class DEF:123 'bar foo'" ]

```

Evaluations

Input

The project also contains input data for evaluations in the form of YAML files for the following ontologies: - Envo - GO - MONDO - Cell Ontology - Uberon - PATO

Expected changes

The expected changes for specific pull requests are listed ontologywise below: - Envo - GO - MONDO - Cell Ontology - Uberon - PATO

Actual results

The actual results for some of the LLM models evaluated are here and corresponding metrics here

Development

To run the project locally, clone the repository and navigate to the project directory: bash git clone https://github.com/yourusername/llm-change-agent.git cd llm-change-agent poetry install Make sure you have poetry installed in your system.

Contributing

Contributions are welcome! Please submit a pull request or open an issue to discuss any changes.

License

This project is licensed under the MIT License. See the LICENSE file for details.


Acknowledgements

This cookiecutter project was developed from the monarch-project-template template and will be kept up-to-date using cruft.

Owner

  • Name: Harshad
  • Login: hrshdhgd
  • Kind: user
  • Company: Lawrence Berkeley National Laboratory

Lawrence Berkeley National Laboratory

Citation (CITATION.cff)

cff-version: 1.2.0
message: "If you use this software, please cite it using the following metadata."
title: "LLM Change Agent"
version: "0.0.6"
doi: "10.5281/zenodo.13695262"
date-released: 2024-09-05
authors:
  - family-names: "Hegde"
    given-names: "Harshad"
    orcid: "https://orcid.org/0000-0002-2411-565X"  # Replace with actual ORCID

affiliations:
  - name: "Lawrence Berekeley National Laboratory"
    address: "1 Cyclotron Road, Berkeley, CA 94720, USA"
keywords:
  - "llm"
  - "kgcl"
  - "ontology"
  - "change-language"
  - "artificial intelligence"

license: "MIT"
repository-code: "https://github.com/hrshdhgd/llm-change-agent"
url: "https://github.com/hrshdhgd/llm-change-agent"
abstract: >
  LLM Change Agent is a command-line interface (CLI) tool designed to interact with various large language models
  for generating and modifying ontology resources. It supports multiple LLM providers and offers a range of
  functionalities to streamline KGCL command generation tasks.

GitHub Events

Total
  • Watch event: 2
  • Fork event: 1
Last Year
  • Watch event: 2
  • Fork event: 1

Issues and Pull Requests

Last synced: over 1 year ago

All Time
  • Total issues: 0
  • Total pull requests: 7
  • Average time to close issues: N/A
  • Average time to close pull requests: about 23 hours
  • Total issue authors: 0
  • Total pull request authors: 2
  • Average comments per issue: 0
  • Average comments per pull request: 0.29
  • Merged pull requests: 7
  • Bot issues: 0
  • Bot pull requests: 0
Past Year
  • Issues: 0
  • Pull requests: 7
  • Average time to close issues: N/A
  • Average time to close pull requests: about 23 hours
  • Issue authors: 0
  • Pull request authors: 2
  • Average comments per issue: 0
  • Average comments per pull request: 0.29
  • Merged pull requests: 7
  • Bot issues: 0
  • Bot pull requests: 0
Top Authors
Issue Authors
Pull Request Authors
  • hrshdhgd (12)
  • nlharris (2)
Top Labels
Issue Labels
Pull Request Labels

Dependencies

.github/workflows/deploy-docs.yml actions
  • JamesIves/github-pages-deploy-action v4.4.1 composite
  • actions/checkout v3.0.2 composite
  • actions/setup-python v3 composite
  • snok/install-poetry v1.3.1 composite
.github/workflows/pypi-publish.yml actions
  • actions/checkout v4 composite
  • actions/setup-python v5 composite
  • pypa/gh-action-pypi-publish release/v1 composite
.github/workflows/qc.yml actions
  • actions/checkout v3.0.2 composite
  • actions/setup-python v3 composite
  • snok/install-poetry v1.3.1 composite
poetry.lock pypi
  • aiohappyeyeballs 2.3.5
  • aiohttp 3.10.3
  • aiosignal 1.3.1
  • alabaster 0.7.16
  • annotated-types 0.7.0
  • async-timeout 4.0.3
  • attrs 24.2.0
  • babel 2.16.0
  • cachetools 5.4.0
  • certifi 2024.7.4
  • cfgv 3.4.0
  • chardet 5.2.0
  • charset-normalizer 3.3.2
  • click 8.1.7
  • colorama 0.4.6
  • distlib 0.3.8
  • docutils 0.20.1
  • exceptiongroup 1.2.2
  • filelock 3.15.4
  • frozenlist 1.4.1
  • greenlet 3.0.3
  • identify 2.6.0
  • idna 3.7
  • imagesize 1.4.1
  • importlib-metadata 8.2.0
  • iniconfig 2.0.0
  • jinja2 3.1.4
  • jsonpatch 1.33
  • jsonpointer 3.0.0
  • langchain 0.2.12
  • langchain-core 0.2.29
  • langchain-text-splitters 0.2.2
  • langsmith 0.1.99
  • markdown-it-py 3.0.0
  • markupsafe 2.1.5
  • mdit-py-plugins 0.4.1
  • mdurl 0.1.2
  • multidict 6.0.5
  • myst-parser 3.0.1
  • nodeenv 1.9.1
  • numpy 1.26.4
  • orjson 3.10.7
  • packaging 24.1
  • platformdirs 4.2.2
  • pluggy 1.5.0
  • pre-commit 3.8.0
  • pydantic 2.8.2
  • pydantic-core 2.20.1
  • pygments 2.18.0
  • pyproject-api 1.7.1
  • pytest 8.3.2
  • pyyaml 6.0.2
  • requests 2.32.3
  • snowballstemmer 2.2.0
  • sphinx 7.4.7
  • sphinx-autodoc-typehints 2.2.3
  • sphinx-click 6.0.0
  • sphinx-rtd-theme 2.0.0
  • sphinxcontrib-applehelp 2.0.0
  • sphinxcontrib-devhelp 2.0.0
  • sphinxcontrib-htmlhelp 2.1.0
  • sphinxcontrib-jquery 4.1
  • sphinxcontrib-jsmath 1.0.1
  • sphinxcontrib-qthelp 2.0.0
  • sphinxcontrib-serializinghtml 2.0.0
  • sqlalchemy 2.0.32
  • tenacity 8.5.0
  • tomli 2.0.1
  • tox 4.17.1
  • typing-extensions 4.12.2
  • urllib3 2.2.2
  • virtualenv 20.26.3
  • yarl 1.9.4
  • zipp 3.20.0
pyproject.toml pypi
  • pre-commit >=3.3.3 develop
  • pytest >=8.3.2 develop
  • tox >=4.16.0 develop
  • myst-parser >=0.18.1 docs
  • sphinx >=6.1.3 docs
  • sphinx-autodoc-typehints >=1.2.0 docs
  • sphinx-click >=4.3.0 docs
  • sphinx-rtd-theme >=1.0.0 docs
  • click *
  • importlib-metadata >=8.2.0
  • langchain ^0.2.12
  • python ^3.9