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 🧠 an open-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.2

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.2
File Size Uploaded
polycog_cognition-1.0.2.tar.gz 73.2 kB Details

Built distribution (wheel)

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

Total release size: 126.5 kB

Release files / polycog_cognition-1.0.2.tar.gz

Download URL polycog_cognition-1.0.2.tar.gz
Size 73.2 kB
Tags Source
SHA-256 checksum
How to use checksums
87adcbae606eba6da61670388a36cebe970369eeacb3ab10f16a1067b6279fb2
BLAKE2b-256 checksum
How to use checksums
70c81766662639bd5e1ecceac71e917077894a5b2d6bbfc06478436fde237305
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 14, 2026.

Transparency log

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

Download URL polycog_cognition-1.0.2-py3-none-any.whl
Size 53.4 kB
Tags Python 3
SHA-256 checksum
How to use checksums
78ed6337ccf7cc07fb15954e7bf220335ff087b9fd4976488810bb4c2f4bd7a4
BLAKE2b-256 checksum
How to use checksums
7f6994761f476163ab932d93d652d18d6f3d148d32e4c25461cb9e5fa53ef3af
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 14, 2026.

Transparency log

Release history Release notifications | RSS feed

This release

1.0.2 This release

2 release files

1.0.1

2 release files

1.0.0

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