Skip to content

Instantly share code, notes, and snippets.

@zseta
Created November 5, 2025 18:37
Show Gist options
  • Select an option

  • Save zseta/d75c8f9fbdb1f47d9b290b381a0baec4 to your computer and use it in GitHub Desktop.

Select an option

Save zseta/d75c8f9fbdb1f47d9b290b381a0baec4 to your computer and use it in GitHub Desktop.
CREATE KEYSPACE semantic_cache WITH replication = {'class': 'NetworkTopologyStrategy', 'replication_factor': '3'};
CREATE TABLE semantic_cache.prompts (
prompt_id uuid PRIMARY KEY,
inserted_at timestamp,
prompt_text text,
prompt_embedding vector<float, 384>,
llm_response text,
updated_at timestamp
);
CREATE INDEX IF NOT EXISTS ann_index ON semantic_cache.prompts(prompt_embedding)
USING 'vector_index'
WITH OPTIONS = { 'similarity_function': 'DOT_PRODUCT' };
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment