Skip to main content

Towards a cognitive agentic framework

Project description

Cogents

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

Extensible Resources & Capabilities

  • Web search: Tavily and Google AI Search integration
  • Vector stores: Weaviate and PostgreSQL with pgvector support
  • Semantic search: Integrated semantic web search with document processing
  • Voice processing: Smart voice transcription and processing features

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

Agent Gallery

  • Askura Agent: Advanced conversation and memory management agent
  • Seekra Agent: Research-focused agent with web search capabilities
  • Mem Agent: Memory-focused agent (coming soon)
  • Cogito Agent: Cognitive reasoning agent (coming soon)

Project Structure

cogents/
├── agents/           # Agent implementations
├── base/            # Base classes and models
├── common/          # Shared utilities and LLM integrations
├── goalith/         # Goal management and planning
├── memory/          # Memory management (on plan)
├── orchestrix/      # Global orchestration (on plan)
├── resources/       # External service integrations
└── toolify/         # Tool management and execution

Creating a New Agent

From Base Classes

Start with the base agent classes in cogents.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

Documentation

For detailed documentation, visit: https://cogents.readthedocs.io/ (under construction)

License

MIT License - see LICENSE file for details.

Acknowledgment

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.0.tar.gz (64.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.0-py3-none-any.whl (93.8 kB view details)

Uploaded Python 3

File details

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

File metadata

  • Download URL: cogents_core-0.1.0.tar.gz
  • Upload date:
  • Size: 64.9 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: poetry/2.1.3 CPython/3.11.11 Darwin/24.6.0

File hashes

Hashes for cogents_core-0.1.0.tar.gz
Algorithm Hash digest
SHA256 35ecc0cbe49044eba994cf53aba3cc6bfe698445aaf3e7551e00a20d6798ba9c
MD5 2175abb7616ce438744f73ead48098c7
BLAKE2b-256 c663fb54f2e9d358b905828cc17f8afdb2ae5e4d6ecaf856c3752407ee3f69b2

See more details on using hashes here.

File details

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

File metadata

  • Download URL: cogents_core-0.1.0-py3-none-any.whl
  • Upload date:
  • Size: 93.8 kB
  • Tags: Python 3
  • Uploaded using Trusted Publishing? No
  • Uploaded via: poetry/2.1.3 CPython/3.11.11 Darwin/24.6.0

File hashes

Hashes for cogents_core-0.1.0-py3-none-any.whl
Algorithm Hash digest
SHA256 cb208bae7179448ba9365f2197389268f88b2030414b03c5f82f43013ac1e39a
MD5 2549dda6bba9679c197c81738a884e7e
BLAKE2b-256 517e3b544c3d7ce0ac5bb549454a4055734623928cd24152679b1cce1adb0b48

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