View Source Store (fnord v0.4.34)
This module provides the functionality for storing and retrieving embeddings and metadata for files.
Summary
Functions
Creates the project directory if it does not already exist. This will create a new directory in the store with the name of the project.
Permanently deletes the specified file from the store. Note that this is only exposed for the sake of testing.
Permanently delete any files that are indexed but no longer exist on disk.
Permanently deletes the specified project's index directory and all its contents.
Get the metadata, summary, and embeddings for the specified file. Returns
{:ok, info}
if the file exists, or {:error, :not_found}
if it does not.
Get the embeddings for the specified file. Returns {:ok, embeddings}
if the
file exists, or {:error, :not_found}
if it does not. Note that if the input
file was greater than 8192 tokens, the embeddings will be split into multiple
chunks.
Get the path to the directory containing the metadata for the specified file.
Get the hash for the specified file. Returns {:ok, hash}
if the file
exists, or {:error, :not_found}
if it does not.
Get the key for the specified file, which is based on the file's full path and is used as the directory name for the file's metadata.
Get the symbol/ctags style outline for the specified file. Returns {:ok, outline}
if the file exists, or {:error, :not_found}
if it does not.
Get the project directory. This is the directory where the project's files are stored.
Get the summary for the specified file. Returns {:ok, summary}
if the file
exists, or {:error, :not_found}
if it does not.
Check if the specified file has embeddings. Returns true
if any exist,
false
otherwise.
Check if the specified file has an outline outline. Returns true
if the file
exists, or false
if it does not.
Check if the specified file has a summary file. Returns true
if the file exists,
or false
if it does not.
Get the metadata for the specified file. Returns {:ok, data}
if the file
exists, or {:error, :not_found}
if it does not. The structure of the
metadata is as follows
List all indexed files in the project. Returns a list of absolute, expanded, file paths.
List all projects in the store. Returns a list of project names.
Returns true if the selected project exists in the store. A project exists in the store if
Store the metadata, summary, and embeddings for the specified file. If the file already exists in the store, it will be overwritten.
Functions
Creates the project directory if it does not already exist. This will create a new directory in the store with the name of the project.
Permanently deletes the specified file from the store. Note that this is only exposed for the sake of testing.
Permanently delete any files that are indexed but no longer exist on disk.
Permanently deletes the specified project's index directory and all its contents.
Get the metadata, summary, and embeddings for the specified file. Returns
{:ok, info}
if the file exists, or {:error, :not_found}
if it does not.
The structure of the returned info
is as follows:
%{
file: "path/to/file.ext",
hash: "DEADBEEF",
timestamp: "2021-01-01T00:00:00Z",
summary: "AI-generated summary of the file",
embeddings: [
[0.1, 0.2, 0.3, ...],
[0.4, 0.5, 0.6, ...],
...
]
}
Get the embeddings for the specified file. Returns {:ok, embeddings}
if the
file exists, or {:error, :not_found}
if it does not. Note that if the input
file was greater than 8192 tokens, the embeddings will be split into multiple
chunks.
Get the path to the directory containing the metadata for the specified file.
Get the hash for the specified file. Returns {:ok, hash}
if the file
exists, or {:error, :not_found}
if it does not.
Get the key for the specified file, which is based on the file's full path and is used as the directory name for the file's metadata.
Get the symbol/ctags style outline for the specified file. Returns {:ok, outline}
if the file exists, or {:error, :not_found}
if it does not.
Get the project directory. This is the directory where the project's files are stored.
Get the summary for the specified file. Returns {:ok, summary}
if the file
exists, or {:error, :not_found}
if it does not.
Check if the specified file has embeddings. Returns true
if any exist,
false
otherwise.
Check if the specified file has an outline outline. Returns true
if the file
exists, or false
if it does not.
Check if the specified file has a summary file. Returns true
if the file exists,
or false
if it does not.
Get the metadata for the specified file. Returns {:ok, data}
if the file
exists, or {:error, :not_found}
if it does not. The structure of the
metadata is as follows:
%{
file: "path/to/file.ext",
hash: "DEADBEEF",
timestamp: "2021-01-01T00:00:00Z",
fnord_path: "path/to/store/FEEBDAED"
}
List all indexed files in the project. Returns a list of absolute, expanded, file paths.
List all projects in the store. Returns a list of project names.
Create a new Store
struct.
Returns true if the selected project exists in the store. A project exists in the store if:
- The project directory exists in the store.
- There are entries in the project directory.
Store the metadata, summary, and embeddings for the specified file. If the file already exists in the store, it will be overwritten.