ContextOn.AI OSS
Knowledge Graphs with Confidence Scoring and Failure Learning
By ODEFTO AI Labs | Enterprise Version (ContextOn.AI)
What is ContextOn.AI OSS?
ContextOn.AI OSS is an open-source knowledge graph engine for AI agents that introduces confidence-aware, failure-learning graph memory.
Unlike existing tools, ContextOn.AI OSS:
- ๐ข Scores confidence - Every piece of knowledge has a trust indicator
- ๐ด Learns from failures - Marks unreliable knowledge so agents avoid it
- ๐ Shows quality badges - Visual trust indicators (๐ข๐ก๐ด)
- ๐ก Suggests questions - Graph tells you what it can answer
- ๐ Resolves entity aliases - Links "PM-JAY" to "Pradhan Mantri Jan Arogya Yojana"
- ๐ ๏ธ Skills - Stores reusable procedures ("how to") with steps and confidence
- ๐งฐ Tool registry memory - Tracks tools, their descriptions, and which ones fail
- ๐ฆ Auto-context injection -
get_context()assembles confident, badge-annotated context for agents - ๐งน Memory hygiene - Decay sweeps flag stale / low-confidence knowledge for re-verification
- ๐ญ Per-agent scoping - Filter knowledge by agent (transparency)
- ๐ฐ๏ธ Works with Claude/Cursor - MCP server included
- ๐ Web demo -
contexton-ai-oss webruns a browser demo of everything
Quick Start
Installation
pip install contexton-ai-oss
Basic Usage
from contexton_ai_oss import ContextGraph
# Create a graph
graph = ContextGraph()
# Ingest knowledge from conversations
graph.ingest(
query="What is PM-JAY?",
answer="Pradhan Mantri Jan Arogya Yojana is health insurance for poor families",
agent_id="health-agent"
)
# Query with confidence ranking
results = graph.query("PM-JAY coverage")
for result in results:
print(f"{result['badge']} {result['node']['content'][:50]}")
print(f" Confidence: {result['confidence']:.1%}")
Recording Failures (KEY FEATURE)
# When your agent gives a wrong answer, tell the graph:
graph.record_failure(
query="What is PM-JAY?",
answer="It's a housing scheme",
reason="Incorrect - it's health insurance, not housing"
)
# Confidence in the related knowledge drops (๐ด) and failure observations
# are never returned in query results.
# When the agent later gives a correct answer, record the success:
graph.record_success(
query="What is PM-JAY?",
answer="It's health insurance for poor families"
)
# Confidence is restored.
Visualizing the Graph
# Generate interactive HTML visualization
graph.visualize("graph.html")
# Open graph.html in your browser
Why ContextOn.AI OSS is Different
| Feature | Graphify | Graphiti | Mem0 | ContextOn.AI OSS |
|---|---|---|---|---|
| Knowledge graphs | โ | โ | โ | โ |
| Agent memory | โ | โ | โ | โ |
| Confidence scoring | โ | โ | โ | โ |
| Failure learning | โ | โ | โ | โ |
| Quality badges | โ | โ | โ | โ |
| Suggested questions | โ | โ | โ | โ |
| Simple to use | โ | โ | โ | โ |
Key Differentiator: No other tool learns from failures. See COMPARISON.md for verified market analysis.
Key Features
1. Confidence Scoring
Every node and edge has a confidence score (0.0-1.0) based on:
- How many times it's been verified
- How old the information is
- How many times it's failed
# Get confidence breakdown
node = graph.get_node("node_id")
breakdown = graph.confidence_engine.get_confidence_breakdown(node)
print(breakdown)
# {'mentions': 5, 'base_score': 1.0, 'days_since_verified': 2, ...}
2. Failure Learning (NOVEL)
No other tool learns from mistakes. ContextOn.AI OSS does:
# Record a failure
graph.record_failure(
query="What is X?",
answer="Wrong answer",
reason="Because Y"
)
# The graph now avoids paths that led to this failure
# Future queries prefer more reliable knowledge
3. Quality Badges
See at a glance which knowledge is trustworthy:
- ๐ข High confidence (โฅ0.8): Verified, reliable
- ๐ก Medium confidence (0.5-0.8): Needs verification
- ๐ด Low confidence (<0.5): Unreliable, verify before using
4. Suggested Questions
The graph analyzes itself and suggests questions it can answer:
suggestions = graph.suggest_questions()
for s in suggestions:
print(f"{s['badge']} {s['question']}")
print(f" Reason: {s['reason']}")
Use Cases
1. AI Agent Memory
Give your agents persistent memory that learns and improves:
# Agent remembers past conversations
graph.ingest("How do I reset password?", "Go to settings โ security")
# Later, agent can retrieve this knowledge
results = graph.query("password reset")
2. Knowledge Base
Build a knowledge base that tracks reliability:
# Add knowledge with confidence
graph.add_node("PM-JAY covers 5 lakh per family", confidence=0.9)
# Query returns confidence scores
results = graph.query("PM-JAY coverage")
3. Multi-Agent Systems
Agents share knowledge and learn from each other:
# Agent A learns something
graph.ingest("X causes Y", agent_id="agent-a")
# Agent B can query this knowledge
results = graph.query("what causes Y")
Integration with AI Assistants
Claude Code / Cursor / Codex (via MCP)
Install with MCP support, then start the server:
pip install "contexton-ai-oss[mcp]"
# stdio transport (recommended for Claude Code / Cursor)
contexton-ai-oss serve
# or streamable HTTP
contexton-ai-oss serve --port 8080
Add to Claude Code's MCP config (.mcp.json):
{
"mcpServers": {
"contexton-ai-oss": {
"command": "contexton-ai-oss",
"args": ["serve"]
}
}
}
Exposed tools: ingest, query, record_failure, record_success,
suggest_questions, get_stats, get_aliases, resolve_aliases,
get_confidence_breakdown, visualize.
Cursor
# Add to .cursor/rules
ContextOn.AI OSS is available for knowledge retrieval.
Use contexton-ai-oss query for knowledge questions.
Custom Agents
from contexton_ai_oss import ContextGraph
class MyAgent:
def __init__(self):
self.memory = ContextGraph()
def answer(self, query):
# Retrieve relevant knowledge
knowledge = self.memory.query(query)
# Use knowledge to answer
return self.generate_answer(query, knowledge)
def learn(self, query, answer, correct):
if correct:
self.memory.record_success(query, answer)
else:
self.memory.record_failure(query, answer)
Command Line Interface
# Ingest a conversation turn
contexton-ai-oss ingest "What is PM-JAY?" "PM-JAY is health insurance for poor families"
# Query with confidence-ranked results
contexton-ai-oss query "PM-JAY coverage"
# Record that an agent gave a wrong / correct answer
contexton-ai-oss record-failure "What is PM-JAY?" "It's a housing scheme" --reason "wrong"
contexton-ai-oss record-success "What is PM-JAY?" "It's health insurance"
# Skills (procedures)
contexton-ai-oss procedure ingest "Reset password" --steps "Open settings; Go to security; Click reset"
contexton-ai-oss procedure get "Reset password"
# Tools
contexton-ai-oss tools register send_email --description "Sends an email"
contexton-ai-oss tools list
contexton-ai-oss tools outcome send_email --error "SMTP timeout"
# Auto-context for agents
contexton-ai-oss context "PM-JAY coverage" --session sess-1
# Memory hygiene + per-agent view
contexton-ai-oss hygiene
contexton-ai-oss agent-memory health-agent
# Statistics, aliases, visualization, browser demo
contexton-ai-oss stats
contexton-ai-oss aliases
contexton-ai-oss visualize graph.html
contexton-ai-oss web --port 8080 # full browser demo
# All commands accept --data-dir DIR to persist the graph to disk
Documentation
- CONCEPTS.md - Why context-aware AI matters
- TUTORIAL.md - Step-by-step guide
- DEPLOYMENT_GUIDE.md - Market comparison, AI deployment fit, hybrid embedding integration
- COMPARISON.md - Verified market comparison
- UPGRADE.md - Enterprise upgrade path
- LAUNCH_STRATEGY.md - Launch plan and checklist
Enterprise Features
ContextOn.AI OSS is the open-source version, built by ODEFTO AI Labs. For enterprise features, see ContextOn.AI:
| Feature | ContextOn.AI OSS | ContextOn.AI (Enterprise) |
|---|---|---|
| Basic graph building | โ | โ |
| Confidence scoring | โ | โ Enhanced |
| Failure learning | โ | โ Enhanced |
| Quality badges | โ | โ |
| Isolation | โ | โ |
| Quality auditing | โ | โ 5-dimension scoring |
| Drift detection | โ | โ |
| Enterprise connectors | โ | โ SAP, ServiceNow, Salesforce |
| Compliance reporting | โ | โ |
Contributing
We welcome contributions! See CONTRIBUTING.md.
License
Apache 2.0 - See LICENSE
Support
- ๐ง Email: contact@contexton.ai
- ๐ฌ Discussions: GitHub Discussions
- ๐ Issues: GitHub Issues
Acknowledgments
Built by ODEFTO AI Labs.
Inspired by Graphify, Graphiti, and Mem0.
Download files
Download the file for your platform. If you're not sure which to choose, learn more about installing packages.
Source Distribution
Built Distribution
Filter files by name, interpreter, ABI, and platform.
If you're not sure about the file name format, learn more about wheel file names.
Copy a direct link to the current filters
File details
Details for the file contexton_ai_oss-0.4.0.tar.gz.
File metadata
- Download URL: contexton_ai_oss-0.4.0.tar.gz
- Upload date:
- Size: 814.0 kB
- Tags: Source
- Uploaded using Trusted Publishing? No
- Uploaded via: twine/7.0.0 CPython/3.12.10
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
6f4050aca61d774be6a38006cad5337e89eafbafcd86d941c557cb101c918ee2
|
|
| MD5 |
5ede639ff6826013f859af90993bad14
|
|
| BLAKE2b-256 |
d4c6dfebad37cba061dd50aed7146f4ae6de65f9e29933159d7a592e077b9824
|
File details
Details for the file contexton_ai_oss-0.4.0-py3-none-any.whl.
File metadata
- Download URL: contexton_ai_oss-0.4.0-py3-none-any.whl
- Upload date:
- Size: 71.2 kB
- Tags: Python 3
- Uploaded using Trusted Publishing? No
- Uploaded via: twine/7.0.0 CPython/3.12.10
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
8ed1852ccaf7975f6e238e78ebadcadd182018f4619338fb20207d4d8a962d0d
|
|
| MD5 |
0dc53c82a465654172e383dfad619b2d
|
|
| BLAKE2b-256 |
735c5a6be96878653c163f70697dbf598825b1cac9ac5b579a13213cd0616c56
|