Skip to content

Repository files navigation

ContextOS

Turn fragmented organizational context into an evidence-backed operational briefing.

ContextOS demonstrates a production-oriented agentic pipeline: deterministic workflow around probabilistic reasoning. It collects mock Gmail, Slack, Calendar, and Notion context locally, normalizes records into typed domain models, correlates related signals, validates provenance, and publishes an idempotent daily briefing to a mock Notion adapter.

Architecture

Scheduler/API -> Collection -> Normalization -> Deduplication
             -> Classification -> Extraction -> Correlation
             -> Prioritization -> Briefing -> Validation -> Notion

Code controls orchestration. Agent nodes are narrow, structured, and testable. MCP is the capability boundary, skills provide operating instructions, PostgreSQL is durable state, Redis is coordination, evals are quality gates.

Local Demo

cp .env.example .env
make install
make seed
make demo

The demo uses built-in mock MCP fixtures, including cross-source API migration signals, irrelevant noise, conflicting context, and prompt-injection examples.

Why MCP

Business logic depends on the ContextSource interface, not Gmail, Slack, Calendar, or Notion SDKs. Real production MCP servers can be configured externally; local development remains fully runnable without credentials.

Why LangGraph

The graph boundary keeps workflow order deterministic while allowing scoped reasoning nodes for classification, extraction, prioritization, and briefing generation.

Why Skills

The skills/ directory captures reusable operating procedures for daily briefings, email triage, Slack triage, meeting prep, and Notion publishing.

Why PostgreSQL

Briefings, context items, workflow runs, tool calls, and evaluation runs have durable schema, constraints, and idempotency keys. SQLite is the local default for frictionless tests; Docker Compose uses PostgreSQL.

Why Evals

Agentic systems need measurable quality. make eval enforces schema validity, provenance coverage, duplicate rate, and validation gates without requiring an LLM.

Security

External content is untrusted data. Prompt-injection patterns are detected, source content is delimited, write capabilities are least-privilege, and only Notion write is allowed in the first release.

Useful Commands

make test
make lint
make typecheck
make eval
make run-pipeline
make build

Example Briefing

Action Required
---------------
1. Send API migration status
   Due: 2026-09-23T12:00:00+00:00
   Sources: gmail:gmail-001

Today's Meetings
----------------
1. API migration review
   Meeting at 2026-09-23T14:00:00+00:00
   Sources: calendar:cal-001

About

No description, website, or topics provided.

Resources

Security policy

Stars

0 stars

Watchers

0 watching

Forks

Releases

Packages

Contributors

Languages