Skip to main content

cognition

Checks PyPI Version License: FSL-1.1-ALv2 Python Version from PEP 621 TOML Discord

Website • Tutorials • Docs • Demo

Welcome to cognition 🧠 a fair-source agent framework in Python developed by Polycog, Inc.. The framework implements a neurosymbolic foundation for complex decision-making, natural language processing, structural knowledge representation, and logical & deterministic reasoning. It enables developers to build trustworthy cognitive agents - agents that are reliable (repeatable, provably correct reasoning), steerable (programmatic enforcement of behavior directives), and explainable (causal provenance of all decisions).

📖 Table of Contents

Core concepts

Agent Runtime Loop with Cogent

  • What it does: Manages the intelligent agent loop, bridging internal cognitive processes with external environmental sensors and actuators. details
  • Agentic AI Equivalent: Harness
  • Why use it: Separates core cognitive reasoning from raw API calls. This creates a clean boundary for safety checks, API mocking, and simulation testing.

Knowledge-Augmented DecisionProcess

  • What it does: Design agent behavior via a declarative, state-driven execution machine that matches the current environment state against explicit policy directives. details
  • Agentic AI Equivalent: Orchestrator; DAG workflows or skills.md
  • Why use it: Replaces non-deterministic LLM loops and brittle if-else scripts with declarative state control — enforcing safety guardrails, business logic, and policies at every step.

Structured Knowledge Representation with WorldGraph

  • What it does: Declares domain knowledge using strongly-typed, validated data models that can be inspected, queried, and mutated at runtime. details
  • Agentic AI Equivalent: engineered or raw prompt context
  • Why use it: Gives agents a typed, queryable source of truth instead of relying on fragile context windows or unvalidated text blobs.

4. Language Processing with Data Models

  • What it does: Uses LLMs for specific, constrained tasks—such as intent classification (EnumClassifier), generating natural language from facts (describe_facts), and extracting structured data (ModelPopulator) with automated context engineering. details
  • Agentic AI Equivalent: Structured Outputs
  • Why use it: Restricts LLM operations to strict input/output contracts, keeping non-deterministic text generation out of core control flow.

5. Verifiable Logical Reasoning with SearchPlanner

  • What it does: Solves planning sub-problems algorithmically to find an optimal sequence of actions to reach a specified target state. details
  • Agentic AI Equivalent: Chain-of-Thought
  • Why use it: Guarantees causal validity, completeness, and efficiency for complex multi-step problems without relying on probabilistic LLM guessing.

Note: This project is under active development. Expect regular updates and new features!

🏗️ Library Structure

The library is organized into specialized subpackages to handle distinct cognitive tasks:

cognition.cogent

Core modeling for your (cog)nitive ag(ent) and its surroundings.

  • cogent: Defines the fundamental agent loop and behaviors.
  • env: Tools for creating and interacting with environmental sensors & actuators.

cognition.decision

Frameworks for managing states and decision-making processes over time.

  • chain: Mechanisms for linking sequences of decisions.
  • core: Core functionality for decision-making.
  • dp: Functionality for knowledge-augmented decision processes.
  • stage: Mechanisms for decision processes based upon singular enumerated field.
  • state: Re-usable state augmentations.

cognition.knowledge

Handle structured data and complex ontologies.

  • organization: Modules for structuring and linking concepts.
  • representation: Primitives for representing facts, schemas, and semantic relationships.

cognition.language

Tools for interpreting and generating natural language.

  • classification: Text categorization and intent recognition.
  • description: Capabilities for generating human-readable descriptions of states or actions.
  • population: Tools for extracting data from text to populate knowledge representations.

cognition.reasoning

Engines for logical deduction and automated planning.

  • planning: Includes SearchPlanner and various state exploration strategies (DFS, BFS, UCS, A*) using classes like FrontierManager, PriorityQueue, and SearchState. Allows you to define Static and Dynamic transition options to navigate state spaces.

cognition.util

Helpful utilities to streamline your code, including...

  • enumeration: self-documenting and executing data.
  • functypes: convenience function type descriptors.
  • misc: utility code.

🚀 Getting Started

pip install polycog-cognition

Suggested exploration plan:

  1. Tutorials: thematic step-by-step guides, interactive Jupyter Notebooks, and complete Python reference implementations.
  2. Examples: fully coded mini-applications.
  3. Cookbook: annotated recipes related to library features.

📚 Documentation & Resources

For detailed technical descriptions & deep dives into the design philosophy:


© 2026 - Polycog, Inc.

Metadata

Release files for polycog-cognition 1.0.3

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

Source distribution (sdist)

Source distribution for polycog-cognition 1.0.3
File Size Uploaded Provenance
polycog_cognition-1.0.3.tar.gz 74.5 kB With provenance Details

Built distribution (wheel)

Table of built distributions (wheels) for polycog-cognition 1.0.3
File Interpreter ABI Platform
polycog_cognition-1.0.3-py3-none-any.whl Python 3 none any Details

Total release size: 128.4 kB

Release files / polycog_cognition-1.0.3.tar.gz

Download URL polycog_cognition-1.0.3.tar.gz
Size 74.5 kB
Tags Source
SHA-256 checksum
How to use checksums
c7cb31ca765ca1c665927dce74fc47bb87344179337a2affb3caf07ef1274566
BLAKE2b-256 checksum
How to use checksums
f15b63e261ab920b6a2200a81e4ca90d286cc83a5982f9a3c422ca10f0a26b74
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
Yes
Uploaded via twine/7.0.0 CPython/3.13.14

Provenance

Provenance describes where a file came from. On PyPI, provenance is shared via attestations, which provide a verifiable record of the build or publishing details. View details, limitations and caveats.

PyPI Publish Attestation

PyPI verified that this artifact, at this checksum, originated from the publisher listed below.

Signed by GitHub Actions, verified by PyPI on Oct 19, 2026.

Transparency log

Release files / polycog_cognition-1.0.3-py3-none-any.whl

Download URL polycog_cognition-1.0.3-py3-none-any.whl
Size 53.9 kB
Tags Python 3
SHA-256 checksum
How to use checksums
bd5badb77493ceea0df7662ec4a6cf071d7914c2349edd12b66a4da6dc4c8af9
BLAKE2b-256 checksum
How to use checksums
489adbfe0c65ae2ce3cd5276c99d9e4e04f3f69185c3e9c6f35e865f60a9e85f
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
Yes
Uploaded via twine/7.0.0 CPython/3.13.14

Provenance

Provenance describes where a file came from. On PyPI, provenance is shared via attestations, which provide a verifiable record of the build or publishing details. View details, limitations and caveats.

PyPI Publish Attestation

PyPI verified that this artifact, at this checksum, originated from the publisher listed below.

Signed by GitHub Actions, verified by PyPI on Oct 19, 2026.

Transparency log

Security for polycog-cognition 1.0.3

Provenance

Provenance describes where a file came from. On PyPI, provenance is shared via attestations, which provide a verifiable record of the build or publishing details. View details, limitations and caveats.

Full provenance

All 2 files in this release have been uploaded with provenance metadata.

Select from 2 files

Attestation for polycog_cognition-1.0.3.tar.gz

PyPI Publish Attestation

PyPI verified that this artifact, at this checksum, originated from the publisher listed below.

Signed by GitHub Actions, verified by PyPI on Oct 19, 2026.

Transparency log

A note on package security

PyPI is a repository for distributing packages, not a service for auditing them. While third-party security researchers and our staff do their best to detect and remove malicious packages, PyPI cannot guarantee the quality, security or suitability of any given package.

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