Skip to main content

Agent Core Framework

PyPI PyPI - Python Version CI License

Lightweight framework for multi-agent systems with optional LangChain support.

A small, extensible package to register, orchestrate and implement agents that process tasks in a coordinated way.

Features

  • Registration and orchestration of multiple agents.
  • Simple base interface to implement custom agents.
  • Extension points to integrate LLMs (for example, via LangChain adapters).
  • Unit tests included for core components.

Project information

  • Package name: agent-core-framework
  • Current version: 0.1.6
  • Dependencies and metadata are declared in pyproject.toml.

Installation

Install from PyPI:

pip install agent-core-framework

Install from the repository (editable mode):

git clone https://github.com/msalsas/agent-core-framework.git
cd agent-core-framework
pip install -e .

Quick example

from agent_core_framework import BaseAgent, AgentResponse, AgentTask, MultiAgentOrchestrator

class MyAgent(BaseAgent):
    def __init__(self, name: str):
        super().__init__(name)
        # declare the task types this agent can handle
        self.supported_tasks = ["simple"]

    def process(self, task: AgentTask) -> AgentResponse:
        # Simple implementation: return success with data and the agent name
        return AgentResponse(success=True, data={"result": "ok"}, agent_name=self.name, task_id=task.id)

orchestrator = MultiAgentOrchestrator()
my_agent = MyAgent("my-agent")
orchestrator.register_agent(my_agent)

# Create a task using AgentTask
task = AgentTask(type="simple", payload={"value": 42})
response = orchestrator.process_task(task)
print(response.json())

This example shows the basic idea: implement process in agents, register them into a MultiAgentOrchestrator, and process tasks with process_task.

API summary

  • BaseAgent — Base class to implement agents. Implement process(self, task) and provide name in the constructor.
  • AgentResponse — Standard response structure: success: bool, data: dict, error: Optional[str], agent_name: str.
  • AgentTask — Representation of the task sent to an agent (use AgentTask(type=..., payload=...)).
  • MultiAgentOrchestrator — Orchestrator to register agents (register_agent(agent)) and process tasks (process_task(task)).
  • ServiceRegistry — Central registry for agents/services (if applicable).

See the source code under agent_core_framework/ for exact names and signatures.

LangChain integration

The project is designed to allow adapters that wrap LLMs or prompt chains. To integrate LangChain:

  1. Create an agent that uses the LangChain client API inside its process method.
  2. Register that agent in the MultiAgentOrchestrator like any other agent.

This makes it easy to combine LLMs with programmatic logic and orchestration across multiple agents.

Running tests

Dependencies are declared in pyproject.toml. Use your project's chosen tool to install them:

  • With Poetry (recommended if you use Poetry):
poetry install
poetry run pytest -q
  • With pip (install package and pytest manually):
pip install -e .         # installs the package; does not install dev deps from pyproject
pip install pytest       # install pytest separately
pytest -q

If your workflow uses another tool (pip-tools, pipx, tox, etc.), use the corresponding commands to install dev dependencies before running pytest.

(There are tests in the tests/ folder — run pytest to check them.)

Publishing to PyPI (GitHub Actions + local)

This repository already includes a GitHub Actions workflow at .github/workflows/publish.yml that builds distributions and publishes to PyPI when a git tag matching v*.*.* is pushed (for example v0.1.0). The workflow expects a repository secret named PYPI_API_TOKEN containing a PyPI API token.

Quick notes:

  • Workflow trigger: push a tag like v0.1.0.
  • GitHub action: pypa/gh-action-pypi-publish@release/v1 uploads using username __token__ and the token as the password.
  • Dependencies for build are taken from pyproject.toml and the action installs build and twine.

You mentioned you already created and set the secret with gh secret set PYPI_API_TOKEN --body "...". Good — with that in place you can publish by creating and pushing a tag.

To publish (create tag and push):

git tag v0.1.0
git push origin v0.1.0

