Skip to content

Sarkar-AGI/Core-1

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

16 Commits
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

TitanCore: Core-1 AGI

Distributed Artificial General Intelligence Engine — Trillion-Parameter Scale

TitanCore Core-1 is a full-stack AGI engine built in C++17 and CUDA. It combines a 120-layer Mixture-of-Experts Transformer with a complete cognitive architecture: persistent memory, structured reasoning, goal-directed planning, meta-learning, world modelling, and continuous online learning — all running across multi-node GPU clusters.


Project Status

Property Detail
Version 1.0.0
Release Date February 2026
Status AGI Framework — Inference-Ready
Tokenization Custom BPE — 400,000 token vocabulary
Weight Format GGUF (titancore.gguf)
Parameters Up to 1 Trillion

AGI Architecture

TitanCore Core-1 implements the full Perceive → Remember → Reason → Plan → Act → Learn cognitive loop:

┌──────────────────────────────────────────────────────────────┐
│                    TITANCORE AGI COGNITIVE LOOP              │
│                                                              │
│   Input                                                      │
│     │                                                        │
│     ▼                                                        │
│  ┌──────────────┐    ┌───────────────┐    ┌───────────────┐  │
│  │   Perceive   │───▶│   Remember    │───▶│    Reason     │  │
│  │ Working Mem  │    │ Episodic Mem  │    │ Chain-of-Thought│ │
│  │ Safety Gate  │    │ Semantic Mem  │    │ Tree-of-Thought│  │
│  └──────────────┘    └───────────────┘    └───────┬───────┘  │
│                                                   │          │
│  ┌──────────────┐    ┌───────────────┐    ┌───────▼───────┐  │
│  │    Learn     │◀───│      Act      │◀───│     Plan      │  │
│  │ Online GD    │    │  Tool Use     │    │  MCTS Planner │  │
│  │ EWC + MAML   │    │  API Calls    │    │  Goal Stack   │  │
│  └──────┬───────┘    └───────────────┘    └───────────────┘  │
│         │                                                     │
│         ▼                                                     │
│  ┌──────────────┐                                            │
│  │ World Model  │  Predict future states, detect novelty     │
│  │ VAE+Dynamics │                                            │
│  └──────────────┘                                            │
└──────────────────────────────────────────────────────────────┘

AGI Subsystems

1. Language Model Backbone

  • 120-layer MoE Transformer — 8 experts per layer, top-2 routing
  • FlashAttention v2 — custom CUDA tiled kernel, 128k+ context
  • Paged KV Cache — logical-to-physical block mapping, zero fragmentation
  • RoPE embeddings, SwiGLU MLP, Pre-LayerNorm
  • Parallelism — Tensor ×4, Pipeline ×2, Data ×4, Expert ×8

2. Continuous Learning (core/learning/online_learning.cpp)

Learns from every new interaction without forgetting prior knowledge:

  • Online Gradient Descent — real-time weight updates from live data streams
  • Elastic Weight Consolidation (EWC) — Fisher Information diagonal protects prior knowledge
  • Experience Replay Buffer — 100K capacity, reservoir sampling
  • EMA Weight Snapshots — stable inference weights via exponential moving average
  • Adaptive per-parameter learning rate via AdamW

3. Memory Systems

System File Description
Episodic Memory core/memory/episodic.cpp Stores 50K past episodes; cosine-similarity + temporal-decay retrieval
Semantic Memory core/memory/semantic.cpp Long-term factual knowledge graph; confidence-scored, conflict-resolved
Working Memory core/memory/working.cpp Active context window; attention-weighted importance-based eviction

4. Reasoning Engine (core/reasoning/chain_of_thought.cpp)

Four structured reasoning modes:

Mode Description
Standard CoT Linear step-by-step reasoning with confidence gating
Self-Consistency Sample N reasoning paths, majority-vote the answer
Tree-of-Thought BFS branching + value-guided pruning of the reasoning tree
Reflection Draft → Critique → Revise loop for high-accuracy answers

5. Goal-Directed Planner (core/reasoning/planner.cpp)

  • Monte Carlo Tree Search (MCTS) with UCB1 selection
  • Neural-guided rollout policy for state evaluation
  • Hierarchical goal decomposition into ordered subgoals
  • Configurable depth, breadth, and exploration constant

6. Meta-Learning (core/meta/maml.cpp)

Learn to learn — adapt to any new task in a few gradient steps:

  • MAML (Model-Agnostic Meta-Learning) — full second-order
  • FOMAML — first-order approximation (faster, production default)
  • Reptile — scalable alternative with simple moving-average updates
  • Fast inference-time adaptation with only a handful of examples

7. World Model (core/world_model/world_model.cpp)

Internal predictive model of the environment:

  • VAE Encoder — maps observations to compact latent state z
  • Dynamics Model — predicts next latent z' given z + action
  • Reward Predictor — estimates expected reward from any state
  • Novelty Detection — z-score anomaly flag for unexplored states
  • Imagination — simulate N-step future trajectories for planning

8. Tool Use / Function Calling (core/tools/tool_executor.cpp)

Allows the AGI to call external systems:

