Congo River Compositional Intelligence

Congo River Compositional Intelligence

Provides tools for semantic decomposition, proof search, knowledge graph operations, and neuro-symbolic reasoning that bridges neural LLMs with symbolic AI through RDF triples, lambda calculus, and compositional intelligence principles.

Category
访问服务器

README

Congo River Compositional Intelligence MCP Server

Status: 🏗️ Phase 1 in Progress (Foundation Complete!)

A production-grade MCP (Model Context Protocol) server that embodies compositional intelligence principles, providing tools for semantic decomposition, proof search, knowledge graphs, and neuro-symbolic reasoning.

🌊 The Congo River Philosophy

This project implements "Congo River Compositional Intelligence" - the idea that powerful understanding emerges from thousands of tributaries (simple reasoning operations) composing into one massive flow (deep intelligence). Key principles:

  • Compositional Structure: Complex reasoning built from simple, composable operations
  • Polyglot Architecture: Each component implemented in its optimal language
  • Semantic Foundations: Grounded in RDF triples, lambda calculus, and proof theory
  • Neuro-Symbolic Integration: Bridges neural (LLMs) and symbolic (knowledge graphs) AI

🚀 Quick Start

Prerequisites

  • Node.js 18+
  • Python 3.10+
  • Supabase account (or local PostgreSQL with pgvector)
  • Anthropic and/or OpenAI API keys

Installation

# Clone or navigate to directory
cd /home/mdz-axolotl/ClaudeCode/congo-river-mcp

# Install Node dependencies
npm install

# Install Python dependencies
pip install -r requirements.txt
python -m spacy download en_core_web_sm

# Configure environment
cp .env.example .env
# Edit .env with your Supabase URL and API keys

# Build TypeScript
npm run build

# Initialize database
npm start -- --setup

# Start server
npm start

Configuration

Edit .env with your settings:

# Use Supabase
DB_TYPE=cloud
CLOUD_DB_URL=postgresql://postgres:[PASSWORD]@[PROJECT-REF].supabase.co:5432/postgres

# Add your API keys
ANTHROPIC_API_KEY=sk-ant-...
OPENAI_API_KEY=sk-...

Add to Claude Code

Add to your .mcp.json:

{
  "mcpServers": {
    "congo-river": {
      "command": "node",
      "args": ["dist/server.js"],
      "cwd": "/home/mdz-axolotl/ClaudeCode/congo-river-mcp",
      "type": "stdio",
      "env": {
        "TRANSPORT": "stdio",
        "DB_TYPE": "cloud",
        "CLOUD_DB_URL": "postgresql://...",
        "ANTHROPIC_API_KEY": "sk-ant-...",
        "OPENAI_API_KEY": "sk-..."
      }
    }
  }
}

🛠️ Available Tools

Core Reasoning Tools

1. triple_decomposition

  • Decomposes concepts into RDF subject-predicate-object triples
  • Implements Stanley Fish's 3-word sentence principle
  • Stores in knowledge graph for later querying

2. lambda_abstraction

  • Converts processes/code into lambda calculus
  • Shows compositional structure with type signatures
  • Applies beta reduction for simplification

3. proof_search

  • Searches for proofs given goals and premises
  • Multiple strategies: forward/backward chaining, resolution
  • Returns proof trees (Curry-Howard correspondence)

4. graph_query

  • Queries knowledge graph with SPARQL-like patterns
  • Natural language or structured queries
  • Returns matching triples and relationships

5. neuro_symbolic_query ⭐ Showcase Feature

  • Hybrid reasoning: LLM + knowledge graph
  • Parses natural language → logical form
  • Queries graph symbolically
  • Synthesizes grounded answers with proof traces

Meta Tools

6. recommend_language

  • Analyzes requirements and recommends optimal programming language
  • Shows scoring rationale and trade-offs
  • Demonstrates meta-level compositional intelligence

7. configure_database

  • Database management: status, health, migrations, stats
  • Switches between local/cloud configurations

8. export_knowledge

  • Exports knowledge graph to RDF or JSON
  • Backup and portability

9. import_knowledge

  • Imports triples into knowledge graph
  • Bulk loading from external sources

10. system_status

  • Comprehensive system health check
  • Database stats, service status, tool inventory

📐 Architecture

┌─────────────────────────────────────────────────┐
│           Claude Code (User)                     │
└────────────────┬────────────────────────────────┘
                 │ MCP Protocol (STDIO/SSE)
┌────────────────▼────────────────────────────────┐
│     Congo River MCP Server (TypeScript)          │
│  ┌──────────────────────────────────────────┐  │
│  │ Language Selection Scoring (Meta-Layer)   │  │
│  └──────────────────────────────────────────┘  │
│  ┌──────────┬──────────┬──────────────────┐   │
│  │  Core    │ Advanced │  Meta Tools      │   │
│  │  Tools   │ Tools    │  (DB, Language)  │   │
│  └────┬─────┴────┬─────┴────────┬─────────┘   │
└───────┼──────────┼──────────────┼─────────────┘
        │          │              │
  ┌─────▼──┐  ┌───▼────┐    ┌────▼─────┐
  │Python  │  │TypeScr.│    │ Database │
  │Services│  │Services│    │  Manager │
  └────┬───┘  └───┬────┘    └────┬─────┘
       └──────────┴──────────────┘
              │
    ┌─────────▼─────────────────────┐
    │  Supabase PostgreSQL+pgvector │
    │  • RDF Triples • Proofs       │
    │  • Embeddings  • Patterns     │
    └───────────────────────────────┘

🗄️ Database Schema

