{"id":27814500,"url":"https://github.com/patmartin/ai-ops","last_synced_at":"2026-06-30T22:32:13.603Z","repository":{"id":268918702,"uuid":"905850861","full_name":"PatMartin/ai-ops","owner":"PatMartin","description":"AI support for Ops4J","archived":false,"fork":false,"pushed_at":"2024-12-20T22:08:43.000Z","size":14,"stargazers_count":0,"open_issues_count":0,"forks_count":0,"subscribers_count":1,"default_branch":"main","last_synced_at":"2025-08-20T15:53:48.835Z","etag":null,"topics":[],"latest_commit_sha":null,"homepage":null,"language":"Java","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"apache-2.0","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/PatMartin.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":null,"license":"LICENSE","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}},"created_at":"2024-12-19T16:41:22.000Z","updated_at":"2024-12-20T22:08:47.000Z","dependencies_parsed_at":"2024-12-19T18:18:30.057Z","dependency_job_id":"46814c3b-0614-406d-a65f-68d040951326","html_url":"https://github.com/PatMartin/ai-ops","commit_stats":null,"previous_names":["patmartin/ai-ops"],"tags_count":0,"template":false,"template_full_name":null,"purl":"pkg:github/PatMartin/ai-ops","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/PatMartin%2Fai-ops","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/PatMartin%2Fai-ops/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/PatMartin%2Fai-ops/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/PatMartin%2Fai-ops/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/PatMartin","download_url":"https://codeload.github.com/PatMartin/ai-ops/tar.gz/refs/heads/main","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/PatMartin%2Fai-ops/sbom","scorecard":null,"host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":286080680,"owners_count":34986248,"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-30T02:00:05.919Z","response_time":92,"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-05-01T12:44:06.179Z","updated_at":"2026-06-30T22:32:13.597Z","avatar_url":"https://github.com/PatMartin.png","language":"Java","funding_links":[],"categories":[],"sub_categories":[],"readme":"# ai-ops\n\nAI and LLM operations for Ops4J, powered by [LangChain4j](https://github.com/langchain4j/langchain4j).\n\nThis is an optional plugin module. Add it to a project that already depends on `ops4j-core` to bring LLM question answering, image generation, RAG, and prompt-based workflows into your pipelines.\n\n---\n\n## Overview\n\n`ai-ops` integrates large language models into the Ops4J pipeline model. It uses LangChain4j to communicate with OpenAI-compatible APIs and the GitHub Models endpoint. Operations are first-class pipeline stages: a record flows in, the operation invokes the configured model, and an annotated record flows out.\n\n---\n\n## Operations\n\n| Operation | Description |\n| --- | --- |\n| `ask` (`AskQuestion`) | Sends a question to a configured LLM (ChatGPT or GitHub Models) and writes the response back into the record. |\n| `ai-prompt` (`AiPrompt`) | Executes a templated prompt where placeholders are filled from the incoming record's fields. |\n| `rag` (`RAG`) | Retrieval-Augmented Generation. Indexes a set of documents using local embeddings, then answers questions by retrieving relevant context before querying the model. |\n| `query-image` (`QueryImage`) | Sends an image to a vision-capable model and writes the model's answer about the image back into the record. |\n| `gen-image` (`GenImage`) | Generates an image using DALL-E 3 and stores the result URL in the record. |\n| `ai-draw` (`AiDraw`) | Wrapper around DALL-E 3 image generation with additional drawing-oriented options. |\n\nAll operations extend `AiOp`, which provides shared configuration for the API provider, model name, and API key.\n\n---\n\n## Usage Examples\n\nAsk a single question:\n\n```bash\nask \"Explain why the sky is blue\"\n```\n\nAnnotate each record in a stream with an AI-generated summary of its `description` field:\n\n```bash\ncat products.json | ai-prompt -t \"Summarize this in one sentence: {{description}}\"\n```\n\nAnswer questions against a local document corpus:\n\n```bash\ncat questions.json | rag -d ./docs\n```\n\nGenerate an image based on a prompt stored in the `prompt` field of each record:\n\n```bash\ncat prompts.json | gen-image\n```\n\n---\n\n## Configuration\n\n`ai-ops` registers itself automatically. API credentials are provided at runtime via options on each operation or through environment variables recognized by LangChain4j (`OPENAI_API_KEY`, `GITHUB_TOKEN`, etc.).\n\nDefault provider configuration is located in `src/main/resources/ai.conf`:\n\n```hocon\nai {\n  provider = openai\n}\n```\n\n---\n\n## Key Dependencies\n\n| Dependency | Purpose |\n| --- | --- |\n| [ops4j-core](../ops4j-core/) | Ops4J runtime and base classes |\n| LangChain4j (core, OpenAI, GitHub Models) | LLM client and AI service abstraction |\n| LangChain4j Easy RAG | Document ingestion and retrieval for RAG workflows |\n| LangChain4j BGE embeddings | Local embedding model for RAG document indexing |\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fpatmartin%2Fai-ops","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fpatmartin%2Fai-ops","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fpatmartin%2Fai-ops/lists"}