Built-in Tool Description
calculator Safe mathematical expression evaluator
web_search Real-time web search via search API
code_interpreter Sandboxed Python execution environment
read_file Secure file system access
db_query Read-only SQL against the knowledge database

Custom tools can be registered at runtime with a schema and handler function.


System Requirements

Hardware

Component Minimum Recommended
GPU NVIDIA A100 80GB ×8 NVIDIA H100 SXM5 80GB ×8 per node
Nodes 1 4 (32 GPUs total)
System RAM 512 GB 1 TB per node
Interconnect NVLink NVLink + InfiniBand 400 Gbps
Storage 10 TB NVMe 100 TB NVMe RAID

Software

Dependency Version
OS Ubuntu 22.04 LTS
CUDA Toolkit 12.2+
CMake 3.20+
C++ Compiler GCC 11+ / Clang 14+
LibTorch 2.2+
NCCL 2.18+
OpenMPI 4.1+

Project Structure

Core-1/
├── main.cpp                          # AGI master orchestrator
├── CMakeLists.txt
│
└── core/
    ├── configs/
    │   ├── gpt4o.yaml                # Model & runtime config
    │   ├── cluster.yaml              # Cluster topology
    │   ├── safety.yaml               # Safety policy
    │   └── agi.yaml                  # AGI subsystem config
    │
    ├── model/                        # Transformer backbone
    ├── distributed/                  # NCCL, FSDP, MPI
    ├── optimizer/                    # ZeRO-3 AdamW
    ├── dataloader/                   # Memory-mapped dataset
    ├── safety/                       # Moderation, jailbreak, rate limit
    ├── logging/                      # Audit trail
    │
    ├── learning/
    │   └── online_learning.cpp       # Online GD + EWC + Replay + EMA
    │
    ├── memory/
    │   ├── episodic.cpp              # Past episode store + retrieval
    │   ├── semantic.cpp              # Long-term knowledge graph
    │   └── working.cpp               # Active context window
    │
    ├── reasoning/
    │   ├── chain_of_thought.cpp      # CoT / Self-Consistency / ToT / Reflection
    │   └── planner.cpp               # MCTS goal-directed planner
    │
    ├── meta/
    │   └── maml.cpp                  # MAML / FOMAML / Reptile
    │
    ├── world_model/
    │   └── world_model.cpp           # VAE encoder + dynamics + reward + novelty
    │
    ├── tools/
    │   └── tool_executor.cpp         # Function calling + built-in tools
    │
    └── agi/
        └── agi_core.cpp              # Unified AGI cognitive loop controller

Getting Started

Build

git clone https://github.com/litonsarkar3988-max/Core-1
cd Core-1
mkdir build && cd build

cmake .. \
  -DCMAKE_BUILD_TYPE=Release \
  -DTorch_DIR=/path/to/libtorch/share/cmake/Torch \
  -DCMAKE_CUDA_ARCHITECTURES="80;86;90"

make -j$(nproc)

Run — Single Node

./titancore \
  --model  core/weights/titancore.gguf \
  --config core/configs/gpt4o.yaml \
  --agi    core/configs/agi.yaml

Run — Multi-Node AGI Cluster

mpirun -np 32 -hostfile hosts.txt \
  ./titancore \
  --config   core/configs/gpt4o.yaml \
  --cluster  core/configs/cluster.yaml \
  --agi      core/configs/agi.yaml

Configuration

File Purpose
core/configs/gpt4o.yaml Model architecture, quantization, runtime
core/configs/cluster.yaml Multi-node topology, network, fault tolerance
core/configs/safety.yaml Content policy, rate limits, PII redaction
core/configs/agi.yaml All AGI subsystem parameters

Safety System

All input passes through a mandatory safety pipeline before any model computation:

  1. Jailbreak Detection — regex + semantic scan
  2. Rate Limiting — sliding-window per user/session
  3. Multi-Vector Moderation — embedding-based classifier
  4. EWC Knowledge Protection — prevents unsafe fine-tuning from corrupting core knowledge

Roadmap

Phase Milestone Status
1 Core Transformer + CUDA kernels Complete
2 ZeRO-3 distributed training Complete
3 Safety & moderation engine Complete
4 Paged KV cache & inference Complete
5 Continuous learning (Online GD + EWC) Complete
6 Episodic, semantic & working memory Complete
7 Chain-of-Thought & Tree-of-Thought reasoning Complete
8 MCTS goal-directed planner Complete
9 Meta-learning (MAML / Reptile) Complete
10 World model (VAE + dynamics) Complete
11 Tool use & function calling Complete
12 Full YAML config parser (yaml-cpp) In Progress
13 GGUF weight loader & quantized inference In Progress
14 500T token pre-training run Planned
15 RLHF alignment pipeline Planned
16 Public API release Planned

Author

Rahul Sarkar — India GitHub: github.com/Sarkar-AGI


Disclaimer: TitanCore Core-1 is an independent research project. NVIDIA GPU hardware is required. CPU execution is not supported.

About

Core-1: A High-Performance Distributed AGI Framework built for Trillion-Parameter Scalability, featuring Unified Cognitive Memory, MCTS Planning, and Continuous Meta-Learning in C++.

Topics

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Packages

 
 
 

Contributors