Skip to content
PACKS

Building Your First Pack

Create a Cognithor agent pack from scratch in under five minutes. Install the SDK, scaffold a project, register a tool, and test it locally.

A pack is an agent extension — a self-contained module that adds new MCP tools, lead sources, or REST endpoints to Cognithor. Packs are installed as directories with a manifest, an entry point, and a EULA. They can be free (Apache 2.0) or paid (proprietary, sold via the marketplace).

Prerequisites

  • Python 3.12+
  • Cognithor installed and running (cognithor --version)
  • The SDK for type hints: pip install cognithor-sdk

Scaffold a new pack

cognithor pack create --name my-weather --namespace my-namespace

This creates a ready-to-run pack at ~/.cognithor/packs/my-namespace/my-weather/ with a hello-world tool already wired.

Project layout

my-namespace/my-weather/
  pack_manifest.json    # metadata, version, EULA hash
  pack.py               # entry point — register() wires your tools
  eula.md               # license text (SHA-256 pinned in manifest)
  src/                   # your implementation code
  tests/                 # unit tests
  catalog/               # marketing content for the marketplace

Your first tool

Open pack.py — the scaffolder already created a hello-world tool:

from cognithor.packs.interface import AgentPack, PackContext


class Pack(AgentPack):
    def register(self, context: PackContext) -> None:
        if context.mcp_client is None:
            return

        async def hello(name: str = "World") -> str:
            return f"Hello, {name}!"

        context.mcp_client.register_builtin_handler(
            "my_weather_hello",
            hello,
            description="Say hello",
            input_schema={
                "type": "object",
                "properties": {
                    "name": {"type": "string", "description": "Who to greet"},
                },
            },
        )

    def unregister(self, context: PackContext) -> None:
        pass

Install and test locally

cognithor pack install ~/.cognithor/packs/my-namespace/my-weather/
cognithor

Then ask the agent: "Use the my_weather_hello tool to greet Alice." — you should see the tool execute in the PGE loop.

Next steps