# CogniCore

A zero-dependency Python framework that adds persistent memory, reflection on past failures, prompt-injection safety and decision replay to any rule-based, reinforcement-learning or LLM-based agent.

CogniCore adds memory, reasoning support and safety to AI agents that would otherwise forget everything between runs. Its memory module stores arbitrary records and retrieves them later by meaning rather than exact keywords using BM25 and multi-hop graph retrieval, with no vector database or embedding server required. A reflection module automatically learns from past task failures and surfaces a relevant hint the next time a similar task runs.

A safety module, exposed as a shield wrapped around an agent, blocks prompt-injection and jailbreak attempts before they reach the agent, and every agent decision is recorded so past runs can be replayed or branched. It also ships built-in training environments and an auto-learning agent for experimenting with reinforcement learning.

It installs with pip, needs no API keys or mandatory dependencies for basic use, and exposes an MCP server with 30 tools. It works with rule-based, reinforcement-learning or LLM-based agents, including GPT-4, Claude, Gemini and Llama.

Website: https://github.com/cognicore-dev/cognicore-env
