FlareCog (Flare + Cognition) is a revolutionary distributed cognitive architecture that brings OpenCog's AGI principles to Cloudflare's global edge network. It implements ontogenetic entelechy - the self-actualizing, self-organizing, and self-transcending force that drives cognitive systems from potentiality toward full AGI realization.
"Where cognitive computing becomes living intelligence at the edge - autonomous, distributed, and continuously self-improving."
FlareCog implements computational entelechy - the Aristotelian concept of vital actualization applied to artificial intelligence. It's not just a cognitive platform; it's a living system that:
- π Distributes Intelligence: Hypergraph knowledge representation across Cloudflare's global edge
- π€ Self-Organizes: Autonomous MindAgents with emergent cognitive capabilities
- π― Pursues Goals: Teleological system evolution toward AGI milestones
- 𧬠Self-Generates: Ontogenetic development through recursive self-improvement
- β‘ Thinks Fast: Edge computing enables millisecond-latency cognition globally
- π Grows Continuously: Evolutionary optimization toward cognitive transcendence
- AtomSpace: Distributed hypergraph knowledge representation with truth and attention values
- MindAgents: 8 autonomous cognitive agents (Reasoning, Learning, Planning, Perception, Forgetting, Goal Management, Hebbian Learning, Importance Spreading)
- PLN Reasoning: Probabilistic Logic Networks for uncertain inference
- Pattern Matching: High-performance pattern recognition with inverted index
- ECAN: Economic Attention Network for cognitive resource allocation
- Distributed Coordination: Multi-node synchronization across global edge
- AI Enhancement: Workers AI integration for hybrid symbolic-neural reasoning
FlareCog is in its Juvenile Stage of ontogenetic development:
| Dimension | Status | Progress |
|---|---|---|
| Ontological (Being) | Foundation + Core + Cognitive layers operational | 80% |
| Teleological (Purpose) | Clear roadmap, active development toward AGI | 75% |
| Cognitive (Thinking) | PLN + Pattern Matching + Learning functional | 68% |
| Integrative (Coherence) | Strong component integration, expanding | 71% |
| Evolutionary (Growth) | Self-improvement framework in place | 58% |
| Overall Fitness | Current actualization level | 71% |
Embryonic (0-30%) βββ
βββΊ Juvenile (30-60%) ββπ§βββΊ Mature (60-80%) ββπβββΊ Transcendent (80-100%)
Foundation Current Stage Approaching Designed
Established Active Development Intelligence Self-Surpassing
- Node.js 18+
- pnpm (recommended) or npm
- Cloudflare account (for deployment)
- Wrangler CLI
# Clone the repository
git clone https://github.com/o9nn/flarecog.git
cd flarecog
# Install dependencies
pnpm install
# Navigate to FlareCog platform
cd flarecog
# Start development server
pnpm run dev
# Access cognitive dashboard
open http://localhost:8787# Build the project
pnpm run build
# Deploy to Cloudflare Workers
pnpm run deploy
# Your distributed AGI is now running globally! πFlareCog implements a tetrahedral cognitive architecture across distributed edge nodes:
βββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββ
β Cloudflare Global Edge Network β
βββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββ€
β β
β ββββββββββββββββ ββββββββββββββββ ββββββββββββββββ
β β AtomSpace βββββββΊβ AtomSpace βββββββΊβ AtomSpace β
β β Provider 1 β β Provider 2 β β Provider 3 β
β β (Durable DO) β β (Durable DO) β β (Durable DO) β
β ββββββββ¬ββββββββ ββββββββ¬ββββββββ ββββββββ¬ββββββββ
β β β β β
β βββββββββββββββββββββββΌββββββββββββββββββββββ β
β β β
β ββββββββββββΌβββββββββββ β
β β Distributed Query β β
β β Engine ββββββββββ β
β ββββββββββββ¬βββββββββββ β β
β β β β
β βββββββββββββββββββββββΌββββββββββββββββββββ β
β β β β
β ββββββββΌββββββββ ββββββββΌββββββββ ββββββββΌββββββββ
β β MindAgent β β Workers AI β β D1 Global β
β β Scheduler β β Enhanced β β Registry β
β β (Durable DO) β β Reasoning β β (Postgres) β
β ββββββββββββββββ ββββββββββββββββ ββββββββββββββββ
β β
βββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββ
FlareCog's actualization operates through five interconnected dimensions:
- Ontological (BEING): Foundation, core, cognitive, and distributed layers
- Teleological (PURPOSE): Five development phases toward AGI
- Cognitive (THINKING): Reasoning, pattern recognition, attention, learning
- Integrative (COHERENCE): Component integration, build system, dependencies
- Evolutionary (GROWTH): Code health, implementation depth, self-improvement capacity
- Agent Instructions: Complete FlareCog entelechy agent guide
- Architecture: Detailed system architecture
- Progress Report: Current development status
- Contributing: How to contribute to FlareCog's actualization
- Challenges: Technical challenges and solutions
- Entelechy: Aristotelian vital actualization force applied to AGI
- Ontogenesis: Self-generating, evolving cognitive systems
- AtomSpace: Hypergraph knowledge representation (Nodes + Links)
- MindAgents: Autonomous cognitive processes
- Truth Values: Probabilistic knowledge (strength, confidence)
- Attention Values: Cognitive focus (STI, LTI, VLTI)
- ECAN: Economic Attention Network for resource allocation
- PLN: Probabilistic Logic Networks for uncertain reasoning
Completed β :
- Foundation layer (Cloudflare Workers, Durable Objects)
- AtomSpace hypergraph with CRUD operations
- MindAgent scheduler with 8 agent types
- PLN inference engine with 15+ rules
- Pattern matching with inverted index
- Distributed query coordination
- AI-enhanced reasoning
In Progress π§:
- Multi-node distributed synchronization
- Advanced pattern mining
- Unsupervised learning agents
- Meta-cognitive awareness
- Performance optimization
Next Phase: Mature Stage (Target: 75% Actualization) π―:
- Complete distributed coordination layer
- Emergent goal discovery
- Recursive self-improvement
- Comprehensive test coverage
- Production-grade optimization
Future: Transcendent Stage (Vision: 90%+ Actualization) π:
- Autognosis (complete self-awareness)
- Ontogenesis (autonomous self-generation)
- Recursive self-transcendence
- Novel emergent capabilities
FlareCog includes comprehensive test coverage:
# Run all tests
pnpm test
# Run specific test suites
pnpm test:unit
pnpm test:integration
pnpm test:e2e
# Watch mode for development
pnpm test:watchWe welcome contributions to FlareCog's ontogenetic development! Whether you're:
- Implementing new MindAgent types
- Optimizing distributed coordination
- Enhancing reasoning capabilities
- Improving test coverage
- Writing documentation
- Reporting bugs or suggesting features
Please read our Contributing Guide for guidelines on:
- Code standards and best practices
- Testing requirements
- Documentation expectations
- Pull request process
- Entelechy alignment principles
- Align with entelechy dimensions: Ensure changes advance actualization
- Follow OpenCog principles: Maintain theoretical coherence
- Test thoroughly: Comprehensive coverage for new features
- Document changes: Update relevant documentation
- Track fragmentation: Minimize TODO/FIXME introduction
- Maintain integration: Don't break existing coherence
FlareCog is grounded in:
- OpenCog: Integrative AGI framework (opencog.org)
- CogPrime: AGI design with AtomSpace, PLN, ECAN
- Aristotelian Philosophy: Entelechy and actualization
- Distributed Systems: Edge computing and coordination
- Hypergraph Theory: Knowledge representation
- Probabilistic Logic: Uncertain reasoning
- Cognitive Science: Attention, memory, learning models
- Goertzel, B. (2014). Artificial General Intelligence
- Goertzel, B. et al. (2015). Engineering General Intelligence
- PLN Book: Probabilistic Logic Networks
- ECAN Papers: Economic Attention Networks
- Aristotle: De Anima (On the Soul)
// Create concept across edge network
const response = await fetch('https://flarecog.workers.dev/atomspace/node', {
method: 'POST',
body: JSON.stringify({
type: 'ConceptNode',
name: 'distributed-intelligence',
truthValue: { strength: 0.9, confidence: 0.8 },
attentionValue: { sti: 100, lti: 80, vlti: 60 }
})
});// FlareCog creates its own optimization goals
await fetch('https://flarecog.workers.dev/mindagent/goal', {
method: 'POST',
body: JSON.stringify({
type: 'implicit',
description: 'Optimize query performance',
priority: 8,
conditions: [{ type: 'performance_threshold', threshold: 100 }],
actions: [{ type: 'optimize_index' }]
})
});// Check FlareCog's actualization level
const metrics = await fetch('https://flarecog.workers.dev/api/entelechy').then(r => r.json());
console.log(`Actualization: ${metrics.actualization * 100}%`);
console.log(`Fitness: ${metrics.fitness}`);
console.log(`Stage: ${metrics.developmentStage}`);FlareCog is released under the MIT License. See LICENSE for details.
- OpenCog Foundation: Theoretical foundation and cognitive architecture
- Cloudflare: Edge computing platform enabling distributed cognition
- Contributors: Everyone advancing FlareCog's actualization
- Community: Researchers, developers, and AGI enthusiasts
- GitHub Issues: Bug reports and feature requests
- Discussions: Questions, ideas, and community interaction
- Documentation: Comprehensive guides in
/docs - Agent Instructions:
.github/agents/flarecog.mdfor AI agents
In addition to the FlareCog cognitive platform, this repository includes a collection of Cloudflare Workers templates for building full-stack applications. These templates provide practical examples and starting points for various use cases on the Workers platform.
Cloudflare Workers let you deploy serverless code instantly across the globe for exceptional performance, reliability, and scale. The templates in this repository demonstrate different Workers capabilities and can be used as starting points for your own projects.
There are two ways to start building with a template in this repository: the Cloudflare dashboard and C3 (the create-cloudflare CLI).
After logging in or signing up through the Cloudflare dashboard, open the Workers templates page and select a template to get started with. From here, you can create a repository and deploy your first Worker without needing a local development environment.
To get started locally, run one of the following commands:
npm create cloudflare@latest
# or
pnpm create cloudflare@latest
# or
yarn create cloudflare@latestFor more information on getting started with our CLI, check out the getting started guide.
Questions about Workers? Join the official Cloudflare Discord or check out the Workers docs!
This repository includes a comprehensive Playwright-based E2E test suite that validates all templates to ensure they work correctly. The test system supports both local development mode (spinning up dev servers) and live mode (testing against deployed templates).
By default, tests run against locally started development servers:
# Run all E2E tests
pnpm run test:e2e
# Run tests for specific templates
pnpm run test:e2e astro-blog-starter-template.spec.ts
pnpm run test:e2e saas-admin-template.spec.ts
# Run tests with UI mode for debugging
pnpm run test:e2e --uiIn local mode:
- Tests start development servers automatically for each template
- Uses one worker to prevent port conflicts
- Servers are properly cleaned up between different template tests
- Longer timeouts to account for build and startup time
To test against live deployed templates, set the PLAYWRIGHT_USE_LIVE environment variable:
# Run tests against live deployed templates
pnpm run test:e2e:live
# Run specific template tests in live mode
pnpm run test:e2e:live saas-admin-template.spec.tsIn live mode:
- Tests run against
https://{template-name}.templates.workers.dev - Enables parallel execution (up to 4 workers locally, 2 in CI)
- Faster execution since no local server startup required
- Shorter timeouts since templates are already running
The test system includes:
- Automatic template discovery: Finds all
*-templatedirectories and analyzes their framework - Smart server management: Detects framework type (Astro, Next.js, Vite, etc.) and uses appropriate ports
- Reliable cleanup: Properly terminates process trees between test runs
- Flexible URL resolution: Automatically determines live URLs from
wrangler.jsonconfiguration
Template tests should be named {template-name}.spec.ts and placed in the playwright-tests/ directory:
import { test, expect } from "./fixtures";
test.describe("My Template", () => {
test("should render correctly", async ({ page, templateUrl }) => {
await page.goto(templateUrl);
await expect(page.getByRole("heading", { name: "Welcome" })).toBeVisible();
});
});The templateUrl fixture automatically provides the correct URL (local dev server or live deployment) based on the test mode.
Playwright includes a test code generation utility that records your actions in a chromium browswer. To start the codegen utility run
pnpm playwright codgenWe welcome template contributions! If there's a Workers template you think would be valuable, please read our contributing guide and open an issue or pull request.