Skip to content

implement aicpp: C/C++ cognitive kernel on GGML/llama.cpp#9

Merged
drzo merged 2 commits into
mainfrom
copilot/implement-aicpp
May 8, 2026
Merged

implement aicpp: C/C++ cognitive kernel on GGML/llama.cpp#9
drzo merged 2 commits into
mainfrom
copilot/implement-aicpp

Conversation

Copilot AI commented May 8, 2026

Copy link
Copy Markdown

Adds a complete C/C++ implementation of AIChat as a cognitive kernel system (cpp/) built on GGML and llama.cpp, following the Echo.Kern/OpenCog architecture.

Architecture

  • Kernel layer (C11) — bootstrap (4-stage), membrane-aware scheduler, tensor-backed allocator (aligned_alloc), hypergraph FS, mutex/spinlock/semaphore, nanosecond timers
  • Cognitive layer (C++) — AtomSpace (hypergraph), ECAN attention allocation, PLN inference, ESN reservoir computing, CognitiveLoop orchestrating all four
  • LLM layer (C++) — llama.cpp model loading, chat completion with streaming via sampler chain
  • CLI layer (C++) — arg parser, readline REPL with /clear//history commands, JSON session persistence
  • RAG — hash-projection (FNV-1a, 1024-dim) vector store, cosine-similarity retrieval, no external deps
  • Function calling<tool_call>/<tool_result> protocol, callback + shell-command tool types

Bug fixes

  • CMakeLists.txt: CMAKE_C_STANDARD 99 → 11; aligned_alloc is C11-only, was generating implicit-declaration warnings
  • bootstrap.c: added #include "aichat/cognitive.h" to resolve implicit declarations of atomspace_init, ecan_init, pln_init (defined in C++ TUs)

Copilot AI assigned Copilot and drzo May 8, 2026
Copilot AI linked an issue May 8, 2026 that may be closed by this pull request
… cognitive.h in bootstrap.c

Agent-Logs-Url: https://github.com/9cog/aichat/sessions/71ff2b5d-5973-4f54-99cc-be1f3da196c5

Co-authored-by: drzo <15202748+drzo@users.noreply.github.com>
Copilot AI changed the title [WIP] Implement AICPP functionality implement aicpp: C/C++ cognitive kernel on GGML/llama.cpp May 8, 2026
Copilot AI requested a review from drzo May 8, 2026 07:41
Copilot finished work on behalf of drzo May 8, 2026 07:41

@drzo drzo left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

coool

@drzo drzo marked this pull request as ready for review May 8, 2026 07:46
@drzo drzo merged commit fde2e32 into main May 8, 2026
4 of 7 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

implement aicpp

2 participants