{"id":33374466,"url":"https://github.com/codycollier/minimal-agent-core","last_synced_at":"2026-06-09T03:43:27.854Z","repository":{"id":324329306,"uuid":"1096850166","full_name":"codycollier/minimal-agent-core","owner":"codycollier","description":"An illustration of the small inner core of a function calling agent using the OpenAI Responses API","archived":false,"fork":false,"pushed_at":"2025-11-15T05:10:31.000Z","size":10,"stargazers_count":0,"open_issues_count":0,"forks_count":0,"subscribers_count":0,"default_branch":"main","last_synced_at":"2025-11-15T06:23:50.294Z","etag":null,"topics":["agent","function-calling","openai"],"latest_commit_sha":null,"homepage":"","language":"Python","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"mit","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/codycollier.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,"notice":null,"maintainers":null,"copyright":null,"agents":null,"dco":null,"cla":null}},"created_at":"2025-11-15T04:00:34.000Z","updated_at":"2025-11-15T05:10:35.000Z","dependencies_parsed_at":null,"dependency_job_id":null,"html_url":"https://github.com/codycollier/minimal-agent-core","commit_stats":null,"previous_names":["codycollier/minimal-agent-core"],"tags_count":null,"template":false,"template_full_name":null,"purl":"pkg:github/codycollier/minimal-agent-core","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/codycollier%2Fminimal-agent-core","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/codycollier%2Fminimal-agent-core/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/codycollier%2Fminimal-agent-core/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/codycollier%2Fminimal-agent-core/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/codycollier","download_url":"https://codeload.github.com/codycollier/minimal-agent-core/tar.gz/refs/heads/main","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/codycollier%2Fminimal-agent-core/sbom","scorecard":null,"host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":285873538,"owners_count":27246054,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2022-07-04T15:15:14.044Z","status":"online","status_checked_at":"2025-11-22T02:00:05.934Z","response_time":64,"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","function-calling","openai"],"created_at":"2025-11-22T23:02:09.902Z","updated_at":"2026-06-09T03:43:27.849Z","avatar_url":"https://github.com/codycollier.png","language":"Python","funding_links":[],"categories":[],"sub_categories":[],"readme":"# minimal-agent-core\n\nAn illustration of the small inner core of a function calling agent\n\n\n## Overview\n\nThis project is for illustration and learning. It is a simple agent which can\nhold a conversation and provide a random color and/or number.\n\nThe core of an agent is relatively simple, and consists of a loop around special\ncalls to an LLM where you send both a user message and a list of tools. The LLM\ndecides when it needs to call a function, tells the program. The program makes\nthe function call(s) and sends the result(s) back to the LLM to continue the\nconversation.\n\nYou can do all this in just a few hundred lines of code, most of which is about\nhandling the representation of the functions and calls as json. This specific \nimplementation uses the OpenAPI Responses API.\n\nContents:\n\n* `agent-baz.py` - System prompt, functions / tools, and a simple input loop\n* `mincore.py` - OpenAI wrapper class which handles all the function translation work\n\n\n## Try it out\n\n```\n# virtual environment (using uv)\n\u003e uv venv\n\u003e source .venv/bin/activate\n\u003e uv pip install -r requirements.txt\n\n# configure an openai api key\necho 'BAZ_OPENAI_API_KEY=\"abc-123\"' \u003e .env\n\n# run\n\u003e python ./agent/agent-baz.py\n```\n\n\n## Example run\n\n```\n$python ./agent/agent-baz.py\n\n\u003e\u003e\u003e You: Hey!\n\nINFO:mincore:Bootstrapping conversation\nINFO:httpx:HTTP Request: POST https://api.openai.com/v1/responses \"HTTP/1.1 200 OK\"\nINFO:mincore:Sending user message with functions to LLM\nINFO:httpx:HTTP Request: POST https://api.openai.com/v1/responses \"HTTP/1.1 200 OK\"\n\n\u003e\u003e\u003e Agent:  Hey there! How can I help today? I can generate:\n- a random color\n- a random number\n- or both\n\nIf you want a number, tell me the min and max. Or I can just give you a color and a number (1-100) right now—your call.\n\n\u003e\u003e\u003e You: Can I get a color please\n\nINFO:mincore:Sending user message with functions to LLM\nINFO:httpx:HTTP Request: POST https://api.openai.com/v1/responses \"HTTP/1.1 200 OK\"\nINFO:mincore:Executing function: get_color with args: {}\nINFO:mincore:Function: get_color executed with result: red\nINFO:httpx:HTTP Request: POST https://api.openai.com/v1/responses \"HTTP/1.1 200 OK\"\n\n\u003e\u003e\u003e Agent:  Here's a random color: red.\n\nWould you like another color, or a random number as well (tell me a min and max if you want a specific range)?\n\n\u003e\u003e\u003e You: A number now\n\nINFO:mincore:Sending user message with functions to LLM\nINFO:httpx:HTTP Request: POST https://api.openai.com/v1/responses \"HTTP/1.1 200 OK\"\nINFO:mincore:Executing function: get_number with args: {}\nINFO:mincore:Function: get_number executed with result: 20\nINFO:httpx:HTTP Request: POST https://api.openai.com/v1/responses \"HTTP/1.1 200 OK\"\n\n\u003e\u003e\u003e Agent:  Here's a random number: 20.\n\nWould you like another number (maybe with a specific range), or should I give you another color as well?\n\n\u003e\u003e\u003e You: How about two colors and a number?\n\nINFO:mincore:Sending user message with functions to LLM\nINFO:httpx:HTTP Request: POST https://api.openai.com/v1/responses \"HTTP/1.1 200 OK\"\nINFO:mincore:Executing function: get_color with args: {}\nINFO:mincore:Function: get_color executed with result: blue\nINFO:mincore:Executing function: get_color with args: {}\nINFO:mincore:Function: get_color executed with result: orange\nINFO:mincore:Executing function: get_number with args: {}\nINFO:mincore:Function: get_number executed with result: 27\nINFO:httpx:HTTP Request: POST https://api.openai.com/v1/responses \"HTTP/1.1 200 OK\"\n\n\u003e\u003e\u003e Agent:  Here you go:\n- Color 1: blue\n- Color 2: orange\n- Number: 27\n\nWant me to generate another set, or specify a range for the number?\n\n\u003e\u003e\u003e You: ^C\n```\n\n## Note\n\nIf you want a good minimal kit for real development, try the `Agent` class and\nthe `function_tool` decorator from the openai-agents package:\n\n* https://github.com/openai/openai-agents\n* https://github.com/openai/openai-agents-python?tab=readme-ov-file#functions-example\n\nHere's an example that ports a variation of this minimal core to the agent sdk:\n* https://github.com/codycollier/miscellanea/blob/main/agent-colorbot/colorbot.py\n\nHave fun!\n\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fcodycollier%2Fminimal-agent-core","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fcodycollier%2Fminimal-agent-core","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fcodycollier%2Fminimal-agent-core/lists"}