Skip to main content

Storing Cognitive Cores

caution

If you plan on storing a cognitive core, the storage scripts must be started PRIOR to beginning to the extraction process.

Cognitive Core CLI​

pip3 install trustgraph-cli
note

The trustgraph-cli version needs to match the version of TrustGraph.

Storing During Extraction​

Before beginning an extraction process, open a new terminal window. One window will be used to interact with TrustGraph while the other terminal window will run the storage command while TrustGraph runs the extraction process.

In the second terminal window:

tg-save-kg-core -o <cognitive-core-name>

In the main TrustGraph window, you can now begin the extraction process with the document loader commands. Periodically, the storage scripts will dump the extracted graph edges and embeddings. Once the Cognitive Core has been successfully saved, the storage process must be ended manually. In the second terminal window, enter ctrl+c to end the process.

Document RAG Cores​

While Graph RAG generally produces the better responses, it's possible to save just the vector embeddings to perform RAG requests on a single document.

tg-save-doc-embeds -o <document-core-name>