Skip to content

Commit

Permalink
Docs
Browse files Browse the repository at this point in the history
  • Loading branch information
awhiteside1 committed Sep 17, 2024
1 parent 3ccf62d commit 84eec67
Show file tree
Hide file tree
Showing 17 changed files with 234 additions and 0 deletions.
15 changes: 15 additions & 0 deletions docs/system/Metering.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,15 @@
# Metering

## Purpose

LLMs and Embedding models often are billed resources, so we want to ensure usage is limited and capped as desired.

## Interface

Creates a global llm usage collection

## Key Details

- Ensure accurate and real-time metrics collection.
- Provide actionable insights based on collected metrics.
- Maintain data privacy and security.
13 changes: 13 additions & 0 deletions docs/system/chat/ConversationalUI.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,13 @@
# Conversational UI

## Purpose

Provide a conversational chat UI with message history and non-text display which can be embedded or accessed on a full page.

## Interface

- Access via FAB
- Dedicated Page
- Include conversation history
- Messages should support both markdown and cards

15 changes: 15 additions & 0 deletions docs/system/chat/LLMs.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,15 @@
# Large Language Models (LLMs)

## Purpose

Provide a reusable set of LLMs that can be used by the system easily for the right tasks. It should be easy to provide custom LLMs to the interface, and use local models in development.

## Access

LLMs should be accessible under custom for usage, subject to [Metering](../Metering.md) limits


## Built in models

- ollama
- openai
36 changes: 36 additions & 0 deletions docs/system/chat/MessageCollection.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,36 @@
# Chat Message Collection

## Purpose

Stores each message in a conversation, making them available to use as context and display to the user

## Interface

```mermaid
erDiagram
USER{
string id
string name
}
MESSAGE {
string id
string content
string role
string conversationID
relation user
relationships references
timestamp sent
}
MESSAGE ||--o{ USER : user
```

## Key Details

- Collection Will be added to the payload configuration during plugin initialization.
- Messages Will be readable only by the user who created it
- Messages Supports roles: 'assistant' and 'user' and 'tools
- References field can store links to relevant documents used
- Timestamp allows for chronological ordering of messages
Empty file.
32 changes: 32 additions & 0 deletions docs/system/semantic-search/EmbeddingModel.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,32 @@
# Embedding Model

## Purpose

Convert chunks of text into comparable vectors for indexing and semantic serach.

## Integration

Integrated with the VectorStore to automatically embed queries/index documents as they are added. Provided in the form of a class

```ts

class CustomEmbeddingModel extends EmbeddingModel {

private model = new ModelClient();

generateEmbeddings(texts: string[]): number[] {
return this.model.embed(text);
}

numberOfDimensions() {
return 768;
}

}

```

## Included Integrations

- Ollama
- OpenAI
40 changes: 40 additions & 0 deletions docs/system/semantic-search/IndexableFields.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,40 @@
# Indexable Fields

## Purpose

Easily define what to index and how to query it using Payload Fields. This enables using existing fields or creating hidden virtual ones. Indexes are partitioned for performance and automatically integrate via collection hooks.

## Interface

```mermaid
flowchart
subgraph Collection
direction TB
create[Create] --> change[After Change Hook ]
update[Update] --> change
delete[Delete] --> change
end
search[Search]
subgraph VectorStore
direction TB
embedding[Embedding Model]
persist[Persistance]
embedding <--> persist
end
search --> embedding
change --> embedding
```

## Key Details

- Configure any field by name `collection.field`
- Backfills existing fields
- Updates only when field changes

9 changes: 9 additions & 0 deletions docs/system/semantic-search/RelatedDocumentsField.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,9 @@
# Related Documents Field

## Purpose

Provide a Custom Field type that automatically suggests and links related documents based on semantic similarity.

## Interface

Configurable based on top X closest, or within X distance
6 changes: 6 additions & 0 deletions docs/system/semantic-search/SearchInterface.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,6 @@
# Search Interface

## Purpose

Provide a search UI Element that hooks into semantic search.

37 changes: 37 additions & 0 deletions docs/system/semantic-search/VectorStore.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,37 @@
# Vector Store

## Purpose

Efficiently store, index, and query vector representations of content for semantic search and similarity comparisons.


## Identifier

```ts

type Identifier = {
documentID: string
collection: string
field: string
}

```

## Class Integration

```ts

class MyVectorStore extends VectorDB{

upsert:(id: Identifier, value:string) => Promise<void>
delete:(id: Identifier) => Promise<void>
search:(filter: Partial<Identifier>, query: string) => Promise<Identifier &{distance: number}>

}

```

## Included Implementation

LanceDB

5 changes: 5 additions & 0 deletions docs/use-cases/documentation-chatbot.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
# Documentation chatbot

Give your users a friendly chatbot that's integrated with you CMS managed documentation, always up to date.

## Analyze questions users ask
9 changes: 9 additions & 0 deletions docs/use-cases/draft-new-documents.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,9 @@
# Draft new documents

## Prefill fields on create from prompt

- Use previous documents as few shot training

## Backfill new fields on existing documents

## Compare to other docs and alert on thigns
7 changes: 7 additions & 0 deletions docs/use-cases/improve-seo.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,7 @@
# IImprove SEO

Find gaps and opportunities for additional content, or where to merge content.

## Visualize Posts

## Compare with AHREFs
1 change: 1 addition & 0 deletions docs/use-cases/improved-search.md
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
# Improve Search
1 change: 1 addition & 0 deletions docs/use-cases/personalized-email-graphics.md
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
# Personalized email graphics
5 changes: 5 additions & 0 deletions docs/use-cases/personalized-recommendations.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
# Personalized Recommendations

## Based on whats in your cart

## Based on questions asked
3 changes: 3 additions & 0 deletions docs/use-cases/related-posts.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
# Related Posts

Use embeddings to recommend related posts, products, etc.

0 comments on commit 84eec67

Please sign in to comment.