{"id":17998785,"url":"https://github.com/agents-flex/agents-flex","last_synced_at":"2026-03-06T04:08:26.871Z","repository":{"id":218206425,"uuid":"742326880","full_name":"agents-flex/agents-flex","owner":"agents-flex","description":"Agents-flex is A Lightweight Java AI Application Development Framework.","archived":false,"fork":false,"pushed_at":"2026-03-01T05:16:55.000Z","size":9644,"stargazers_count":1304,"open_issues_count":3,"forks_count":110,"subscribers_count":16,"default_branch":"v2.x","last_synced_at":"2026-03-01T07:18:48.304Z","etag":null,"topics":["agent","ai","chatbot","chatgpt","gpt","langchain4j","llama3","llm","ollama","spring-ai"],"latest_commit_sha":null,"homepage":"https://agentsflex.com","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/agents-flex.png","metadata":{"files":{"readme":"readme.md","changelog":"changes.md","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,"notice":null,"maintainers":null,"copyright":null,"agents":null,"dco":null,"cla":null}},"created_at":"2024-01-12T08:23:40.000Z","updated_at":"2026-03-01T05:16:59.000Z","dependencies_parsed_at":"2024-03-26T06:21:48.972Z","dependency_job_id":"f5ce71d8-1ca6-42ca-871b-82ebb770858d","html_url":"https://github.com/agents-flex/agents-flex","commit_stats":null,"previous_names":["agents-flex/agents-flex"],"tags_count":36,"template":false,"template_full_name":null,"purl":"pkg:github/agents-flex/agents-flex","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/agents-flex%2Fagents-flex","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/agents-flex%2Fagents-flex/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/agents-flex%2Fagents-flex/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/agents-flex%2Fagents-flex/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/agents-flex","download_url":"https://codeload.github.com/agents-flex/agents-flex/tar.gz/refs/heads/v2.x","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/agents-flex%2Fagents-flex/sbom","scorecard":null,"host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":286080680,"owners_count":30069259,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2026-03-04T01:03:42.280Z","status":"online","status_checked_at":"2026-03-04T02:00:07.464Z","response_time":59,"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":["agent","ai","chatbot","chatgpt","gpt","langchain4j","llama3","llm","ollama","spring-ai"],"created_at":"2024-10-29T22:07:24.297Z","updated_at":"2026-03-06T04:08:26.853Z","avatar_url":"https://github.com/agents-flex.png","language":"Java","funding_links":[],"categories":["Chatbots","Agent Builder","Agents"],"sub_categories":[],"readme":"\u003ch4 align=\"right\"\u003e\u003cstrong\u003eEnglish\u003c/strong\u003e | \u003ca href=\"./readme_zh.md\"\u003e简体中文\u003c/a\u003e | \u003ca href=\"./readme_ja.md\"\u003e日本語\u003c/a\u003e\u003c/h4\u003e\n\n\u003cp align=\"center\"\u003e\n    \u003cimg src=\"./docs/assets/images/banner.png\"/\u003e\n\u003c/p\u003e\n\n\n# Agents-Flex is a LLM Application Framework like LangChain base on Java.\n\n---\n\n## Features\n\n- LLM Visit\n- Prompt、Prompt Template\n- Function Calling Definer, Invoker、Running\n- Memory\n- Embedding\n- Vector Store\n- Resource Loaders\n- Document\n  - Splitter\n  - Loader\n  - Parser\n    - PoiParser\n    - PdfBoxParser\n- Agent\n  - LLM Agent\n- Chain\n  - SequentialChain\n  - ParallelChain\n  - LoopChain\n  - ChainNode\n    - AgentNode\n    - EndNode\n    - RouterNode\n      - GroovyRouterNode\n      - QLExpressRouterNode\n      - LLMRouterNode\n\n## Simple Chat\n\nuse OpenAI LLM:\n\n```java\n @Test\npublic void testChat() {\n    OpenAILlmConfig config = new OpenAILlmConfig();\n    config.setApiKey(\"sk-rts5NF6n*******\");\n\n    Llm llm = new OpenAILlm(config);\n    String response = llm.chat(\"what is your name?\");\n\n    System.out.println(response);\n}\n```\n\n\nuse Qwen LLM:\n\n```java\n @Test\npublic void testChat() {\n    QwenLlmConfig config = new QwenLlmConfig();\n    config.setApiKey(\"sk-28a6be3236****\");\n    config.setModel(\"qwen-turbo\");\n\n    Llm llm = new QwenLlm(config);\n    String response = llm.chat(\"what is your name?\");\n\n    System.out.println(response);\n}\n```\n\n\nuse SparkAi LLM:\n\n```java\n @Test\npublic void testChat() {\n    SparkLlmConfig config = new SparkLlmConfig();\n    config.setAppId(\"****\");\n    config.setApiKey(\"****\");\n    config.setApiSecret(\"****\");\n\n    Llm llm = new SparkLlm(config);\n    String response = llm.chat(\"what is your name?\");\n\n    System.out.println(response);\n}\n```\n\n## Chat With Histories\n\n\n```java\npublic static void main(String[] args) {\n    SparkLlmConfig config = new SparkLlmConfig();\n    config.setAppId(\"****\");\n    config.setApiKey(\"****\");\n    config.setApiSecret(\"****\");\n\n    Llm llm = new SparkLlm(config);\n\n    HistoriesPrompt prompt = new HistoriesPrompt();\n\n    System.out.println(\"ask for something...\");\n    Scanner scanner = new Scanner(System.in);\n    String userInput = scanner.nextLine();\n\n    while (userInput != null) {\n\n        prompt.addMessage(new HumanMessage(userInput));\n\n        llm.chatStream(prompt, (context, response) -\u003e {\n            System.out.println(\"\u003e\u003e\u003e\u003e \" + response.getMessage().getContent());\n        });\n\n        userInput = scanner.nextLine();\n    }\n}\n```\n\n## Function Calling\n\n- step 1: define the function native\n\n```java\npublic class WeatherUtil {\n\n    @FunctionDef(name = \"get_the_weather_info\", description = \"get the weather info\")\n    public static String getWeatherInfo(\n        @FunctionParam(name = \"city\", description = \"the city name\") String name\n    ) {\n        //we should invoke the third part api for weather info here\n        return \"Today it will be dull and overcast in \" + name;\n    }\n}\n\n```\n\n- step 2: invoke the function from LLM\n\n```java\n public static void main(String[] args) {\n    OpenAILlmConfig config = new OpenAILlmConfig();\n    config.setApiKey(\"sk-rts5NF6n*******\");\n\n    OpenAILlm llm = new OpenAILlm(config);\n\n    FunctionPrompt prompt = new FunctionPrompt(\"How is the weather in Beijing today?\", WeatherUtil.class);\n    FunctionResultResponse response = llm.chat(prompt);\n\n    Object result = response.getFunctionResult();\n\n    System.out.println(result);\n    //Today it will be dull and overcast in Beijing\n}\n```\n\n\n## Communication\n\n- Twitter: https://twitter.com/yangfuhai\n\n## Modules\n\n![](./docs/assets/images/modules.jpg)\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fagents-flex%2Fagents-flex","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fagents-flex%2Fagents-flex","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fagents-flex%2Fagents-flex/lists"}