| Documentation | Discord |
CoreAgent is a lightweight and intuitive framework designed to make building intelligent agents straightforward. Focusing on simplicity, CoreAgent allows you to quickly integrate language models with custom tools to create powerful and versatile applications.
- Universal: Both coding, chatting, one
Agent
class handles them all! - Simplicity First: Ease of use and minimal boilerplate.
- Sharable Tool States: Share the same tool instances states across multiple agents.
- Built-in Tools: Lots of built-in tools to get you started fast!
To install CoreAgent, simply use pip:
pip install coreagent
Here's a basic example demonstrating how to use CoreAgent:
from coreagent import Agent
import urllib.request
import json
class IPTool:
def get_my_ip(self) -> str:
j = json.loads(urllib.request.urlopen("https://api.ipify.org/?format=json").read().decode())
return j['ip']
s = Agent()
s.register_tool(IPTool())
s.chat("What's my IP address? ")
CoreAgent makes it easy to integrate your own custom functionalities as tools. To register a tool, you simply need to:
- Define a Python class for your tool.
- Implement the methods you want to expose to the agent. Use docstrings to provide descriptions for your methods. These descriptions can be used by the agent to understand how to use the tool.
- Instantiate your tool class.
- Register the instance with the
ChatSession
using theregister_tool()
method.
Refer to the example above for a practical demonstration of tool registration.
Currently, it relies on guided_grammar
function from vLLM
to function correctly, so you have to use vLLM
as inference server.
- Basic universal agent framework.
- Remove
guided_grammar
restriction, allow general LLM usage (DeepSeek API, GPT3.5/4/4o API, Qwen API, etc. ) - More intuitive simplified examples, alowing hands-on try-outs.
- RAG-based memory module.
Contributions to CoreAgent are welcome! If you have ideas for improvements, bug fixes, or new features, please feel free to open an issue or submit a pull request.
Brought to you by Shanghai Glacies Technologies Co,. LTD.
GNU Lesser General Public License v3.0
https://www.gnu.org/licenses/lgpl-3.0.en.html