Skip to main content

Towards a cognitive agentic framework

Project description

Cogents-core

CI PyPI version Ask DeepWiki

This is part of project Cogents, an initiative to develop a cognitive, computation-driven agentic system. This repo the foundational abstractions (Agent, Memory, Tool, Goal, Orchestration, and more) along with essential modules such as LLM clients, logging, message buses, model routing, and observability. For the underlying philosophy, refer to my talk on MAS (link).

Core Modules

Cogents offers a comprehensive set of modules for creating intelligent agent-based applications:

LLM Integration & Management

  • Multi-model support: OpenAI, Google GenAI (via OpenRouter), Ollama, and LlamaCPP
  • Advanced routing: Dynamic complexity-based and self-assessment routing strategies
  • Tracing & monitoring: Built-in token tracking and Opik tracing integration
  • Extensible architecture: Easy to add new LLM providers

Goal Management & Planning

  • Goal decomposition: LLM-based and callable goal decomposition strategies
  • Conflict detection: Automated goal conflict identification and resolution
  • Replanning: Dynamic goal replanning capabilities

Tool Management

  • Tool registry: Centralized tool registration and management
  • Execution engine: Robust tool execution with error handling
  • Repository system: Organized tool storage and retrieval

Memory Management

  • Under development

Orchestration

  • Under development

Project Structure

cogents/core
├── base/            # Base classes and models
├── goalith/         # Goal management and planning
├── memory/          # Memory management (on plan)
├── orchestrix/      # Global orchestration (on plan)
└── toolify/         # Tool management and execution

Creating a New Agent

From Base Classes

Start with the base agent classes in cogents_core.base to create custom agents with full control over behavior and capabilities.

Base Agent Class Hierarchy

BaseAgent (abstract)
├── Core functionality
│   ├── LLM client management
│   ├── Token usage tracking
│   ├── Logging capabilities
│   └── Configuration management
│
├── BaseGraphicAgent (abstract)
│   ├── LangGraph integration
│   ├── State management
│   ├── Graph visualization
│   └── Error handling patterns
│   │
│   ├── BaseConversationAgent (abstract)
│   │   ├── Session management
│   │   ├── Message handling
│   │   ├── Conversation state
│   │   └── Response generation
│   │
│   └── BaseResearcher (abstract)
│       ├── Research workflow
│       ├── Source management
│       ├── Query generation
│       └── Result compilation
│           └── Uses ResearchOutput model
│               ├── content: str
│               ├── sources: List[Dict]
│               ├── summary: str
│               └── timestamp: datetime

Key Inheritance Paths:

  • BaseAgent: Core functionality (LLM client, token tracking, logging)
  • BaseGraphicAgent: LangGraph integration and visualization
  • BaseConversationAgent: Session management and conversation patterns
  • BaseResearcher: Research workflow and structured output patterns

From Existing Agents

Use well-constructed agents like Seekra Agent as templates:

from cogents_core.agents.seekra_agent import SeekraAgent

# Extend Seekra Agent for custom research tasks
class CustomResearchAgent(SeekraAgent):
    def __init__(self, *args, **kwargs):
        super().__init__(*args, **kwargs)
        # Add custom functionality
        
    def custom_research_method(self):
        # Implement custom research logic
        pass

Install

pip install -U cogents-core

License

MIT License - see LICENSE file for details.

Project details


Download files

Download the file for your platform. If you're not sure which to choose, learn more about installing packages.

Source Distribution

cogents_core-0.1.9.tar.gz (70.9 kB view details)

Uploaded Source

Built Distribution

If you're not sure about the file name format, learn more about wheel file names.

cogents_core-0.1.9-py3-none-any.whl (95.6 kB view details)

Uploaded Python 3

File details

Details for the file cogents_core-0.1.9.tar.gz.

File metadata

  • Download URL: cogents_core-0.1.9.tar.gz
  • Upload date:
  • Size: 70.9 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? Yes
  • Uploaded via: twine/6.1.0 CPython/3.13.7

File hashes

Hashes for cogents_core-0.1.9.tar.gz
Algorithm Hash digest
SHA256 065dc1358f238f4610ce21c93ec03b95a72b8b7ae06843f6cb59fa7e586135ed
MD5 cd8ade1e1e15d8da569c953fe293da6a
BLAKE2b-256 7fa421d45eb1b2b1b7bddf8a9af797fa6491ba3c60bebdd23601b85a1b2d6ad7

See more details on using hashes here.

Provenance

The following attestation bundles were made for cogents_core-0.1.9.tar.gz:

Publisher: release.yml on mirasurf/cogents-core

Attestations: Values shown here reflect the state when the release was signed and may no longer be current.

File details

Details for the file cogents_core-0.1.9-py3-none-any.whl.

File metadata

  • Download URL: cogents_core-0.1.9-py3-none-any.whl
  • Upload date:
  • Size: 95.6 kB
  • Tags: Python 3
  • Uploaded using Trusted Publishing? Yes
  • Uploaded via: twine/6.1.0 CPython/3.13.7

File hashes

Hashes for cogents_core-0.1.9-py3-none-any.whl
Algorithm Hash digest
SHA256 4fb63944274d792d7aabf36f7fd56e4ed6bb59188432156aa19f27fe46a84540
MD5 12e312af3f2563d689fdd3aa9c17ee45
BLAKE2b-256 dbffca51f45d9e70672ef37be23f9a07aa23f66dd1f697198ab5f61830a5bc9d

See more details on using hashes here.

Provenance

The following attestation bundles were made for cogents_core-0.1.9-py3-none-any.whl:

Publisher: release.yml on mirasurf/cogents-core

Attestations: Values shown here reflect the state when the release was signed and may no longer be current.

Supported by

AWS Cloud computing and Security Sponsor Datadog Monitoring Depot Continuous Integration Fastly CDN Google Download Analytics Pingdom Monitoring Sentry Error logging StatusPage Status page