Skip to main content

ContextSeek semantic context substrate for agent systems.

Project description

ContextSeek

PyPI version PyPI downloads Python 3.11+ License Apache 2.0 Discord

Semantic context infrastructure for AI agents. 中文文档

Overview

Agent self-evolution is taking shape along two technical paths. One extracts and solidifies experience from runtime behavior (e.g. Hermes, OpenHuman). The other evolves the context infrastructure beneath the agent—organizing, updating, and linking context automatically—without modifying agent execution logic.

ContextSeek focuses on the latter. It turns one-off, task-level gains into compounding value across context lifecycles, so heterogeneous agent systems can share a single semantic layer for retrieval, provenance, and evolution.

Three constraints still stand in the way: heterogeneous integration—Memory, Trace, and related components expose incompatible APIs and semantic conventions; insufficient retention—runtime experience is consumed in the prompt window and rarely becomes reusable capability; missing provenance—outputs lack traceable evidence chains. ContextSeek is a unified semantic context layer between LLMs and agent runtimes, converging these capabilities in a single object model: everything is a ContextItem, retrievable and traceable, with automatic progression through raw → extracted → knowledge → skill.

Quick Start

pip install contextseek
from contextseek import ContextSeek

ctx = ContextSeek.from_settings()  # reads .env or environment variables

# Write
ctx.add(
    "OceanBase is a financial-grade distributed database supporting HTAP workloads",
    scope="acme/db/engineer",
    source="wiki",
)

# Retrieve (ranked SearchHits; L1 summaries by default)
for hit in ctx.retrieve("distributed database", scope="acme/db/engineer", k=10):
    text = hit.item.summary or hit.item.content
    print(f"[{hit.item.stage.value}] score={hit.score:.2f} | {text[:100]}")

Configure via .env (see .env.example) or ContextSeekSettings in code. A storage backend, an embedding provider, and an LLM are the three required pieces.

Prefer the command line? The contextseek CLI runs a self-contained personal knowledge base with the embedded seekdb backend — no external service required:

pip install "contextseek[seekdb]"
contextseek init                                   # set up ~/.contextseek/ + background daemon
contextseek sync ~/notes --scope me/work           # import notes/docs (format auto-detected)
contextseek retrieve --scope me/work --query "..." # retrieve from the CLI or expose it over MCP

See the CLI guide for the full command reference.

Documentation

How it works

  • Unified object model — all context — memory, knowledge, traces, skills — is a ContextItem. Items carry mandatory Provenance (source type, source id, confidence) and typed Link edges (supports, refutes, derives, supersedes), enabling a full EvidenceChain DAG with confidence propagation.
  • Content tiers — L0 (full body) is available on demand via expand(). L1 (~2 k tokens) is the default surface returned by retrieve(). L2 (~100 tokens) feeds embedding recall.
  • Retrieval orchestrator — keyword + vector hybrid recall, optional LLM reranking, and scope-based routing. Returns ranked SearchHit rows. Exposes tool specs for OpenAI and Anthropic agents via ctx.tools().
  • EvolutionEngine — watches for items that can be merged, resolved, advanced in stage, or distilled into skills. Runs incrementally after writes or on an explicit compact() call.
  • DreamEngine — idle-time pattern consolidation and cross-cluster hypothesis generation, triggered via dream().
  • HTTP + MCP servers — expose the same operations over FastAPI and the Model Context Protocol for remote agent integrations.

Related Projects

  • seekvfs — underlying virtual filesystem

License

Apache License 2.0

Project details


Download files

Download the file for your platform. If you're not sure which to choose, learn more about installing packages.

Source Distribution

contextseek-0.1.2.tar.gz (630.2 kB view details)

Uploaded Source

Built Distribution

If you're not sure about the file name format, learn more about wheel file names.

contextseek-0.1.2-py3-none-any.whl (232.8 kB view details)

Uploaded Python 3

File details

Details for the file contextseek-0.1.2.tar.gz.

File metadata

  • Download URL: contextseek-0.1.2.tar.gz
  • Upload date:
  • Size: 630.2 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? Yes
  • Uploaded via: twine/6.1.0 CPython/3.13.12

File hashes

Hashes for contextseek-0.1.2.tar.gz
Algorithm Hash digest
SHA256 cfc69ee32207a76e7b7d5e1efd437823b07f02e61373c8f1d2b531068cdd772e
MD5 19fc0ce3adc54c2222886737e12894af
BLAKE2b-256 a9ec713d278814c0997f91b5b2117f35a4d4aef89385509733d185b4d753609c

See more details on using hashes here.

Provenance

The following attestation bundles were made for contextseek-0.1.2.tar.gz:

Publisher: release.yml on ob-labs/contextseek

Attestations: Values shown here reflect the state when the release was signed and may no longer be current.

File details

Details for the file contextseek-0.1.2-py3-none-any.whl.

File metadata

  • Download URL: contextseek-0.1.2-py3-none-any.whl
  • Upload date:
  • Size: 232.8 kB
  • Tags: Python 3
  • Uploaded using Trusted Publishing? Yes
  • Uploaded via: twine/6.1.0 CPython/3.13.12

File hashes

Hashes for contextseek-0.1.2-py3-none-any.whl
Algorithm Hash digest
SHA256 cb766b5dc652e253ea9af20a74682ab532ad968590ea44a25188e72d8e0ff6f0
MD5 380c65d88f2125c18001a60333c0f527
BLAKE2b-256 6e0562c24fd67d4b53313efa64a1da03d5a28d2a8a80486177621e63dda9722d

See more details on using hashes here.

Provenance

The following attestation bundles were made for contextseek-0.1.2-py3-none-any.whl:

Publisher: release.yml on ob-labs/contextseek

Attestations: Values shown here reflect the state when the release was signed and may no longer be current.

Supported by

AWS Cloud computing and Security Sponsor Datadog Monitoring Depot Continuous Integration Fastly CDN Google Download Analytics Pingdom Monitoring Sentry Error logging StatusPage Status page