Skip to main content

Crow memory service: LanceDB store + ColBERT/ColPali multivector embeddings for text and images

Project description

crow-memory

Crow's memory service. A FastAPI HTTP service backed by LanceDB with two resident multivector embedders:

  • ColBERT (lightonai/GTE-ModernColBERT-v1) — text embeddings for messages.
  • ColQwen2 / ColPali (vidore/colqwen2-v1.0) — image embeddings (vision-language late-interaction, same MaxSim mechanism as ColBERT).

Why a service

query_memory runs in the crow-mcp process while sessions run in crow-cli processes. They are different processes that must share one memory store and one copy of ~5GB of models. In-process embedding would load the models per process and lose shared-memory semantics. So: a service.

Tables (LanceDB)

table contents embedding
prompts id, name, template, created_at
agents agent_id, session_id, agent_idx, cwd, prompt_args, tools, …
messages one row = one message (JSON, images extracted), token counts ColBERT (text)
images image_id (sha256), mime, raw bytes, w, h ColQwen2 (patches)

Images are content-addressed (sha256 of decoded bytes): free dedupe, cache-stable, and the message record stays lean (a tiny image_ref replaces the inline base64 blob).

Image ingest flow

message with inline base64 image
  -> decode bytes -> sha256 -> image_id
  -> if new: resize(max_dim) -> ColQwen2 embed -> store {image_id, mime, bytes, w, h, mv} in images
  -> replace inline block with {"type":"image_ref","image_id":...,"mime":...,"w":..,"h":..}
  -> ColBERT embed the (image-free) text -> store message with mv

Measured latency (RTX 3070Ti, 8GB)

  • text embed: ~10 ms/doc (sync) · image embed: ~250 ms/image after resize (sync is fine next to an LLM call)
  • both models resident: 5.3 GB / 8.2 GB, ~2.9 GB headroom
  • search: text→text 18 ms · text→image 44 ms · image→image 19 ms

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

crow_memory-0.1.30.tar.gz (104.6 kB view details)

Uploaded Source

Built Distribution

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

crow_memory-0.1.30-py3-none-any.whl (16.9 kB view details)

Uploaded Python 3

File details

Details for the file crow_memory-0.1.30.tar.gz.

File metadata

  • Download URL: crow_memory-0.1.30.tar.gz
  • Upload date:
  • Size: 104.6 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? Yes
  • Uploaded via: uv/0.12.0 {"installer":{"name":"uv","version":"0.12.0","subcommand":["publish"]},"python":null,"implementation":{"name":null,"version":null},"distro":{"name":"Ubuntu","version":"24.04","id":"noble","libc":null},"system":{"name":null,"release":null},"cpu":null,"openssl_version":null,"setuptools_version":null,"rustc_version":null,"ci":true}

File hashes

Hashes for crow_memory-0.1.30.tar.gz
Algorithm Hash digest
SHA256 ef5e888e874b139b11aaff5f54991ff4aa7cf6f5b97a204bf842d7d83d80d941
MD5 7a1963ad20f1fcd4608b326367be3829
BLAKE2b-256 35750ed628adbe3c3c13ef8275255617c7b9172e6614b8de2cf30745ebce4415

See more details on using hashes here.

File details

Details for the file crow_memory-0.1.30-py3-none-any.whl.

File metadata

  • Download URL: crow_memory-0.1.30-py3-none-any.whl
  • Upload date:
  • Size: 16.9 kB
  • Tags: Python 3
  • Uploaded using Trusted Publishing? Yes
  • Uploaded via: uv/0.12.0 {"installer":{"name":"uv","version":"0.12.0","subcommand":["publish"]},"python":null,"implementation":{"name":null,"version":null},"distro":{"name":"Ubuntu","version":"24.04","id":"noble","libc":null},"system":{"name":null,"release":null},"cpu":null,"openssl_version":null,"setuptools_version":null,"rustc_version":null,"ci":true}

File hashes

Hashes for crow_memory-0.1.30-py3-none-any.whl
Algorithm Hash digest
SHA256 c0b65adfc7ec0b99d4ed48fcae754334191853fb8ac53564ceca95813317766f
MD5 2759dcc72630c6430d47f357a110675a
BLAKE2b-256 da460bdc106785a05b7549196cff0f30357a19ec7368cba335f5e3bba040cfb7

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