Skip to main content

Ingestion boundary — collect raw sessions from many sources, normalize, push to a memory system.

Project description

collectbase

摄入边界(ingestion boundary):把各来源的原始会话收拢、归一成标准 session,推进 memory system。

collectbase 是从 memory.talk 里进程内的 sync 剥离出来的独立服务,与 seekbase 平级:

  • seekbase 管「数据怎么存怎么查」;
  • collectbase 管「经验怎么进来」。

内部按数据来源拆成一个个 worker(claude-code / codex / openclaw / …):每个来源一个 worker,各自监听上游、把私有格式归一成标准 session、经 ingest 接口推给 memory。它认识「来源、游标、rounds」,不结晶、不治理、不碰数据库。

collectbase 是独立模块:核心只依赖 pydantic + aiosqlite,对 memory system 只经 HTTP ingest 接口(/v3/sessions/ensure · /append)说话,不 import 任何 memory 侧代码。

独立运行

pip install -e ".[http,watch]"        # http=HttpSink, watch=fs 实时监听
cp collectbase.example.toml collectbase.toml   # 填 sink.base_url + [[workers]]
collectbase serve  -c collectbase.toml   # 常驻:backfill + watch
collectbase status -c collectbase.toml   # 一次冷扫,打印 totals 退出

嵌入用法(库):

from collectbase import Collectbase, HttpSink
from collectbase.workers import ClaudeCodeWorker

cb = await Collectbase.open(
    checkpoint_dir="./collect",
    sink=HttpSink("http://memory-host:8000"),
    workers=[ClaudeCodeWorker()],           # 或 CodexWorker / OpenclawWorker
)
await cb.start(); ...; await cb.close()

内置 worker:claude-code · codex(fs 型)· openclaw(HTTP poll 型)。加一个来源见 docs/worker.md

文档

设计与契约见 DESIGN.md;子系统展开见 docs/——重点是 docs/worker.md(怎么用几十行写一个 worker:声明监听哪些文件、把一条记录解析成标准 round)与 docs/session-format.md(标准化产物)。

状态:M1+M2 已实现并测试(29 passed);engine / checkpoint / sink(InProcess + Http)/ 三个内置 worker 齐活,可独立跑通。

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

collectbase-0.1.0.tar.gz (54.3 kB view details)

Uploaded Source

Built Distribution

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

collectbase-0.1.0-py3-none-any.whl (30.6 kB view details)

Uploaded Python 3

File details

Details for the file collectbase-0.1.0.tar.gz.

File metadata

  • Download URL: collectbase-0.1.0.tar.gz
  • Upload date:
  • Size: 54.3 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/6.2.0 CPython/3.11.2

File hashes

Hashes for collectbase-0.1.0.tar.gz
Algorithm Hash digest
SHA256 2c3d80dac8fbf09efff6f42c8d655a00807b95afad1afb2e2463c8c3f6759f27
MD5 7365fef1e61845f933c8b5cf8dd0fd73
BLAKE2b-256 3a60231175d8b3320c44a0947fd26d1c6b9031564787ed4d372f57df7b9517fd

See more details on using hashes here.

File details

Details for the file collectbase-0.1.0-py3-none-any.whl.

File metadata

  • Download URL: collectbase-0.1.0-py3-none-any.whl
  • Upload date:
  • Size: 30.6 kB
  • Tags: Python 3
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/6.2.0 CPython/3.11.2

File hashes

Hashes for collectbase-0.1.0-py3-none-any.whl
Algorithm Hash digest
SHA256 88064b9dd53017e447668a332396a9dc62f0f2f7d35dfe352d133fd8b2a929b5
MD5 468445a772da79bb0c79ca836a81fe0a
BLAKE2b-256 e0ce7050d5be6a373dde6a07ac6290bba22bd524155c0c100b561d83c97ab2f8

See more details on using hashes here.

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