[go: nahoru, domu]

Skip to content

Commit

Permalink
Update documentation
Browse files Browse the repository at this point in the history
  • Loading branch information
davidmezzetti committed Apr 20, 2023
1 parent 4c9d972 commit 37dee54
Show file tree
Hide file tree
Showing 6 changed files with 18 additions and 12 deletions.
11 changes: 7 additions & 4 deletions docs/embeddings/configuration/index.md
Original file line number Diff line number Diff line change
Expand Up @@ -106,11 +106,12 @@ Instruction-based models use prefixes to modify how embeddings are computed. Thi

## backend
```yaml
backend: faiss|hnsw|annoy
backend: faiss|hnsw|annoy|custom
```

Approximate Nearest Neighbor (ANN) index backend for storing generated sentence embeddings. `Defaults to faiss`. Additional backends require the
[similarity](../../install/#similarity) extras package to be installed.
[similarity](../../install/#similarity) extras package to be installed. Add custom backends via setting this parameter to the fully resolvable
class string.

Backend-specific settings are set with a corresponding configuration object having the same name as the backend (i.e. annoy, faiss, or hnsw). None of these are required and are set to defaults if omitted.

Expand Down Expand Up @@ -159,10 +160,10 @@ See [Annoy documentation](https://github.com/spotify/annoy#full-python-api) for

## content
```yaml
content: string|boolean
content: boolean|sqlite|duckdb|custom
```

Enables content storage. When true, the default content storage engine will be used. `Defaults to sqlite`. Otherwise, the string must specify the supported content storage engine to use.
Enables content storage. When true, the default storage engine, `sqlite` will be used. Also supports `duckdb`. Add custom storage engines via setting this parameter to the fully resolvable class string.

## functions
```yaml
Expand Down Expand Up @@ -205,6 +206,8 @@ graph:

Enables graph storage. When set, a graph network is built using the embeddings index. Graph nodes are synced with each embeddings index operation (index/upsert/delete). Graph edges are created using the embeddings index upon completion of each index/upsert/delete embeddings index call.

Add custom graph storage engines via setting the `graph.backend` parameter to the fully resolvable class string.

Defaults are tuned so that in most cases these values don't need to be changed.

### topics
Expand Down
3 changes: 2 additions & 1 deletion src/python/txtai/ann/base.py
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,8 @@

class ANN:
"""
Base class for ANN instances.
Base class for ANN instances. This class builds vector indexes to support similarity search.
The built-in ANN backends store ids and vectors. Content storage is supported via database instances.
"""

def __init__(self, config):
Expand Down
5 changes: 3 additions & 2 deletions src/python/txtai/database/base.py
Original file line number Diff line number Diff line change
Expand Up @@ -14,8 +14,9 @@

class Database:
"""
Base class for database instances. This class encapsulates a document-oriented database
used for storing key-value content stored as dicts.
Base class for database instances. This class encapsulates a content database used for
storing field content as dicts and objects. The database instance works in conjuction
with a vector index to execute SQL-driven similarity search.
"""

def __init__(self, config):
Expand Down
6 changes: 3 additions & 3 deletions src/python/txtai/database/factory.py
Original file line number Diff line number Diff line change
Expand Up @@ -36,10 +36,10 @@ def create(config):
content = "sqlite"

# Create document database instance
if content == "sqlite":
database = SQLite(config)
elif content == "duckdb":
if content == "duckdb":
database = DuckDB(config)
elif content == "sqlite":
database = SQLite(config)
elif content:
database = DatabaseFactory.resolve(content, config)

Expand Down
3 changes: 2 additions & 1 deletion src/python/txtai/graph/base.py
Original file line number Diff line number Diff line change
Expand Up @@ -18,7 +18,8 @@
# pylint: disable=R0904
class Graph:
"""
Base class for Graph instances.
Base class for Graph instances. This class builds graph networks. Supports topic modeling
and relationship traversal.
"""

def __init__(self, config):
Expand Down
2 changes: 1 addition & 1 deletion src/python/txtai/vectors/base.py
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,7 @@

class Vectors:
"""
Base class for sentence embeddings/vector models.
Base class for sentence embeddings/vector models. Vector models transform input content into numeric vectors.
"""

def __init__(self, config, scoring):
Expand Down

0 comments on commit 37dee54

Please sign in to comment.