Skip to Content

Basic Usage

This guide covers saving documents to your Endee vector store and querying them for similarity search.

Saving Documents

Store documents with metadata in your Endee vector store:

documents = [ ("Python is dynamically typed.", {"creator": "Guido van Rossum", "typing": "dynamic"}), ("Go is statically typed.", {"creator": "Robert Griesemer", "typing": "static"}) ] for text, meta in documents: memory_store.save(text, meta) print(f"Saved {len(documents)} documents")

Each document consists of:

  • Text content — The actual text to be embedded and stored
  • Metadata — Key-value pairs for filtering and organization

Querying the Vector Store

Perform semantic search to find relevant documents:

results = memory_store.search( query="Python typing discipline", limit=3, filter={"typing": {"$eq": "dynamic"}} ) for r in results: print(f"ID: {r['id']}, Score: {r['score']}, Text: {r['context']}")

Query Parameters

ParameterTypeDescription
querystrThe search query text
limitintMaximum number of results to return
filterdictOptional metadata filter conditions

Filter Operators

OperatorDescriptionExample
$eqEqual to{"typing": {"$eq": "dynamic"}}
$inIn list{"tags": {"$in": ["ai", "ml"]}}
$rangeNumeric range{"score": {"$range": [70, 95]}}

Query Results

Each result in the response contains:

FieldDescription
idUnique identifier for the document
scoreSimilarity score (higher is more relevant)
contextThe original text content
metadataAssociated metadata

Complete Example

from endee_crewai import EndeeVectorStore import time # Initialize embedder_config = { "provider": "cohere", "config": {"model_name": "small", "api_key": "<COHERE_API_KEY>"} } memory_store = EndeeVectorStore( type="programming_languages", api_token="<ENDEE_API_TOKEN>", embedder_config=embedder_config, space_type="cosine", crew=None, ) # Save documents documents = [ ("Python is dynamically typed and great for beginners.", {"language": "python", "typing": "dynamic"}), ("Go is statically typed with built-in concurrency.", {"language": "go", "typing": "static"}), ("JavaScript runs in browsers and Node.js.", {"language": "javascript", "typing": "dynamic"}), ("Rust provides memory safety without garbage collection.", {"language": "rust", "typing": "static"}) ] for text, meta in documents: memory_store.save(text, meta) time.sleep(1) # Allow indexing # Query for dynamic languages results = memory_store.search( query="beginner friendly programming", limit=2, filter={"typing": {"$eq": "dynamic"}} ) print("Dynamic languages for beginners:") for r in results: print(f" - {r['context']} (score: {r['score']:.4f})")

Next Steps