**feat(docs): add comprehensive Search and Metadata Guide with metadata handling updates**

- **Documentation Additions**:
  - Introduced `SEARCH_AND_METADATA_GUIDE.md` to provide an in-depth guide on Brainy's search and metadata retrieval system:
    - Detailed explanation of search workflows, metadata structures (`GraphNoun`, `GraphVerb`), and core components like `SearchResult`.
    - Usage examples showcasing search queries, filtering by noun/verb types, and advanced features like multi-modal search.
    - Included performance tips on caching, HNSW indexing, lazy loading, and augmentation pipeline.

- **Storage System Updates**:
  - Enhanced memory and file storage adapters to support dedicated noun and verb metadata handling:
    - Added methods `saveN
This commit is contained in:
David Snelling 2025-08-02 16:41:30 -07:00
parent 3892399bab
commit cc6c75befb
5 changed files with 472 additions and 4 deletions

View file

@ -2907,7 +2907,7 @@ export class BrainyData<T = any> implements BrainyDataInterface<T> {
nanoseconds: (now.getTime() % 1000) * 1000000
}
// Create verb
// Create verb data (without metadata fields)
const verb: GraphVerb = {
id,
vector: verbVector,
@ -2918,14 +2918,18 @@ export class BrainyData<T = any> implements BrainyDataInterface<T> {
target: targetId,
verb: verbType as VerbType,
type: verbType, // Set the type property to match the verb type
weight: options.weight,
metadata: options.metadata,
weight: options.weight
}
// Create verb metadata separately
const verbMetadata = {
createdAt: timestamp,
updatedAt: timestamp,
createdBy: {
augmentation: service,
version: '1.0' // TODO: Get actual version from augmentation
}
},
data: options.metadata // Store the original metadata in the data field
}
// Add to index