Skip to main content

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.
  • seekvfs — underlying virtual filesystem

License

Apache License 2.0

Metadata

Release files for contextseek 0.1.3

For a detailed explanation of source distributions (sdists) and built distributions (wheels), please see the package formats documentation.

Source distribution (sdist)

Source distribution for contextseek 0.1.3
File Size Uploaded
contextseek-0.1.3.tar.gz 690.1 kB Details

Built distribution (wheel)

Table of built distributions (wheels) for contextseek 0.1.3
File Interpreter ABI Platform
contextseek-0.1.3-py3-none-any.whl Python 3 none any Details

Total release size: 932.8 kB

Release files / contextseek-0.1.3.tar.gz

Download URL contextseek-0.1.3.tar.gz
Size 690.1 kB
Tags Source
SHA-256 checksum
How to use checksums
b1fd4dbff49ddd7492437fc40c7bfb1c576e180323fb045e217fcd5084b1d352
BLAKE2b-256 checksum
How to use checksums
60c1d24aa16de6fdfdc032cb7239369df47970e2b20dba21b74fdc2f86776d5b
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
Yes
Uploaded via twine/6.1.0 CPython/3.13.12

Provenance

Provenance describes where a file came from. On PyPI, provenance is shared via attestations, which provide a verifiable record of the build or publishing details. View details, limitations and caveats.

PyPI Publish Attestation

PyPI verified that this artifact, at this checksum, originated from the publisher listed below.

Signed by GitHub Actions, verified by PyPI on Jun 8, 2026.

Transparency log

Release files / contextseek-0.1.3-py3-none-any.whl

Download URL contextseek-0.1.3-py3-none-any.whl
Size 242.7 kB
Tags Python 3
SHA-256 checksum
How to use checksums
62b6e2f1b923c981a67244db5e456f4604333ababd8bf520c81748f1ba981e60
BLAKE2b-256 checksum
How to use checksums
10df9232ec6a87e79310dce683d1b4648fe862c59440e4b8385d0cb8295e76dd
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
Yes
Uploaded via twine/6.1.0 CPython/3.13.12

Provenance

Provenance describes where a file came from. On PyPI, provenance is shared via attestations, which provide a verifiable record of the build or publishing details. View details, limitations and caveats.

PyPI Publish Attestation

PyPI verified that this artifact, at this checksum, originated from the publisher listed below.

Signed by GitHub Actions, verified by PyPI on Jun 8, 2026.

Transparency log

Release history Release notifications | RSS feed

This release

0.1.3 This release

2 release files

0.1.2

2 release files

0.1.1

2 release files

0.1.0

2 release files

Anthropic, PBC Visionary sponsor Bloomberg Visionary sponsor Hudson River Trading Visionary sponsor Meta Visionary sponsor NVIDIA Visionary sponsor Microsoft Sustainability sponsor Depot Continuous Integration AWS Cloud computing and Security Sponsor Datadog Monitoring Fastly CDN Google Download Analytics Sentry Error logging StatusPage Status page