Skip to main content

Towards a cognitive agentic framework

Project description

Cogents-core

CI PyPI version Ask DeepWiki

A comprehensive collection of essential building blocks for constructing cognitive multi-agent systems (MAS). Rather than building a full agent framework, Cogents provides a lightweight repository of key components designed to bridge the final mile in MAS development. Our philosophy focuses on modular, composable components that can be easily integrated into existing systems or used to build new ones from the ground up. 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.8.tar.gz (72.7 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.8-py3-none-any.whl (102.3 kB view details)

Uploaded Python 3

File details

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

File metadata

  • Download URL: cogents_core-0.1.8.tar.gz
  • Upload date:
  • Size: 72.7 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: poetry/2.1.4 CPython/3.12.5 Linux/6.15.9-201.fc42.x86_64

File hashes

Hashes for cogents_core-0.1.8.tar.gz
Algorithm Hash digest
SHA256 9b8d172af9ed42e77cc981050476684417cf30f1203141cd36e4531ba5e82a87
MD5 c61f741e273fdfd30cac69b2df56eede
BLAKE2b-256 9c1c6b2eb07ef313fcad81f5061a2fe3c4ac14175c65ad3a56a118a3db67214e

See more details on using hashes here.

File details

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

File metadata

  • Download URL: cogents_core-0.1.8-py3-none-any.whl
  • Upload date:
  • Size: 102.3 kB
  • Tags: Python 3
  • Uploaded using Trusted Publishing? No
  • Uploaded via: poetry/2.1.4 CPython/3.12.5 Linux/6.15.9-201.fc42.x86_64

File hashes

Hashes for cogents_core-0.1.8-py3-none-any.whl
Algorithm Hash digest
SHA256 9d910d82fb0d4dd2517bf5d2d28ce6b894f2c8af7da65755245d056990812d47
MD5 e88c75a9412d400ccc5809aac5f7753e
BLAKE2b-256 4cd2d826240cae767d39786125ac6a3974149ced30734d3aaee7e0073d82ffb4

See more details on using hashes here.

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