Skip to content

SimpleContext

Universal AI Brain for AI Agents — Tiered Memory · Context Scoring · Intent Planning · Zero Dependencies

Python Version License Dependencies


What is SimpleContext?

Most AI agent frameworks treat memory as a flat list of messages. This breaks down fast:

❌ Flat memory:    [msg1, msg2, ... msg500]  → retrieval gets noisy
✅ Tiered memory:  working · episodic · semantic  → structured, scored, evolved

SimpleContext gives your agent a structured brain — not just a chat log.

SimpleContext is not another vector database wrapper. It's a structured context brain — tiered memory, intent-aware retrieval, fact extraction, and importance scoring. Without a single external dependency.


Key Features

Feature Description
🧠 3-Tier Memory working (active) · episodic (sessions) · semantic (long-term facts)
🎯 Intent Planning Auto-detect intent → smart retrieval strategy per query type
📊 Context Scoring relevance×0.55 + importance×0.25 + recency×0.10 + path_priority×0.10
🔍 Fact Extraction Rule-based extraction: "user uses Proxmox", "user project X"
♻️ Memory Evolution Jaccard dedup · conflict resolution · importance decay
🤖 Agent YAML Define agents in YAML · hot-reload without restart
🔗 Agent Chaining Agent A handoff to Agent B based on user message
💾 Multi-Storage SQLite (default) · Redis · PostgreSQL
🔌 Plugin System Hooks · persistent state · dependency resolver · app_commands
📦 Zero Dependencies Only Python built-ins: sqlite3, json, re, datetime

Ecosystem

SimpleContext is the core engine of a growing ecosystem:

Repo Description Version
SimpleContext Core engine v4.3
SimpleContext-Agents 15 ready-to-use agent definitions v1.1
SimpleContext-Plugin Official & community plugin registry v1.1
SimpleContext-Bot Telegram Bot — one-command setup v1.2
SimpleContext-Docs This documentation site

Quick Start

pip install simplecontext-bot
simplecontext-bot setup
simplecontext-bot start
from simplecontext import SimpleContext

sc = SimpleContext("config.yaml")

ctx   = sc.chat(user_id, message)
reply = your_llm(ctx.messages)
ctx.save(reply)
from simplecontext import SimpleContext

sc = SimpleContext("config.yaml")

result   = sc.router.route(user_id, message)
messages = sc.prepare_messages(user_id, message, result)
reply    = your_llm(messages)
reply    = sc.process_response(user_id, message, reply, result)

Where to Start?