Skip to content

Commit c09b889

Browse files
Feature/building with tg (#16)
* New Building with TrustGraph guide section * CLI docs added * Python API docs added
1 parent efc0414 commit c09b889

21 files changed

+1496
-2
lines changed
Lines changed: 88 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,88 @@
1+
---
2+
published: false
3+
title: Command-line advanced configuration
4+
nav_order: 2.7
5+
parent: How-to Guides
6+
grand_parent: TrustGraph Documentation
7+
review_date: 2026-08-01
8+
guide_category:
9+
- Building with TrustGraph
10+
guide_category_order: 7
11+
guide_description: Configure prompts, tools, and system settings using advanced command-line tools
12+
guide_difficulty: advanced
13+
guide_time: 45 min
14+
guide_emoji: ⚙️
15+
guide_banner: /../cli-config.jpg
16+
guide_labels:
17+
- CLI
18+
- Configuration
19+
- Advanced
20+
todo: true
21+
todo_notes: This is just a placeholder.
22+
---
23+
24+
# Advanced configuration settings with command-line tools
25+
26+
### Getting started
27+
28+
- `tg-load-sample-documents` - Load sample documents for testing
29+
30+
### System monitoring
31+
32+
- `tg-verify-system-status` - Verify system health
33+
- `tg-show-processor-state` - Show processor state
34+
- `tg-show-parameter-types` - List parameter types
35+
36+
### Context core management
37+
38+
- `tg-load-kg-core` - Load knowledge graph core
39+
- `tg-unload-kg-core` - Unload knowledge graph core
40+
- `tg-show-kg-cores` - List knowledge graph cores
41+
- `tg-get-kg-core` - Get knowledge graph core details
42+
- `tg-put-kg-core` - Update knowledge graph core
43+
- `tg-delete-kg-core` - Delete knowledge graph core
44+
45+
### Knowledge graph management
46+
47+
- `tg-show-graph` - Display graph structure
48+
- `tg-graph-to-turtle` - Export graph to Turtle format
49+
50+
### Embeddings management
51+
52+
- `tg-load-doc-embeds` - Load document embeddings
53+
- `tg-save-doc-embeds` - Save document embeddings
54+
55+
### Tools and MCP
56+
57+
- `tg-show-tools` - List available tools
58+
- `tg-set-tool` - Configure a tool
59+
- `tg-delete-tool` - Delete a tool
60+
- `tg-show-mcp-tools` - List MCP tools
61+
- `tg-set-mcp-tool` - Configure MCP tool
62+
- `tg-delete-mcp-tool` - Delete MCP tool
63+
- `tg-invoke-mcp-tool` - Invoke MCP tool
64+
65+
### Prompts
66+
67+
- `tg-show-prompts` - List prompts
68+
- `tg-set-prompt` - Configure a prompt
69+
70+
### Configuration
71+
72+
- `tg-show-config` - Display configuration
73+
- `tg-list-config-items` - List configuration items
74+
- `tg-get-config-item` - Get configuration item
75+
- `tg-put-config-item` - Update configuration item
76+
- `tg-delete-config-item` - Delete configuration item
77+
78+
### Token management
79+
80+
- `tg-show-token-costs` - Display token costs
81+
- `tg-show-token-rate` - Show token rate
82+
- `tg-set-token-costs` - Configure token costs
83+
84+
### Initialization and utilities
85+
86+
- `tg-init-trustgraph` - Initialize TrustGraph
87+
- `tg-dump-msgpack` - Dump MessagePack data
88+
- `tg-dump-queues` - Dump queue contents

guides/building/api-overview.png

110 KB
Loading

guides/building/cli-config.jpg

458 KB
Loading

guides/building/cli-docs.jpg

409 KB
Loading

guides/building/cli-tools.md

Lines changed: 133 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,133 @@
1+
---
2+
title: Introduction to command-line tools
3+
nav_order: 2.2
4+
parent: How-to Guides
5+
grand_parent: TrustGraph Documentation
6+
review_date: 2026-08-01
7+
guide_category:
8+
- Building with TrustGraph
9+
guide_category_order: 2
10+
guide_description: Learn to use TrustGraph command-line tools for document processing and knowledge graph operations
11+
guide_difficulty: beginner
12+
guide_time: 5 min
13+
guide_emoji: 💻
14+
guide_banner: /../cli.jpg
15+
guide_labels:
16+
- CLI
17+
- Command-line
18+
---
19+
20+
# Getting started with TrustGraph command-line tools
21+
22+
{% capture requirements %}
23+
<ul style="margin: 0; padding-left: 20px;">
24+
<li>A running TrustGraph deployment</li>
25+
<li>Basic command-line familiarity</li>
26+
</ul>
27+
{% endcapture %}
28+
29+
{% include guide/guide-intro-box.html
30+
description=page.guide_description
31+
difficulty=page.guide_difficulty
32+
duration=page.guide_time
33+
you_will_need=requirements
34+
goal="Learn to use TrustGraph command-line tools for common tasks and automation."
35+
%}
36+
37+
## Command-line tools installation
38+
39+
The TrustGraph CLI tools are provided in the `trustgraph-cli` Python package.
40+
41+
The CLI tools version should match your deployed TrustGraph version. Check your deployment version and install the corresponding CLI version.
42+
43+
{% capture pip_install_version %}
44+
```bash
45+
pip install trustgraph-cli==1.8.10
46+
```
47+
{% endcapture %}
48+
49+
{% capture uv_install_version %}
50+
```bash
51+
uv pip install trustgraph-cli==1.8.10
52+
```
53+
{% endcapture %}
54+
55+
{% capture poetry_install_version %}
56+
```bash
57+
58+
```
59+
{% endcapture %}
60+
61+
{% include code_tabs.html
62+
tabs="pip,uv,poetry"
63+
content1=pip_install_version
64+
content2=uv_install_version
65+
content3=poetry_install_version
66+
%}
67+
68+
## Common CLI arguments
69+
70+
Most TrustGraph CLI tools accept these common arguments:
71+
72+
- `-u, --api-url API_URL` - API URL (default: `http://localhost:8088/`)
73+
- `-t, --token TOKEN` - Authentication token (default: `$TRUSTGRAPH_TOKEN` environment variable)
74+
75+
Example using custom API URL:
76+
```bash
77+
tg-show-flows -u http://my-trustgraph-host:8088/
78+
```
79+
80+
Example using authentication token:
81+
```bash
82+
export TRUSTGRAPH_TOKEN="your-token-here"
83+
tg-show-flows
84+
```
85+
86+
Or pass the token directly:
87+
```bash
88+
tg-show-flows -t "your-token-here"
89+
```
90+
91+
The deployment patterns used in the deployment access the TrustGraph cluster
92+
at `localhost`. Docker/Podman compose expose internal service ports on
93+
`localhost`, and the Kubernetes port-forward commands also expose services
94+
on `localhost`. In this configuration, the default works, and the URL does
95+
not need to be specified.
96+
97+
If an API gateway key is provisioned when the system is deployed, this needs
98+
to be specified with command-line tools in order to authenticate. If no
99+
gateway key is provided, then no token needs to be provided.
100+
101+
## Example commands
102+
103+
Here are a few key commands to get started:
104+
105+
**View running flows:**
106+
```bash
107+
tg-show-flows
108+
```
109+
110+
Shows all active processing flows with their configurations.
111+
112+
**List documents in the library:**
113+
```bash
114+
tg-show-library-documents
115+
```
116+
117+
Displays all documents that have been added to the library.
118+
119+
**Query the LLM directly:**
120+
```bash
121+
tg-invoke-llm "You are a helpful assistant" "What is 2+2?"
122+
```
123+
124+
Sends a direct request to the LLM.
125+
126+
**Query using Graph RAG:**
127+
```bash
128+
tg-invoke-graph-rag -q "Tell me about cats"
129+
```
130+
131+
Retrieves relevant knowledge graph information to answer questions.
132+
133+
For detailed documentation on these and many more commands, see [Command-line document management](document-management-cli).

guides/building/cli.jpg

431 KB
Loading
Lines changed: 23 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,23 @@
1+
---
2+
published: false
3+
title: Adding your own processing
4+
nav_order: 2.9
5+
parent: How-to Guides
6+
grand_parent: TrustGraph Documentation
7+
review_date: 2026-08-01
8+
guide_category:
9+
- Building with TrustGraph
10+
guide_category_order: 9
11+
guide_description: Extend TrustGraph with custom processing components and workflows
12+
guide_difficulty: advanced
13+
guide_time: 1 hr
14+
guide_emoji: ⚙️
15+
guide_banner: /../processing.jpg
16+
guide_labels:
17+
- Custom Processing
18+
- Extensions
19+
todo: true
20+
todo_notes: This is just a placeholder.
21+
---
22+
23+
# Adding your own processing

0 commit comments

Comments
 (0)