After the push the workflow will run and, if successful, upload the package to PyPI and create a GitHub Release.

Local test publish (recommended first on TestPyPI):

  1. Build the distributions locally:
python -m pip install --upgrade build twine
python -m build
  1. Upload to TestPyPI (use the token you created on https://test.pypi.org if you created one there):
python -m twine upload --repository testpypi -u __token__ -p "pypi-XXXXXXXXXXXXXXXXXXXX" dist/*
  1. Upload to real PyPI (use your real PyPI token and be careful — this publishes publicly):
python -m twine upload -u __token__ -p "pypi-XXXXXXXXXXXXXXXXXXXX" dist/*

Notes:

  • When using twine, the username must be exactly __token__ and the token value serves as the password.
  • TestPyPI tokens are different from PyPI tokens.

If you prefer not to paste tokens on the command line, set TWINE_PASSWORD or use a .pypirc file with the token (but never commit secrets).

Troubleshooting common issues:

  • 403 Unauthorized: verify you're using the correct token for the correct server (TestPyPI vs PyPI) and that the token has the right scope.
  • Workflow didn't run: confirm you pushed a tag (not just a commit) and that the tag follows vX.Y.Z format.
  • Invalid project name when creating a scoped token: ensure the name you used on PyPI matches name in pyproject.toml exactly (agent-core-framework).

Best practices

  • Limit the token scope to the project when possible and rotate tokens periodically.
  • Keep tokens in GitHub Secrets or a password manager — never commit them.
  • Use TestPyPI to validate uploads before pushing to the real PyPI.

Contributing

  1. Open an issue describing your proposal or bug.
  2. Create a branch feature/my-change or fix/my-bug.
  3. Add tests and documentation where applicable.
  4. Open a pull request and describe your changes.

License

MIT — see the LICENSE file.

Release files for agent-core-framework 0.1.6

For a detailed explanation of source distributions (sdists) and built distributions (wheels), please see the package formats documentation.

Source distribution (sdist)

Source distribution for agent-core-framework 0.1.6
File Size Uploaded
agent_core_framework-0.1.6.tar.gz 11.8 kB Details

Built distribution (wheel)

Table of built distributions (wheels) for agent-core-framework 0.1.6
File Interpreter ABI Platform
agent_core_framework-0.1.6-py2.py3-none-any.whl Python 3, Python 2 none any Details

Total release size: 21.3 kB

Release files / agent_core_framework-0.1.6.tar.gz

Download URL agent_core_framework-0.1.6.tar.gz
Size 11.8 kB
Tags Source
SHA-256 checksum
How to use checksums
2c3e0abe1eec312d5fb015715728c25df92dd51992d688fc06c3a55ac715a7a6
BLAKE2b-256 checksum
How to use checksums
5d34385e23232ab876f5b6d5e66e43a99f174ec4461ead114cf0b415f928a113
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via twine/6.1.0 CPython/3.13.7

Release files / agent_core_framework-0.1.6-py2.py3-none-any.whl

Download URL agent_core_framework-0.1.6-py2.py3-none-any.whl
Size 9.5 kB
Tags Python 2 Python 3
SHA-256 checksum
How to use checksums
dad906b78c4c96a8608419be685fcca263201c8166cfa3bea8202c3f509a9435
BLAKE2b-256 checksum
How to use checksums
1a1beb73e7e21f9d77841d77c5eea978717aa61643dbfa953afeb9f77cf2a883
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via twine/6.1.0 CPython/3.13.7

Release history Release notifications | RSS feed

This release

0.1.6 This release

2 release files

0.1.1

2 release files

Anthropic, PBC Visionary sponsor Bloomberg Visionary sponsor Hudson River Trading Visionary sponsor Meta Visionary sponsor NVIDIA Visionary sponsor Microsoft Sustainability sponsor Depot Continuous Integration AWS Cloud computing and Security Sponsor Datadog Monitoring Fastly CDN Google Download Analytics Sentry Error logging StatusPage Status page