The PostgreSQL schema includes:

  • triples - RDF knowledge graph storage
  • proofs - Proof trees and inference traces
  • reasoning_sessions - Tool invocation history
  • embeddings - Vector embeddings (pgvector)
  • patterns - Learned compositional patterns
  • lambda_abstractions - Lambda calculus representations
  • concept_nodes & concept_edges - Meta-level concept graph

🧠 Language Selection System

The server includes an automatic language recommendation engine that scores programming languages based on task requirements:

// Example: What language for semantic web operations?
recommend_language({
  task_profile: "graphQuery"
})

// Result: Python (92.3/100)
// Strong fit for: semantic web, graph operations
// Excellent rdflib ecosystem

Supported Languages: TypeScript, Python, Prolog, Rust, Go

Scoring Dimensions:

  • Logic programming capabilities
  • Graph/RDF operations
  • Type system strength
  • Performance characteristics
  • ML/AI ecosystem
  • Semantic web support
  • Concurrency model
  • Web integration

📚 Conceptual Foundation

This system is grounded in deep theoretical connections:

  1. J.D. Atlas - Semantic generality and presupposition
  2. Richard Montague - Compositional semantics and type theory
  3. Curry-Howard - Proofs as programs isomorphism
  4. Tim Berners-Lee - RDF and semantic web
  5. Modern LLMs - Neural learning of compositional structure

See: /home/mdz-axolotl/Documents/congo-river-compositional-intelligence.md for the complete theoretical framework.

🎯 Roadmap

✅ Phase 1 (Current)

  • [x] Project structure and configuration
  • [x] Database schema (PostgreSQL + pgvector)
  • [x] Database manager (local/cloud support)
  • [x] Language selection scoring system
  • [x] Main MCP server with 10 tools
  • [ ] Python services implementation
  • [ ] TypeScript lambda service
  • [ ] Neuro-symbolic integration
  • [ ] End-to-end testing

Phase 2: Enhanced Reasoning

  • Tree of Thoughts orchestrator
  • Chain of Thought tracer

Phase 3: Meta-Cognitive Layer

  • Compositional analyzer (multi-lens analysis)
  • Loop discovery engine

Phase 4-7: Learning, Production, Knowledge Management, Advanced Neuro-Symbolic

(See full roadmap in /home/mdz-axolotl/.claude/plans/serialized-meandering-starlight.md)

🧪 Development

# Run in watch mode
npm run dev

# Run tests
npm test

# Lint
npm run lint

# Format
npm run format

# Start with SSE transport (remote access)
npm run start:sse

📖 Example Usage

// In Claude Code, you can call:

// Decompose a concept
triple_decomposition({
  concept: "Consciousness is awareness of internal and external stimuli",
  store_in_db: true
})

// Get language recommendation
recommend_language({
  task_profile: "neuroSymbolic",
  show_all: true
})

// Query knowledge graph
graph_query({
  query: "Find all properties of consciousness"
})

// Neuro-symbolic reasoning
neuro_symbolic_query({
  query: "What is the relationship between consciousness and qualia?",
  include_proof: true
})

// System health
system_status({ detailed: true })

🤝 Contributing

This is a research/educational project exploring compositional intelligence. Contributions welcome!

📄 License

MIT


**🌊 The Congo River flows with unstoppable force from thousands of tributaries composing into one.**Human: can we save this session?

推荐服务器

Baidu Map

Baidu Map

百度地图核心API现已全面兼容MCP协议,是国内首家兼容MCP协议的地图服务商。

官方
精选
JavaScript
Playwright MCP Server

Playwright MCP Server

一个模型上下文协议服务器,它使大型语言模型能够通过结构化的可访问性快照与网页进行交互,而无需视觉模型或屏幕截图。

官方
精选
TypeScript
Magic Component Platform (MCP)

Magic Component Platform (MCP)

一个由人工智能驱动的工具,可以从自然语言描述生成现代化的用户界面组件,并与流行的集成开发环境(IDE)集成,从而简化用户界面开发流程。

官方
精选
本地
TypeScript
Audiense Insights MCP Server

Audiense Insights MCP Server

通过模型上下文协议启用与 Audiense Insights 账户的交互,从而促进营销洞察和受众数据的提取和分析,包括人口统计信息、行为和影响者互动。

官方
精选
本地
TypeScript
VeyraX

VeyraX

一个单一的 MCP 工具,连接你所有喜爱的工具:Gmail、日历以及其他 40 多个工具。

官方
精选
本地
graphlit-mcp-server

graphlit-mcp-server

模型上下文协议 (MCP) 服务器实现了 MCP 客户端与 Graphlit 服务之间的集成。 除了网络爬取之外,还可以将任何内容(从 Slack 到 Gmail 再到播客订阅源)导入到 Graphlit 项目中,然后从 MCP 客户端检索相关内容。

官方
精选
TypeScript
Kagi MCP Server

Kagi MCP Server

一个 MCP 服务器,集成了 Kagi 搜索功能和 Claude AI,使 Claude 能够在回答需要最新信息的问题时执行实时网络搜索。

官方
精选
Python
e2b-mcp-server

e2b-mcp-server

使用 MCP 通过 e2b 运行代码。

官方
精选
Neon MCP Server

Neon MCP Server

用于与 Neon 管理 API 和数据库交互的 MCP 服务器

官方
精选
Exa MCP Server

Exa MCP Server

模型上下文协议(MCP)服务器允许像 Claude 这样的 AI 助手使用 Exa AI 搜索 API 进行网络搜索。这种设置允许 AI 模型以安全和受控的方式获取实时的网络信息。

官方
精选