What is BetterContext?
API Guide
Quickstart
Comparison
Agents, skills & MCP
How it works?
Experience Engine
Focus Mode
Memory Graph
Files & Folders
Token Usage
Overview
API keys
Invite team member
Tools connection
Usage & Analytics
Ingestion
General
Benchmarking
Billing and Invoice
Security & Compliance
Use cases
From other providers
Upgrade BetterContext
Concepts Copy
The Memory Graph
A high-performance, deterministic knowledge graph linking files, code symbols, team decisions, and operational policies with sub-300ms recall.
BetterContext abandons flat vector stores in favor of an active, multi-relational knowledge graph. Nodes represent grounded facts and code constructs, while edges capture functional, architectural, and causal dependencies.
Node & Entity Ontology
The graph is populated with four distinct node classes:
Functions, classes, schemas, interfaces, and module exports parsed directly from source files.
Markdown documentation, ADRs (Architectural Decision Records), OpenAPI specs, and runbooks.
Git commits, release tags, resolved incident post-mortems, and pull request review discussions.
Negative constraints (e.g. "Never store raw credit card numbers") and regulatory compliance rules.
Confidence Half-Life Decay
Information in engineering organizations changes rapidly. Code is refactored, APIs are deprecated, and team ownership shifts. Static vector databases treat a document written 3 years ago with the same authority as one committed 10 minutes ago.
BetterContext applies a continuous exponential decay model to edge weights:
w(t) = w_0 · 2^(-Δt / t_half)• Active nodes reinforced by recent commits, agent citations, or human verification maintain high confidence (0.95+).
• Orphaned or unreferenced documentation decays in relevance, preventing agents from citing stale or misleading patterns.
Traversing the Graph via Python SDK
from bettercontext import BetterContextClient
client = BetterContextClient()
# Inspect neighbors and dependencies of a specific service
node = client.graph.get_node(id="auth-middleware-v2")
print(f"Node Type: {node.type}")
print(f"Confidence Score: {node.confidence}")
# List inbound and outbound dependencies
for edge in node.edges:
print(f"-> {edge.relation} -> {edge.target_node.title} (Weight: {edge.weight})")
Next Steps
Powered By BetterContext
ON THIS PAGE