Skip to main content

Crate second_brain_adapters

Crate second_brain_adapters 

Source

Modules§

claude_code
claude_memory
cursor
git
markdown
raw_text
repo_instructions
session_evidence

Structs§

ConversationSource
ExtractedEntity
IngestResult
StoreOutcome

Traits§

Adapter
IngestStore
The store surface store_ingest_result writes through. Every StoreAdmin has it through the blanket impl below; tests implement it directly to inject failing writes.

Functions§

encode_project_dir
Claude Code’s project slug for a working directory: every character that is not an ASCII letter or digit becomes -.
project_slug
The project a transcript belongs to is the directory directly under the adapter’s projects root. Nothing below that level is a project: Claude Code nests subagent transcripts as <session>/subagents/*.jsonl and Cursor nests its own as agent-transcripts/<session>/*.jsonl, so the file’s parent directory names the wrong thing for both.
store_document_result
store_ingest_result for versioned documents, whose memories carry ids derived from their content: a memory is skipped only when its id is taken, since an edited document keeps most of its opening text and must still land as a new version.
store_ingest_result
Persists one adapter result: every memory whose id is not already stored or tombstoned and whose first 128 characters are not already stored (embedded first when an embedder is given), its conversation once one of them lands and only if absent, a derived_from edge per stored memory, and a mentions edge per entity whose memory actually landed. Write failures are counted in the outcome rather than returned, so one bad row does not cost the rest.