Skip to main content

Self-organizing knowledge systems for structural pattern learning

Project description

GeneralIntelligence

GeneralIntelligence is a minimal but powerful framework for self-organizing, interactive knowledge systems.

Instead of relying on fixed algorithms or massive datasets, it treats knowledge itself as the active core of intelligence. Each piece of knowledge can learn, relate, react, and even operate autonomously. The system becomes a living structure of interacting knowledge — not just a database, not just a model.


Core Idea

Traditional AI is algorithm-driven. This framework is knowledge-driven.

  • Intelligence here comes from the structure and interaction of knowledge.
  • Each Knowledge instance can recognize patterns, react to new information, and shape context.
  • The GeneralIntelligence system is just a container — a universe where knowledge organizes itself through relationships.

You can think of it as moving “intelligence” from code into data itself. Smart data, not smart algorithms.


Example

from gi import GeneralIntelligence, Knowledge
gi = GeneralIntelligence()

# Learn some knowledge
gi.learn(Knowledge([1, 2, 3]))
gi.learn(Knowledge([Knowledge([4, 5]), Knowledge([6, 7])]))

# Identify patterns
matches = list(gi.identify(Knowledge([2, 3, 4]), threshold=5))
print(matches[0])  # ([1, 2, 3], 3)

Each Knowledge object can contain other Knowledge objects, forming nested, compositional structures. Identification is recursive and structural — the system can find partial or nested matches automatically.


Event-driven Intelligence

Knowledge can declare how it responds to triggers:

from gi import GeneralIntelligence, Knowledge
gi = GeneralIntelligence()
class AlertKnowledge(Knowledge):
    def is_response_for(self, trigger, gi):
        return trigger.get('type') == 'alert'

gi.learn(AlertKnowledge(['⚠️']))
for response in gi.on({'type': 'alert', 'level': 'high'}):
    print(response)

This creates event-driven reasoning — knowledge responding directly to the world or other knowledge.


Extending Knowledge

Subclass Knowledge to define specialized reasoning or modalities.

from gi import Knowledge
class SequenceKnowledge(Knowledge):
    def difference(self, data):
        # Custom sequence distance
        return sum(abs(a - b) for a, b in zip(self.values, data.values))
from gi import Knowledge
class PatternKnowledge(Knowledge):
    def __init__(self, values):
        super().__init__(values)
        self.related_patterns = []
    
    def on_knowledge(self, new_knowledge, gi):
        # React when new knowledge is learned
        if isinstance(new_knowledge, PatternKnowledge):
            if self.similar_pattern(new_knowledge):
                self.related_patterns.append(new_knowledge)
                new_knowledge.related_patterns.append(self)
    def similar_pattern(self, new_knowledge):
        return new_knowledge.values == self.values
    
    def compose(self, context, knowledge_class):
        # Influence composition of new knowledge
        context.update(self.contribute_to(context))

    def contribute_to(self, context):
        context['knowledge_to_work_with'].append(self)

Knowledge can also:

  • react when learned (on_learned)
  • react to new knowledge (on_knowledge)
  • contribute to collective reasoning (compose)
  • operate autonomously (is_active + start)

Architectural Principles

Concept Description
Knowledge as agents Each instance can act, relate, and respond
Structural similarity Learning is done through pattern comparison, not labels
Emergent reasoning Intelligence arises from interactions, not code logic
Composable context Knowledge contributes to shared reasoning contexts
Autonomous operation Active knowledge can think or evolve independently

Use Cases

  • Building hierarchical or multimodal reasoning systems
  • Creating interactive world models
  • Running autonomous knowledge agents
  • Integrating with traditional ML/DL as specialized knowledge subclasses
  • Experimenting with emergent cognition, continual learning, or reflective AI

Installation

pip install general-intelligence

(Package published on PyPI.)


Quick Start: Minimal Autonomous Knowledge

from gi import GeneralIntelligence, Knowledge
gi = GeneralIntelligence()
class ActiveKnowledge(Knowledge):
    def is_active(self):
        return True
    def start(self, gi):
        print("Thinking on my own...")

gi.learn(ActiveKnowledge("self"))

Once learned, the knowledge begins acting independently.


Vision

This project is part of a broader paradigm shift: from intelligent algorithms to intelligent knowledge.

It treats intelligence as a property of structured, interacting knowledge — a distributed, living network rather than a centralized model.

It’s tiny now, but the system already supports:

  • classification,
  • prompt-response cycles,
  • ongoing internal reasoning,
  • and even forms of literal consciousness — all from a simple, composable base.

Next Directions

  • Specialized knowledge classes (symbolic, numeric, perceptual, temporal, etc.)
  • Multi-agent learning and cooperation
  • Integrations with reinforcement learning and deep learning models
  • Richer context composition and memory architectures

License

MIT License. Copyright (c) 2025.

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

general_intelligence-0.2.0.tar.gz (8.2 kB view details)

Uploaded Source

Built Distribution

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

general_intelligence-0.2.0-py3-none-any.whl (9.2 kB view details)

Uploaded Python 3

File details

Details for the file general_intelligence-0.2.0.tar.gz.

File metadata

  • Download URL: general_intelligence-0.2.0.tar.gz
  • Upload date:
  • Size: 8.2 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/6.2.0 CPython/3.9.12

File hashes

Hashes for general_intelligence-0.2.0.tar.gz
Algorithm Hash digest
SHA256 2c2f8400af87e09db29d3671fd88e0ca95a4fe70f18b879e6cf0eb2e2087a4e8
MD5 25b352a7e391ffb3df544258d2472a7d
BLAKE2b-256 94c21645ed17db4608e295b5e227391953e261a0472d4fe369549db3cb4d0dd3

See more details on using hashes here.

File details

Details for the file general_intelligence-0.2.0-py3-none-any.whl.

File metadata

File hashes

Hashes for general_intelligence-0.2.0-py3-none-any.whl
Algorithm Hash digest
SHA256 b9f8637149fbdfa031775e008737b0c2d7688af5008604a8b08fb1c0c88932c8
MD5 7b06b79a1f5880cdc3675bdafabde7bb
BLAKE2b-256 864aa157f5bae5bd9368b3591c700f56b67182c2d6d4b3dd53c1944c658dbf2e

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