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