cognos-session-memory
Click on "Install Server".
Wait a few minutes for the server to deploy. Once ready, it will show a "Started" state.
In the chat, type
@followed by the MCP server name and your instructions, e.g., "@cognos-session-memoryload last session's verified context"
That's it! The server will respond to your query, and you can continue using it as needed.
Here is a step-by-step guide with screenshots.
CognOS Session Memory
mcp-name: io.github.base76-research-lab/cognos-session-memory
Verified context injection via epistemic trust scoring for LLMs.
Solves session fragmentation by maintaining verified, high-confidence session context between conversations.
Problem
Large language models suffer from session fragmentation: each new conversation starts without verified context of previous work. This forces repeated explanations, loses decision history, and breaks long-running workflows.
Existing solutions (persistent memory systems, vector retrieval) either:
Lack trust scores before injection → hallucinations propagate
Don't audit which context was injected → compliance gaps
Treat all past information equally → noise overwhelms signal
Related MCP server: Recall
Solution
A plan-mode gateway that:
Extracts structured context from 3-5 recent traces
Scores context quality via CognOS epistemic formula:
C = p · (1 − Ue − Ua)Injects as system prompt only if
C > thresholdFlags for manual review if
C < thresholdAudits every context injection with trace IDs → EU AI Act compliance
Architecture
recent_traces (n=5)
↓
extract_context() → ContextField + coverage
↓
compute_trust_score(p, ue, ua) → C, R, decision
↓
if C > threshold:
system_prompt ← inject
else:
flagged_reason ← manual reviewCore Formula
C = p · (1 − Ue − Ua)
R = 1 − C
where:
p = prediction confidence (coverage of required fields)
Ue = epistemic uncertainty (divergence between traces)
Ua = aleatoric uncertainty (mean risk in traces)Action Gate
R < 0.25 → PASS (inject without review)
0.25 ≤ R < 0.60 → REFINE (inject with caution)
R ≥ 0.60 → ESCALATE (flag for manual review)API
POST /v1/plan
Extract and score context.
Request:
{
"n": 5,
"trust_threshold": 0.75,
"mode": "auto"
}Response (if injected):
{
"status": "injected",
"trust_score": 0.82,
"confidence": 0.82,
"risk": 0.18,
"decision": "PASS",
"context": {
"active_project": "CognOS mHC research",
"last_decision": "Verify P1 hypothesis",
"open_questions": ["How does routing entropy scale?"],
"current_output": "exp_008 complete",
"recent_models": ["gpt-4", "claude-3", "mistral"]
},
"system_prompt": "## CognOS Context...",
"trace_ids": ["uuid-1", "uuid-2", ...]
}Response (if flagged):
{
"status": "flagged",
"trust_score": 0.45,
"decision": "REFINE",
"flagged_reason": "Trust score 0.45 below threshold 0.75. Manual review recommended.",
"trace_ids": [...]
}Modes
auto (default) — inject if
trust_score ≥ threshold, else flagforce — always inject (for testing)
dry_run — compute score but never inject
Claude Code Integration
As a /compact replacement
# In any Claude Code session:
/saveClaude writes a structured summary, trust-scores it, and persists it to SQLite.
Next session: automatically injected as SESSION_CONTEXT before your first prompt.
See docs/COMPACT_ALTERNATIVE.md for a full comparison.
As an MCP server
Add to ~/.claude/settings.json:
{
"mcpServers": {
"cognos-session-memory": {
"command": "python3",
"args": ["/path/to/cognos-session-memory/mcp_server.py"]
}
}
}Tools exposed:
Tool | Description |
| Trust-score and persist a session summary |
| Retrieve last verified context (default threshold: 0.45) |
Quick Start
Installation
git clone https://github.com/base76-research-lab/cognos-session-memory
cd cognos-session-memory
pip install -e .Run Gateway
python3 -m uvicorn --app-dir src main:app --port 8788Test /v1/plan (dry_run)
curl -X POST http://127.0.0.1:8788/v1/plan \
-H 'Content-Type: application/json' \
-d '{"n": 5, "mode": "dry_run"}'Test /v1/plan (auto)
curl -X POST http://127.0.0.1:8788/v1/plan \
-H 'Content-Type: application/json' \
-d '{"n": 5, "trust_threshold": 0.75, "mode": "auto"}'Modules
trust.py — CognOS confidence formula, action gate, signal extractors
trace_store.py — SQLite persistence (write/read/purge)
plan.py — Context extraction, trust scoring, system prompt building
main.py — FastAPI gateway + middleware
mcp_server.py — MCP stdio server (
save_session,load_session)
Testing
pytest tests/ -v --cov=srcDocumentation
COMPACT_ALTERNATIVE.md — Why this beats
/compactPAPER.md — Research paper
Research Paper
See docs/PAPER.md — "Verified Context Injection: Epistemically Scored Session Memory for Large Language Models"
Status: Independent research — Base76 Research Lab, 2026 Authors: Björn André Wikström (Base76)
Citation
@software{wikstrom2026cognos,
author = {Wikström, Björn André},
title = {{CognOS Session Memory}: Verified Context Injection via Epistemic Trust Scoring},
year = {2026},
url = {https://github.com/base76-research-lab/cognos-session-memory}
}License
MIT
Contact
Author: Björn André Wikström
Email: bjorn@base76.se
ORCID: 0009-0000-4015-2357
GitHub: base76-research-lab
Available Tools
2 toolsload_sessionA
Load the last verified session context from CognOS Session Memory. Returns the summary and an inject-ready SESSION_CONTEXT block. Only returns context that passed the trust threshold — never injects low-confidence or stale sessions.
| Name | Required | Description | Default |
|---|---|---|---|
| threshold | No | Minimum trust score to accept (default 0.45). |
TDQS
Does the description disclose side effects, auth requirements, rate limits, or destructive behavior?
No annotations provided, so description carries full burden. It discloses that it only returns context passing trust threshold, never injects low-confidence or stale sessions, and returns summary and block. However, it does not specify behavior when no session exists or error conditions.
Agents need to know what a tool does to the world before calling it. Descriptions should go beyond structured annotations to explain consequences.
Is the description appropriately sized, front-loaded, and free of redundancy?
Two sentences with no redundancy. First sentence states action and expected output; second adds critical constraint. Fully front-loaded and efficient.
Shorter descriptions cost fewer tokens and are easier for agents to parse. Every sentence should earn its place.
Given the tool's complexity, does the description cover enough for an agent to succeed on first attempt?
For a simple tool with one optional parameter and no output schema, the description covers purpose, return values, and trust threshold. It is complete enough for an agent to use correctly, though it omits edge cases like missing session.
Complex tools with many parameters or behaviors need more documentation. Simple tools need less. This dimension scales expectations accordingly.
Does the description clarify parameter syntax, constraints, interactions, or defaults beyond what the schema provides?
Schema coverage is 100% and the description adds minimal new insight beyond the schema. It reinforces the threshold's role but does not elaborate on format or usage semantics.
Input schemas describe structure but not intent. Descriptions should explain non-obvious parameter relationships and valid value ranges.
Does the description clearly state what the tool does and how it differs from similar tools?
Description clearly states 'Load' action on 'last verified session context from CognOS Session Memory' and specifies output: summary and inject-ready block. It distinguishes from sibling 'save_session' by verb and scope, and adds constraint about trust threshold.
Agents choose between tools based on descriptions. A clear purpose with a specific verb and resource helps agents select the right tool.
Does the description explain when to use this tool, when not to, or what alternatives exist?
Description implies use for retrieving a verified session context but does not explicitly state when not to use or alternative tools. It mentions trust threshold but lacks exclusionary guidance such as 'use save_session to create a session'.
Agents often have multiple tools that could apply. Explicit usage guidance like "use X instead of Y when Z" prevents misuse.
save_sessionA
Save a trust-scored session summary to CognOS Session Memory. Call this instead of or after /compact to preserve verified context across sessions. The summary is scored epistemically — short or vague summaries get lower trust scores and may not be injected next session.
| Name | Required | Description | Default |
|---|---|---|---|
| summary | Yes | Compact session summary (100-200 words): active project, last decision, current output, open questions, key files. | |
| project | No | Optional: active project name. |
TDQS
Does the description disclose side effects, auth requirements, rate limits, or destructive behavior?
With no annotations provided, the description fully carries the burden of behavioral disclosure. It reveals that summaries are 'epistemically scored', that low-scored summaries may not be injected next session, and that the operation saves to persistent memory. No contradictions noted.
Agents need to know what a tool does to the world before calling it. Descriptions should go beyond structured annotations to explain consequences.
Is the description appropriately sized, front-loaded, and free of redundancy?
The description consists of two compact sentences. The first sentence states the core purpose, and the second adds essential behavioral context. No redundant or unnecessary information.
Shorter descriptions cost fewer tokens and are easier for agents to parse. Every sentence should earn its place.
Given the tool's complexity, does the description cover enough for an agent to succeed on first attempt?
Given the tool's simplicity (2 parameters, no output schema), the description is nearly complete. It explains the trust scoring mechanism and injection eligibility. However, it does not mention what the tool returns (if anything) or potential error conditions, which would be helpful but not critical for a save operation.
Complex tools with many parameters or behaviors need more documentation. Simple tools need less. This dimension scales expectations accordingly.
Does the description clarify parameter syntax, constraints, interactions, or defaults beyond what the schema provides?
Schema coverage is 100% with descriptions for both parameters, but the tool's description adds extra semantic value beyond the schema: it specifies the recommended word count range (100-200 words) and content guidelines for the 'summary' parameter ('active project, last decision, current output, open questions, key files'). The 'project' parameter is correctly noted as optional.
Input schemas describe structure but not intent. Descriptions should explain non-obvious parameter relationships and valid value ranges.
Does the description clearly state what the tool does and how it differs from similar tools?
The description clearly states the verb 'Save' and the resource 'trust-scored session summary to CognOS Session Memory'. It distinguishes from the sibling tool 'load_session' by implying the opposite action (save vs load), and also mentions an alternative ('/compact') for context.
Agents choose between tools based on descriptions. A clear purpose with a specific verb and resource helps agents select the right tool.
Does the description explain when to use this tool, when not to, or what alternatives exist?
The description explicitly says when to use this tool ('instead of or after /compact to preserve verified context across sessions') and provides a guideline on summary quality ('short or vague summaries get lower trust scores and may not be injected next session'). It does not explicitly state when not to use it, but the context is clear.
Agents often have multiple tools that could apply. Explicit usage guidance like "use X instead of Y when Z" prevents misuse.
Tool Schema Changelog
Recent tool additions, removals, and schema changes observed during successful MCP inspections. Dates show when Glama detected each change.
2 tool updates
v0.1.0- First observed
load_session - First observed
save_session
TDQS
The two tools have completely distinct purposes: load_session retrieves context and save_session stores it. There is no overlap in their functionality, making it easy for an agent to select the correct one.
Both tools follow a consistent verb_noun pattern (load_session, save_session), which is clear and predictable. No mixing of conventions.
With only 2 tools, the surface is thin for a memory management system. While it covers the basic load/save operations, the count is borderline low for the implied scope.
The tool set covers loading and saving sessions, but lacks operations like list, delete, or update sessions. There are notable gaps that may require agents to work around missing functionality.
Maintenance
Resources
Unclaimed servers have limited discoverability.
Looking for Admin?
If you are the server author, to access and configure the admin panel.
Related MCP Connectors
Cross-LLM persistent memory: store context once, recall it from any AI model.
Memory for deep conversational context across any platform
Universal persistent memory and knowledge retrieval layer for AI agents and LLMs.
11Verified memory for AI agents. Signed assertions, billing attestation, session continuity.
Related MCP Servers
- AlicenseAqualityDmaintenanceProvides persistent session memory for AI assistants, enabling them to store, search, and retrieve conversation summaries across sessions via the Model Context Protocol.10MIT
- AlicenseNot gradedqualityCmaintenanceProvides persistent, cross-session memory for AI agents, allowing them to store and automatically retrieve information across different conversations and sessions without repeating context.15175MIT
- AlicenseNot gradedqualityDmaintenancePersistent memory system for LLMs with lossless transcript management, enabling memory recall and full session history search across all conversations.45MIT
- AlicenseNot gradedqualityCmaintenanceProvides persistent memory for AI tools by building a local knowledge graph from conversations, enabling cross-session recall and context awareness without cloud dependencies.9MIT
Latest Blog Posts
- Who's Calling? MCP Hosts Are an Identity Blind Spot (And the Spec Knows It)By Om-Shree-0709 on .mcpAgent IdentityOAuth 2.1
- Your AI Chatbot Just Exposed Your CEO's Salary to an InternBy Om-Shree-0709 on .Agent IdentityMCP SecurityOAuth Delegation
- Why MCP Servers Need Execution Sandboxing (And Why Your Current Stack Isn't Enough)By Om-Shree-0709 on .Agentic AiPrompt InjectionWebAssembly
MCP directory API
We provide all the information about MCP servers via our MCP API.
curl -X GET 'https://glama.ai/api/mcp/v1/servers/base76-research-lab/cognos-session-memory'
If you have feedback or need assistance with the MCP directory API, please join our Discord server