Development

Contributing to Cortex development

Setup

git clone https://github.com/thaletto/cortex
cd cortex
bun install

Commands

CommandDescription
bun testRun all tests (17 in-memory + 14 ZVec)
bun run exampleInteractive CLI demo
bun run example/index.ts path/to/file.txtDemo with custom file

Demo

bun run example

Chunks a text file, indexes vectors, and starts an interactive search prompt:

  File: ./example/sample.txt
  Chunks: 8
  Storing vectors...

  Stored 8 chunks. Ready.

Search > Typescript
  [0.468] TypeScript adds static type checking to JavaScript...
  [0.410] designed as a drop-in replacement for Node.js...

Project Structure

src/
  vector-store.ts    # VectorStore service definition
  zvec-collection.ts # ZVec adapter implementation
  in-memory.ts       # InMemory adapter implementation
  errors.ts          # Error types
  schemas.ts         # Effect Schema definitions
example/
  index.ts           # Interactive CLI demo

License

MIT

On this page