agentgraph-server 0.5.0__tar.gz
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- agentgraph_server-0.5.0/.agents/skills/graph/SKILL.md +159 -0
- agentgraph_server-0.5.0/.agents/skills/slack-auth/SKILL.md +92 -0
- agentgraph_server-0.5.0/LICENSE +21 -0
- agentgraph_server-0.5.0/PKG-INFO +286 -0
- agentgraph_server-0.5.0/README.md +246 -0
- agentgraph_server-0.5.0/agentgraph/__init__.py +1 -0
- agentgraph_server-0.5.0/agentgraph/auth/__init__.py +0 -0
- agentgraph_server-0.5.0/agentgraph/auth/credentials.py +224 -0
- agentgraph_server-0.5.0/agentgraph/backends/__init__.py +50 -0
- agentgraph_server-0.5.0/agentgraph/backends/sqlite/__init__.py +1 -0
- agentgraph_server-0.5.0/agentgraph/backends/sqlite/backend.py +1471 -0
- agentgraph_server-0.5.0/agentgraph/backends/sqlite/vector.py +142 -0
- agentgraph_server-0.5.0/agentgraph/cli.py +721 -0
- agentgraph_server-0.5.0/agentgraph/cli_query.py +519 -0
- agentgraph_server-0.5.0/agentgraph/config.py +90 -0
- agentgraph_server-0.5.0/agentgraph/connectors/__init__.py +0 -0
- agentgraph_server-0.5.0/agentgraph/connectors/base.py +455 -0
- agentgraph_server-0.5.0/agentgraph/connectors/registry.py +78 -0
- agentgraph_server-0.5.0/agentgraph/connectors/status.py +244 -0
- agentgraph_server-0.5.0/agentgraph/core/__init__.py +0 -0
- agentgraph_server-0.5.0/agentgraph/core/context.py +26 -0
- agentgraph_server-0.5.0/agentgraph/core/runtime.py +36 -0
- agentgraph_server-0.5.0/agentgraph/core/storage.py +240 -0
- agentgraph_server-0.5.0/agentgraph/graph/__init__.py +1 -0
- agentgraph_server-0.5.0/agentgraph/graph/bookmark.py +87 -0
- agentgraph_server-0.5.0/agentgraph/graph/delete.py +17 -0
- agentgraph_server-0.5.0/agentgraph/graph/download.py +35 -0
- agentgraph_server-0.5.0/agentgraph/graph/embeddings.py +58 -0
- agentgraph_server-0.5.0/agentgraph/graph/fetch.py +53 -0
- agentgraph_server-0.5.0/agentgraph/graph/gc.py +26 -0
- agentgraph_server-0.5.0/agentgraph/graph/link.py +63 -0
- agentgraph_server-0.5.0/agentgraph/graph/person.py +40 -0
- agentgraph_server-0.5.0/agentgraph/graph/query.py +244 -0
- agentgraph_server-0.5.0/agentgraph/graph/upsert.py +49 -0
- agentgraph_server-0.5.0/agentgraph/logging.py +78 -0
- agentgraph_server-0.5.0/agentgraph/mcp/__init__.py +0 -0
- agentgraph_server-0.5.0/agentgraph/mcp/server.py +811 -0
- agentgraph_server-0.5.0/agentgraph/perf.py +43 -0
- agentgraph_server-0.5.0/agentgraph/server/__init__.py +0 -0
- agentgraph_server-0.5.0/agentgraph/server/app.py +133 -0
- agentgraph_server-0.5.0/agentgraph/server/cli_api.py +708 -0
- agentgraph_server-0.5.0/agentgraph/server/dwell.py +79 -0
- agentgraph_server-0.5.0/agentgraph/server/graph_api.py +46 -0
- agentgraph_server-0.5.0/agentgraph/server/router.py +47 -0
- agentgraph_server-0.5.0/agentgraph/server/sync.py +247 -0
- agentgraph_server-0.5.0/agentgraph/skills.py +93 -0
- agentgraph_server-0.5.0/agentgraph_server.egg-info/PKG-INFO +286 -0
- agentgraph_server-0.5.0/agentgraph_server.egg-info/SOURCES.txt +78 -0
- agentgraph_server-0.5.0/agentgraph_server.egg-info/dependency_links.txt +1 -0
- agentgraph_server-0.5.0/agentgraph_server.egg-info/entry_points.txt +2 -0
- agentgraph_server-0.5.0/agentgraph_server.egg-info/requires.txt +37 -0
- agentgraph_server-0.5.0/agentgraph_server.egg-info/top_level.txt +1 -0
- agentgraph_server-0.5.0/pyproject.toml +121 -0
- agentgraph_server-0.5.0/setup.cfg +4 -0
- agentgraph_server-0.5.0/tests/test_auth.py +420 -0
- agentgraph_server-0.5.0/tests/test_benchmarks.py +153 -0
- agentgraph_server-0.5.0/tests/test_browse.py +1091 -0
- agentgraph_server-0.5.0/tests/test_cli.py +1286 -0
- agentgraph_server-0.5.0/tests/test_config.py +64 -0
- agentgraph_server-0.5.0/tests/test_connectors.py +621 -0
- agentgraph_server-0.5.0/tests/test_discord_attachments.py +210 -0
- agentgraph_server-0.5.0/tests/test_docs_build.py +137 -0
- agentgraph_server-0.5.0/tests/test_embeddings.py +130 -0
- agentgraph_server-0.5.0/tests/test_fetch.py +98 -0
- agentgraph_server-0.5.0/tests/test_gc.py +228 -0
- agentgraph_server-0.5.0/tests/test_logging.py +40 -0
- agentgraph_server-0.5.0/tests/test_observe.py +156 -0
- agentgraph_server-0.5.0/tests/test_query.py +1355 -0
- agentgraph_server-0.5.0/tests/test_registry.py +91 -0
- agentgraph_server-0.5.0/tests/test_release_metadata.py +39 -0
- agentgraph_server-0.5.0/tests/test_router.py +51 -0
- agentgraph_server-0.5.0/tests/test_rss_connector.py +1238 -0
- agentgraph_server-0.5.0/tests/test_schema.py +295 -0
- agentgraph_server-0.5.0/tests/test_server_imports.py +26 -0
- agentgraph_server-0.5.0/tests/test_slack_auth_artifacts.py +93 -0
- agentgraph_server-0.5.0/tests/test_slack_oauth.py +738 -0
- agentgraph_server-0.5.0/tests/test_sync.py +240 -0
- agentgraph_server-0.5.0/tests/test_upsert.py +442 -0
- agentgraph_server-0.5.0/tests/test_viewer_layout_contract.py +562 -0
- agentgraph_server-0.5.0/tests/test_web_connector.py +202 -0
|
@@ -0,0 +1,159 @@
|
|
|
1
|
+
---
|
|
2
|
+
name: graph
|
|
3
|
+
description: Use the AgentGraph CLI to query the local knowledge graph, inspect connectors, fetch entities, traverse relationships, and configure MCP access.
|
|
4
|
+
---
|
|
5
|
+
|
|
6
|
+
# /graph — AgentGraph CLI skill
|
|
7
|
+
|
|
8
|
+
Use the `agentgraph` CLI to query the local knowledge graph. Always prefer the CLI over direct Python/DB access.
|
|
9
|
+
|
|
10
|
+
## Commands
|
|
11
|
+
|
|
12
|
+
```bash
|
|
13
|
+
# Semantic search across entities
|
|
14
|
+
agentgraph search "<query>" [--type <type>] [--platform <platform>] [--limit N] [--json]
|
|
15
|
+
|
|
16
|
+
# Fetch full existing entity details by ID, UUID prefix, platform ref, or URL
|
|
17
|
+
agentgraph get <entity-id|platform/ref|url> --resolve [--json]
|
|
18
|
+
|
|
19
|
+
# List edges for an entity
|
|
20
|
+
agentgraph edges <entity-id|platform/ref> [--type <edge-type>] [--direction in|out|both] [--json]
|
|
21
|
+
|
|
22
|
+
# Traverse the graph from a starting entity
|
|
23
|
+
agentgraph traverse <entity-id|platform/ref> --resolve [--depth N] [--json]
|
|
24
|
+
|
|
25
|
+
# Filter entities by type and metadata
|
|
26
|
+
agentgraph query --type <entity-type> [--filter key=value] [--since 12h|30m|2d] [--mine] [--has-attachments] [--limit N] [--order-by created_at|updated_at|last_accessed] [--json]
|
|
27
|
+
|
|
28
|
+
# Trigger a connector fetch for a platform entity (by platform + platform-specific ID)
|
|
29
|
+
agentgraph fetch <platform> <resource-id> [--json]
|
|
30
|
+
|
|
31
|
+
# Trigger a connector re-fetch for an entity by its internal UUID
|
|
32
|
+
agentgraph fetch-entity <entity-id> [--json]
|
|
33
|
+
|
|
34
|
+
# Download an entity's source file using connector auth, including Gmail attachment Document stubs
|
|
35
|
+
agentgraph download <entity-id|platform/ref> [--output <file-or-dir>] [--json]
|
|
36
|
+
|
|
37
|
+
# Bookmark an entity or retrieve and bookmark an HTTP(S) URL; use --remove to clear bookmark protection
|
|
38
|
+
agentgraph bookmark <entity-id|platform/ref|url> [--remove] [--json]
|
|
39
|
+
|
|
40
|
+
# Delete an entity from the graph
|
|
41
|
+
agentgraph delete <entity-id|platform/ref|url> [--json]
|
|
42
|
+
|
|
43
|
+
# Merge duplicate Person entities that refer to the same human
|
|
44
|
+
agentgraph unify-persons <primary-person-id> <duplicate-person-id>... [--json]
|
|
45
|
+
|
|
46
|
+
# Queue a background poll for one or all connectors
|
|
47
|
+
agentgraph poll [<source>] [--json] # source: slack, gmail, discord, drive, rss — omit for all; reports already_running and skipped auth failures
|
|
48
|
+
|
|
49
|
+
# Run a one-shot bulk ingest for a connector (all data within the retention window, beyond what poll covers)
|
|
50
|
+
agentgraph ingest <source> [--json] # e.g. gmail, rss
|
|
51
|
+
|
|
52
|
+
# List installed connectors and their sync status; credential fields are null for connectors like RSS/web
|
|
53
|
+
agentgraph connectors [--verify] [--json] # auth_provider, auth_status/auth_detail when applicable, auth_verified, url_patterns, polls, poll_delegates, polled_by, sync, last_synced_at
|
|
54
|
+
|
|
55
|
+
# Run a connector-owned command
|
|
56
|
+
agentgraph connector <source> <command> [args...] [--json] # e.g. agentgraph connector rss add https://simonwillison.net/atom/everything/
|
|
57
|
+
agentgraph connector <source> --help
|
|
58
|
+
agentgraph connector rss add <feed-url> [feed-url...] [--json] # validates feeds, rejects non-feeds without saving, and queues an RSS poll
|
|
59
|
+
agentgraph connector rss remove <feed-url> [feed-url...] [--json] # removes exact configured feed URLs
|
|
60
|
+
agentgraph connector rss import-opml <file.opml> [--all | --select 1,3-5] [--json] # omit flags for checkbox selection
|
|
61
|
+
|
|
62
|
+
# Show credential-backed auth provider state (dedupes shared providers like Google); add --verify for live provider API checks
|
|
63
|
+
agentgraph auth [--verify] [--json] status # provider, connectors[], auth_status/auth_detail, auth_verified, accounts[] including auth_method
|
|
64
|
+
|
|
65
|
+
# Authenticate connectors/providers
|
|
66
|
+
agentgraph auth google [--add] [--account <account-id>] # uses AgentGraph's packaged OAuth client
|
|
67
|
+
agentgraph auth slack [--method oauth|browser] [--client-id <client-id>] [--add] [--account <account-id>] # --client-id implies OAuth; without one, OAuth shows admin/app setup guidance
|
|
68
|
+
agentgraph auth slack --method browser [--xoxc-token <token>] [--d-cookie <cookie>] # explicit browser-session fallback; credential flags imply browser
|
|
69
|
+
agentgraph auth discord [--add] [--account <account-id>] # Discord bot token
|
|
70
|
+
agentgraph auth remove <provider> [--account <account-id>] [--json] # remove stored credentials; does not delete graph data
|
|
71
|
+
agentgraph connector rss add <feed-url> # RSS/Atom feed URLs are connector configuration, not auth
|
|
72
|
+
|
|
73
|
+
# Server
|
|
74
|
+
agentgraph serve [--reload]
|
|
75
|
+
agentgraph mcp-serve
|
|
76
|
+
agentgraph mcp-config # stdio config for Claude Desktop/Claude Code; ChatGPT uses a tunneled HTTPS /mcp endpoint
|
|
77
|
+
|
|
78
|
+
# Install the bundled AgentGraph skill into ~/.agents/skills or ./.agents/skills
|
|
79
|
+
agentgraph install-skill [graph] [--target user|project] [--force] [--json]
|
|
80
|
+
```
|
|
81
|
+
|
|
82
|
+
`--depth 0` returns only the requested entity; depths 1 through 4 include that many relationship hops.
|
|
83
|
+
|
|
84
|
+
## MCP tool equivalents
|
|
85
|
+
|
|
86
|
+
When using AgentGraph through MCP instead of the CLI, use these equivalent tools:
|
|
87
|
+
|
|
88
|
+
```text
|
|
89
|
+
agentgraph connectors -> list_connectors_tool(verify)
|
|
90
|
+
agentgraph auth [--json] status -> list_auth_providers_tool(verify) # credential-backed providers only
|
|
91
|
+
agentgraph auth <provider> ... -> authenticate_provider_tool(provider, args, account_id, add)
|
|
92
|
+
agentgraph auth remove ... -> remove_auth_provider_tool(provider, account_id)
|
|
93
|
+
agentgraph connector <source> ... -> run_connector_command_tool(source, args)
|
|
94
|
+
agentgraph search ... -> search_entities_tool(...)
|
|
95
|
+
agentgraph get ... -> get_entity_tool(entity_id)
|
|
96
|
+
agentgraph edges ... -> get_edges_tool(entity_id, edge_type, direction)
|
|
97
|
+
agentgraph traverse ... -> traverse_graph_tool(entity_id, max_depth)
|
|
98
|
+
agentgraph query ... -> query_by_filter_tool(...)
|
|
99
|
+
agentgraph fetch ... -> fetch_entity_tool(platform, resource_id)
|
|
100
|
+
agentgraph fetch-entity ... -> fetch_entity_by_id_tool(entity_id)
|
|
101
|
+
agentgraph download ... -> download_entity_tool(entity_id, output_path)
|
|
102
|
+
agentgraph poll [source] -> poll_connectors_tool(source) # returns polled, already_running, and skipped lists
|
|
103
|
+
agentgraph ingest <source> -> ingest_connector_tool(source)
|
|
104
|
+
agentgraph bookmark ... -> bookmark_entity_tool(entity_id, bookmarked)
|
|
105
|
+
agentgraph delete ... -> delete_entity_tool(entity_id)
|
|
106
|
+
agentgraph unify-persons ... -> unify_persons_tool(primary_entity_id, duplicate_entity_ids)
|
|
107
|
+
agentgraph install-skill ... -> install_skill_tool(skill, target, force)
|
|
108
|
+
```
|
|
109
|
+
|
|
110
|
+
## Entity types
|
|
111
|
+
|
|
112
|
+
| Type | Contains |
|
|
113
|
+
|---|---|
|
|
114
|
+
| `Message` | Chat messages (Discord, Slack). **Chat images and file uploads are attachments on Message entities** — stored in `metadata.attachments` (JSON array with `url`, `filename`, `content_type`, `width`, `height`). Use `--has-attachments` to filter to messages with files. |
|
|
115
|
+
| `Document` | Text documents (Google Docs, etc.) and Gmail attachment stubs. Gmail attachment stubs are referenced by their owning `Thread` and can be downloaded with `agentgraph download`. |
|
|
116
|
+
| `Channel` | Chat channels and DM threads. |
|
|
117
|
+
| `Task` | Tasks or to-do items. |
|
|
118
|
+
| `Project` | Project/repository containers. |
|
|
119
|
+
|
|
120
|
+
To find chat images uploaded this week: `agentgraph query --type Message --has-attachments --since 7d --json`
|
|
121
|
+
|
|
122
|
+
To download a Gmail attachment: re-fetch the Gmail thread, traverse one hop to
|
|
123
|
+
find referenced Gmail `Document` stubs, then download the attachment document:
|
|
124
|
+
|
|
125
|
+
```bash
|
|
126
|
+
agentgraph fetch-entity <gmail-thread-entity-id>
|
|
127
|
+
agentgraph traverse <gmail-thread-entity-id> --depth 1 --json
|
|
128
|
+
agentgraph download <attachment-document-entity-id> --output <file-or-dir>
|
|
129
|
+
```
|
|
130
|
+
|
|
131
|
+
## Notes
|
|
132
|
+
|
|
133
|
+
- Graph data commands require the AgentGraph server. If a command reports the server is unavailable, run `agentgraph serve`.
|
|
134
|
+
- Use `--json` when you need to parse results programmatically
|
|
135
|
+
- List-style commands (`search`, `query`, and graph viewer/browse results) return bounded content snippets with `content_truncated` when applicable. Use `agentgraph get <entity-id> --json` for full entity content.
|
|
136
|
+
- MCP `search_entities_tool` and `query_by_filter_tool` default to `refresh=false` so connector-owned network enrichment does not slow normal reads. Set `refresh=true` only when fresh connector-owned presentation metadata is needed.
|
|
137
|
+
- Bookmark targets accept: full UUID, UUID prefix, platform ref (`slack/T123/C123`, `gdocs/doc-id`, `discord/dm/456`), or HTTP(S) URL
|
|
138
|
+
- `agentgraph bookmark --remove <entity-id|platform/ref|url>` clears bookmark protection for existing graph entities
|
|
139
|
+
- Delete targets accept: full UUID, UUID prefix, platform ref, or HTTP(S) URL. Connected edges are removed with the entity.
|
|
140
|
+
- Use `agentgraph download` for source files stored behind connector auth, such as Drive PDFs, exported Google Docs/Sheets, or Gmail attachment `Document` stubs
|
|
141
|
+
- `agentgraph fetch` and `agentgraph fetch-entity` persist the connector's complete returned batch before reporting counts; content-rich resources such as RSS feeds may take several minutes
|
|
142
|
+
- Use `agentgraph bookmark` for entities or HTTP(S) URLs that should survive retention-window garbage collection
|
|
143
|
+
- Use `agentgraph unify-persons` only after confirming two or more `Person` entities are the same human; the first argument is the canonical person to keep. Without `--json`, the command displays the updated canonical Person, including merged identity metadata and duplicate identities.
|
|
144
|
+
- `polls: false` does not always mean stale: check `polled_by` / `sync` for connectors refreshed by another connector, e.g. `gdocs` and `gsheets` are refreshed via the `gdrive` Drive Changes poll
|
|
145
|
+
- Server logs go to stdout unless the process manager redirects them elsewhere
|
|
146
|
+
|
|
147
|
+
## Stub Entities
|
|
148
|
+
|
|
149
|
+
An entity is a **stub** when it has no title and no content — it was referenced in an edge but never fetched from its source. Using `--resolve` (default for `get` and `traverse`) automatically fetches stubs from their source before returning. If you omitted `--resolve` and get empty results, re-run with it or use `agentgraph fetch-entity <entity-id>` then re-fetch.
|
|
150
|
+
|
|
151
|
+
## Workflow
|
|
152
|
+
|
|
153
|
+
When the user asks about graph data:
|
|
154
|
+
1. Run `agentgraph connectors --json` to verify the relevant connector is installed and to inspect its last sync state
|
|
155
|
+
2. Run `agentgraph auth --json status` to inspect local provider-level authentication state, especially for shared auth like Google
|
|
156
|
+
3. If credential validity is uncertain, run `agentgraph auth --verify --json status` or `agentgraph connectors --verify --json` to live-check provider APIs for credential-backed connectors
|
|
157
|
+
4. If Google has `auth_status: "invalid"` or `"missing"`, tell the user to run `agentgraph auth google`
|
|
158
|
+
5. Run the appropriate `agentgraph` command with `--json` to get structured output
|
|
159
|
+
6. Use `edges` or `traverse` to follow relationships when needed
|
|
@@ -0,0 +1,92 @@
|
|
|
1
|
+
---
|
|
2
|
+
name: slack-auth
|
|
3
|
+
description: Authenticate AgentGraph to Slack with user OAuth PKCE by default, or explicitly use browser-session credentials as a fallback.
|
|
4
|
+
---
|
|
5
|
+
|
|
6
|
+
# /slack-auth - Slack Authentication
|
|
7
|
+
|
|
8
|
+
Use Slack user OAuth with PKCE unless the user explicitly requests the browser-session fallback.
|
|
9
|
+
|
|
10
|
+
## OAuth (default)
|
|
11
|
+
|
|
12
|
+
1. Check status without exposing credentials:
|
|
13
|
+
|
|
14
|
+
```bash
|
|
15
|
+
agentgraph auth status --json | jq '.[] | select(.provider == "slack")'
|
|
16
|
+
```
|
|
17
|
+
|
|
18
|
+
2. Start the interactive chooser and select Slack user OAuth with PKCE:
|
|
19
|
+
|
|
20
|
+
```bash
|
|
21
|
+
agentgraph auth slack
|
|
22
|
+
```
|
|
23
|
+
|
|
24
|
+
AgentGraph reuses a Client ID stored with the selected account or reads
|
|
25
|
+
`AGENTGRAPH_SLACK_CLIENT_ID`. Otherwise it asks whether the user has admin
|
|
26
|
+
permission in the target workspace.
|
|
27
|
+
|
|
28
|
+
Admins create AgentGraph at `https://api.slack.com/apps` with **Create New App →
|
|
29
|
+
From an app manifest**, select the target workspace, paste the manifest printed by
|
|
30
|
+
AgentGraph into Slack's **JSON** tab, approve it, and enter its Client ID. The
|
|
31
|
+
manifest includes the only
|
|
32
|
+
supported callback, `http://localhost:8766/slack/oauth/callback`.
|
|
33
|
+
|
|
34
|
+
Non-admins choose either **Enter a Client ID provided by a Slack admin** or **Set up
|
|
35
|
+
the AgentGraph Slack App**. The setup path checks whether the target workspace
|
|
36
|
+
appears under **Pick a workspace**. If it does, create the app from the printed
|
|
37
|
+
manifest and enter its Client ID. If it does not, send the printed example request
|
|
38
|
+
and manifest to a Workspace Owner or app manager, then rerun with the supplied Client
|
|
39
|
+
ID:
|
|
40
|
+
|
|
41
|
+
```bash
|
|
42
|
+
agentgraph auth slack --add --client-id '<client-id>'
|
|
43
|
+
```
|
|
44
|
+
|
|
45
|
+
During authorization, click **Allow** when available. If Slack shows **Request
|
|
46
|
+
approval**, use AgentGraph's copyable **Message for your Slack Admin**, submit it,
|
|
47
|
+
and rerun with the same Client ID after Slackbot confirms approval. If installation
|
|
48
|
+
is blocked without a request action, contact a Workspace Owner or app manager.
|
|
49
|
+
|
|
50
|
+
For explicit OAuth selection, use `agentgraph auth slack --method oauth`.
|
|
51
|
+
|
|
52
|
+
Use `--add` for another identity or `--account slack:<team>:<user>` to replace that identity's current method. Verify `auth_method` afterward:
|
|
53
|
+
|
|
54
|
+
```bash
|
|
55
|
+
agentgraph auth status --verify --json | jq '.[] | select(.provider == "slack") | .accounts'
|
|
56
|
+
```
|
|
57
|
+
|
|
58
|
+
If the user declines optional `users:read.email`, authentication still succeeds without email enrichment.
|
|
59
|
+
|
|
60
|
+
## Browser fallback
|
|
61
|
+
|
|
62
|
+
Only use this flow when OAuth cannot be approved or the user explicitly selects it. Load the `agent-browser` skill, connect to a logged-in `app.slack.com` session, and derive the team-specific token:
|
|
63
|
+
|
|
64
|
+
```bash
|
|
65
|
+
TEAM_ID=$(agent-browser get url | sed -n 's#.*app\.slack\.com/client/\(T[A-Z0-9]*\).*#\1#p')
|
|
66
|
+
TOKEN=$(agent-browser eval "(() => { const cfg = JSON.parse(localStorage.getItem('localConfig_v2')); return cfg.teams['$TEAM_ID'].token; })()" | jq -r .)
|
|
67
|
+
COOKIE=$(agent-browser --json cookies get | jq -r '.data.cookies[] | select(.name == "d" and (.domain | contains("slack"))) | .value' | head -n 1)
|
|
68
|
+
```
|
|
69
|
+
|
|
70
|
+
Validate without printing either secret, then save them through the explicit method:
|
|
71
|
+
|
|
72
|
+
```bash
|
|
73
|
+
if [ -z "$TOKEN" ] || [ "$TOKEN" = "null" ]; then echo "missing token" >&2; exit 1; fi
|
|
74
|
+
if [ -z "$COOKIE" ] || [ "$COOKIE" = "null" ]; then echo "missing d cookie" >&2; exit 1; fi
|
|
75
|
+
case "$TOKEN" in xoxc-*) ;; *) echo "token did not use xoxc prefix" >&2; exit 1;; esac
|
|
76
|
+
agentgraph auth slack --method browser --xoxc-token "$TOKEN" --d-cookie "$COOKIE"
|
|
77
|
+
```
|
|
78
|
+
|
|
79
|
+
Supplying `--client-id` without `--method` infers OAuth. Supplying `--xoxc-token` or
|
|
80
|
+
`--d-cookie` without `--method` infers browser mode for compatibility. Never combine
|
|
81
|
+
OAuth and browser credential options.
|
|
82
|
+
|
|
83
|
+
## Revocation
|
|
84
|
+
|
|
85
|
+
Remove one identity or all Slack credentials locally:
|
|
86
|
+
|
|
87
|
+
```bash
|
|
88
|
+
agentgraph auth remove slack --account 'slack:<team>:<user>'
|
|
89
|
+
agentgraph auth remove slack
|
|
90
|
+
```
|
|
91
|
+
|
|
92
|
+
Local removal does not revoke Slack's grant. For OAuth, also revoke the app from Slack's connected-app settings or ask the workspace admin to remove the internal app.
|
|
@@ -0,0 +1,21 @@
|
|
|
1
|
+
MIT License
|
|
2
|
+
|
|
3
|
+
Copyright (c) 2025 Simon Wade
|
|
4
|
+
|
|
5
|
+
Permission is hereby granted, free of charge, to any person obtaining a copy
|
|
6
|
+
of this software and associated documentation files (the "Software"), to deal
|
|
7
|
+
in the Software without restriction, including without limitation the rights
|
|
8
|
+
to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
|
|
9
|
+
copies of the Software, and to permit persons to whom the Software is
|
|
10
|
+
furnished to do so, subject to the following conditions:
|
|
11
|
+
|
|
12
|
+
The above copyright notice and this permission notice shall be included in all
|
|
13
|
+
copies or substantial portions of the Software.
|
|
14
|
+
|
|
15
|
+
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
|
|
16
|
+
IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
|
|
17
|
+
FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
|
|
18
|
+
AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
|
|
19
|
+
LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
|
|
20
|
+
OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
|
|
21
|
+
SOFTWARE.
|
|
@@ -0,0 +1,286 @@
|
|
|
1
|
+
Metadata-Version: 2.4
|
|
2
|
+
Name: agentgraph-server
|
|
3
|
+
Version: 0.5.0
|
|
4
|
+
Summary: AgentGraph builds a local, queryable graph of your digital world across tools like Slack, Discord, Gmail, Google Docs, Sheets, Drive, and RSS feeds, so your AI agents can search, fetch, and reason over the same connected context you work from.
|
|
5
|
+
Requires-Python: >=3.12
|
|
6
|
+
Description-Content-Type: text/markdown
|
|
7
|
+
License-File: LICENSE
|
|
8
|
+
Requires-Dist: aiosqlite>=0.20.0
|
|
9
|
+
Requires-Dist: agentgraph-connector-web<0.6,>=0.5.0
|
|
10
|
+
Requires-Dist: apscheduler>=3.11.2
|
|
11
|
+
Requires-Dist: click<8.4
|
|
12
|
+
Requires-Dist: fastapi>=0.135.2
|
|
13
|
+
Requires-Dist: fastembed>=0.8.0
|
|
14
|
+
Requires-Dist: httpx>=0.28.1
|
|
15
|
+
Requires-Dist: mcp>=1.26.0
|
|
16
|
+
Requires-Dist: numpy>=2.4.6
|
|
17
|
+
Requires-Dist: pydantic>=2.12.5
|
|
18
|
+
Requires-Dist: pydantic-settings>=2.13.1
|
|
19
|
+
Requires-Dist: rich>=14.3.3
|
|
20
|
+
Requires-Dist: sqlite-vec>=0.1.9
|
|
21
|
+
Requires-Dist: typer>=0.24.1
|
|
22
|
+
Requires-Dist: uvicorn>=0.42.0
|
|
23
|
+
Provides-Extra: google
|
|
24
|
+
Requires-Dist: agentgraph-connector-google<0.6,>=0.5.0; extra == "google"
|
|
25
|
+
Provides-Extra: slack
|
|
26
|
+
Requires-Dist: agentgraph-connector-slack<0.6,>=0.5.0; extra == "slack"
|
|
27
|
+
Provides-Extra: discord
|
|
28
|
+
Requires-Dist: agentgraph-connector-discord<0.6,>=0.5.0; extra == "discord"
|
|
29
|
+
Provides-Extra: rss
|
|
30
|
+
Requires-Dist: agentgraph-connector-rss<0.6,>=0.5.0; extra == "rss"
|
|
31
|
+
Provides-Extra: web
|
|
32
|
+
Requires-Dist: agentgraph-connector-web<0.6,>=0.5.0; extra == "web"
|
|
33
|
+
Provides-Extra: all
|
|
34
|
+
Requires-Dist: agentgraph-connector-web<0.6,>=0.5.0; extra == "all"
|
|
35
|
+
Requires-Dist: agentgraph-connector-google<0.6,>=0.5.0; extra == "all"
|
|
36
|
+
Requires-Dist: agentgraph-connector-slack<0.6,>=0.5.0; extra == "all"
|
|
37
|
+
Requires-Dist: agentgraph-connector-discord<0.6,>=0.5.0; extra == "all"
|
|
38
|
+
Requires-Dist: agentgraph-connector-rss<0.6,>=0.5.0; extra == "all"
|
|
39
|
+
Dynamic: license-file
|
|
40
|
+
|
|
41
|
+
# AgentGraph
|
|
42
|
+
|
|
43
|
+
AgentGraph is a local knowledge graph for AI agents. It indexes content from Slack, Discord, Gmail, Google Docs, Google Sheets, Google Drive, and RSS/Atom feeds into a queryable graph of entities, people, and relationships that you can use from the CLI, web viewer, browser extension, or MCP.
|
|
44
|
+
|
|
45
|
+
## Docs
|
|
46
|
+
|
|
47
|
+
- [Install](docs-src/install.md)
|
|
48
|
+
- [Quickstart](docs-src/quickstart.md)
|
|
49
|
+
- [Configuration](docs-src/configuration.md)
|
|
50
|
+
- [Performance testing](docs-src/performance.md)
|
|
51
|
+
- [Extending](docs-src/extending.md)
|
|
52
|
+
- [Commands](docs-src/commands/index.md)
|
|
53
|
+
- [MCP tools](docs-src/mcp/index.md)
|
|
54
|
+
- [Privacy](docs-src/privacy.md)
|
|
55
|
+
|
|
56
|
+
## Installation
|
|
57
|
+
|
|
58
|
+
### Prerequisites
|
|
59
|
+
|
|
60
|
+
- Python 3.12+
|
|
61
|
+
- [uv](https://docs.astral.sh/uv/)
|
|
62
|
+
- Chrome for the browser extension
|
|
63
|
+
|
|
64
|
+
Install `uv` if needed:
|
|
65
|
+
|
|
66
|
+
```bash
|
|
67
|
+
curl -LsSf https://astral.sh/uv/install.sh | sh
|
|
68
|
+
```
|
|
69
|
+
|
|
70
|
+
### Clone and sync
|
|
71
|
+
|
|
72
|
+
```bash
|
|
73
|
+
git clone https://github.com/simonexmachina/agent-graph
|
|
74
|
+
cd agent-graph
|
|
75
|
+
uv sync --extra all
|
|
76
|
+
```
|
|
77
|
+
|
|
78
|
+
Or install only the connectors you need:
|
|
79
|
+
|
|
80
|
+
```bash
|
|
81
|
+
uv sync --extra google
|
|
82
|
+
uv sync --extra slack
|
|
83
|
+
uv sync --extra discord
|
|
84
|
+
uv sync --extra rss
|
|
85
|
+
```
|
|
86
|
+
|
|
87
|
+
Credentials and local state live in `~/.agentgraph/` by default, or under `AGENTGRAPH_CONFIG_DIR` if you set a custom config directory.
|
|
88
|
+
|
|
89
|
+
## Quick Start
|
|
90
|
+
|
|
91
|
+
### 1. Authenticate connectors
|
|
92
|
+
|
|
93
|
+
Run the guided onboarding flow:
|
|
94
|
+
|
|
95
|
+
```bash
|
|
96
|
+
agentgraph onboard
|
|
97
|
+
```
|
|
98
|
+
|
|
99
|
+
Or authenticate a single source directly:
|
|
100
|
+
|
|
101
|
+
```bash
|
|
102
|
+
agentgraph auth <source>
|
|
103
|
+
```
|
|
104
|
+
|
|
105
|
+
### 2. Start AgentGraph
|
|
106
|
+
|
|
107
|
+
```bash
|
|
108
|
+
agentgraph serve
|
|
109
|
+
```
|
|
110
|
+
|
|
111
|
+
The default server URL is `http://127.0.0.1:8765`.
|
|
112
|
+
|
|
113
|
+
### 3. Install the browser extension
|
|
114
|
+
|
|
115
|
+
Install the [AgentGraph Chrome Extension](https://chromewebstore.google.com/detail/agentgraph-extension/iilkfclglabllelhjacijldknapbhidi?authuser=0&hl=en-AU) from the Chrome Web Store.
|
|
116
|
+
|
|
117
|
+
To build it locally instead:
|
|
118
|
+
|
|
119
|
+
```bash
|
|
120
|
+
cd extension
|
|
121
|
+
npm install
|
|
122
|
+
npm run build
|
|
123
|
+
```
|
|
124
|
+
|
|
125
|
+
Then open `chrome://extensions`, enable Developer Mode, click **Load unpacked**, and select `extension/dist/`.
|
|
126
|
+
|
|
127
|
+
### 4. Browse something supported
|
|
128
|
+
|
|
129
|
+
Open a Slack channel, Discord thread, Google Doc, Google Sheet, Gmail thread, or Drive folder and keep the tab focused long enough for the dwell threshold to trigger a fetch.
|
|
130
|
+
|
|
131
|
+
### 5. Verify entities landed
|
|
132
|
+
|
|
133
|
+
```bash
|
|
134
|
+
agentgraph connectors --json
|
|
135
|
+
agentgraph search "slack" --limit 5
|
|
136
|
+
agentgraph query --type Document --limit 5
|
|
137
|
+
```
|
|
138
|
+
|
|
139
|
+
### 6. Connect an assistant
|
|
140
|
+
|
|
141
|
+
```bash
|
|
142
|
+
agentgraph mcp-config
|
|
143
|
+
```
|
|
144
|
+
|
|
145
|
+
Use the printed stdio config with Claude Desktop or Claude Code. For ChatGPT developer mode, run AgentGraph with streamable HTTP and expose the local `/mcp` endpoint through HTTPS before creating the app/connector.
|
|
146
|
+
|
|
147
|
+
## How It Works
|
|
148
|
+
|
|
149
|
+
The browser extension watches supported URLs and sends dwell events to your local AgentGraph server. When you stay on a page long enough, the matching connector fetches the resource and turns it into graph entities, people, and edges. After that first fetch, supported connectors keep known resources fresh with background polling.
|
|
150
|
+
|
|
151
|
+
```text
|
|
152
|
+
Browser extension -> local server -> connector -> local graph
|
|
153
|
+
|
|
|
154
|
+
+-> CLI / viewer / MCP
|
|
155
|
+
```
|
|
156
|
+
|
|
157
|
+
AgentGraph is local-first. Indexed content is stored in a local SQLite database. The project does not run a hosted service for your graph data.
|
|
158
|
+
|
|
159
|
+
## Surfaces
|
|
160
|
+
|
|
161
|
+
| Surface | Use it for | Entry point |
|
|
162
|
+
| --- | --- | --- |
|
|
163
|
+
| CLI | Search, fetch, ingest, debugging, and operations | `agentgraph search`, `agentgraph fetch`, `agentgraph serve` |
|
|
164
|
+
| MCP | Claude Desktop, Claude Code, ChatGPT developer mode, and other MCP clients | `agentgraph mcp-config`, `agentgraph mcp-serve` |
|
|
165
|
+
| Browser extension | Passive indexing from supported browser tabs | [Chrome Web Store](https://chromewebstore.google.com/detail/agentgraph-extension/iilkfclglabllelhjacijldknapbhidi?authuser=0&hl=en-AU) |
|
|
166
|
+
| Viewer | Visual graph inspection and manual exploration | `http://127.0.0.1:8765/viewer` |
|
|
167
|
+
|
|
168
|
+
## Commands
|
|
169
|
+
|
|
170
|
+
### Query
|
|
171
|
+
|
|
172
|
+
```bash
|
|
173
|
+
agentgraph search "project kickoff notes"
|
|
174
|
+
agentgraph query --type Message --filter platform=slack --since 12h
|
|
175
|
+
agentgraph get <entity-id>
|
|
176
|
+
agentgraph edges <entity-id>
|
|
177
|
+
agentgraph traverse <entity-id> --depth 2
|
|
178
|
+
```
|
|
179
|
+
|
|
180
|
+
### Fetch and files
|
|
181
|
+
|
|
182
|
+
```bash
|
|
183
|
+
agentgraph fetch gdocs <document-id>
|
|
184
|
+
agentgraph fetch-entity <entity-id>
|
|
185
|
+
agentgraph download <entity-id>
|
|
186
|
+
agentgraph bookmark <entity-id> --remove
|
|
187
|
+
agentgraph delete <entity-id>
|
|
188
|
+
```
|
|
189
|
+
|
|
190
|
+
Gmail attachments are indexed as `Document` stub entities referenced by the
|
|
191
|
+
owning `Thread`. Re-fetch the thread, traverse one hop to find the attachment
|
|
192
|
+
document, then pass that document ID to `agentgraph download`.
|
|
193
|
+
|
|
194
|
+
### Sync and connectors
|
|
195
|
+
|
|
196
|
+
```bash
|
|
197
|
+
agentgraph connectors
|
|
198
|
+
agentgraph poll
|
|
199
|
+
agentgraph ingest gmail
|
|
200
|
+
agentgraph connector rss add https://example.com/feed.xml
|
|
201
|
+
```
|
|
202
|
+
|
|
203
|
+
### MCP
|
|
204
|
+
|
|
205
|
+
```bash
|
|
206
|
+
agentgraph mcp-serve
|
|
207
|
+
agentgraph mcp-serve --transport sse --port 8808
|
|
208
|
+
agentgraph mcp-serve --transport streamable-http --host 0.0.0.0 --port 8808
|
|
209
|
+
```
|
|
210
|
+
|
|
211
|
+
ChatGPT uses the streamable HTTP endpoint, such as `https://your-tunnel.example/mcp`, not the stdio JSON config.
|
|
212
|
+
|
|
213
|
+
See the full [command reference](docs-src/commands/index.md) and [MCP tool reference](docs-src/mcp/index.md).
|
|
214
|
+
|
|
215
|
+
## Connectors
|
|
216
|
+
|
|
217
|
+
Included connectors:
|
|
218
|
+
|
|
219
|
+
| Source | Entities | Auth | Refresh model |
|
|
220
|
+
| --- | --- | --- | --- |
|
|
221
|
+
| Slack | Channel, Message | User OAuth PKCE; browser-session fallback | Browser dwell plus 5 minute polling |
|
|
222
|
+
| Discord | Channel, Message | Bot token | Browser dwell plus 5 minute polling |
|
|
223
|
+
| Google Docs | Document | Google OAuth | Browser dwell plus Drive-backed refresh |
|
|
224
|
+
| Google Sheets | Spreadsheet | Google OAuth | Browser dwell plus Drive-backed refresh |
|
|
225
|
+
| Google Drive | Folder, Document | Google OAuth | Browser dwell for folders and files, plus Drive changes polling |
|
|
226
|
+
| Gmail | Thread, Document stubs for attachments | Google OAuth | Browser dwell plus background poll and ingest |
|
|
227
|
+
| RSS | Folder, Document | Feed URLs | Background poll and ingest; `add` validates feeds and queues a poll |
|
|
228
|
+
|
|
229
|
+
AgentGraph is designed to be extended. Custom connectors live in separate packages, register through the connector entry point, and implement the shared `BaseConnector` interface. See [Extending](docs-src/extending.md).
|
|
230
|
+
|
|
231
|
+
## Configuration
|
|
232
|
+
|
|
233
|
+
Settings are read from environment variables and from a `.env` file in the config directory.
|
|
234
|
+
|
|
235
|
+
| Variable | Default | Description |
|
|
236
|
+
| --- | --- | --- |
|
|
237
|
+
| `AGENTGRAPH_CONFIG_DIR` | `~/.agentgraph` | Directory for config, credentials, and the default SQLite database |
|
|
238
|
+
| `AGENTGRAPH_BACKEND` | `sqlite` | Persistence backend. The built-in backend is `sqlite` |
|
|
239
|
+
| `AGENTGRAPH_BACKEND_SQLITE_PATH` | `$AGENTGRAPH_CONFIG_DIR/agentgraph.db` | SQLite database path |
|
|
240
|
+
| `AGENTGRAPH_SERVER_HOST` | `127.0.0.1` | Server bind address |
|
|
241
|
+
| `AGENTGRAPH_SERVER_PORT` | `8765` | Server port |
|
|
242
|
+
| `AGENTGRAPH_DWELL_THRESHOLD_SECONDS` | `3` | Seconds of focus before a fetch is triggered |
|
|
243
|
+
| `AGENTGRAPH_RETENTION_DAYS` | `90` | Days before an unvisited entity is garbage collected |
|
|
244
|
+
| `AGENTGRAPH_EMBEDDING_MODEL` | `BAAI/bge-small-en-v1.5` | FastEmbed model used for embeddings |
|
|
245
|
+
| `AGENTGRAPH_SLACK_CLIENT_ID` | prompt/stored account | Optional Client ID override for the admin-created internal Slack OAuth app |
|
|
246
|
+
| `AGENTGRAPH_SLACK_REDIRECT_URI` | `http://localhost:8766/slack/oauth/callback` | Exact Slack OAuth callback registered on the app |
|
|
247
|
+
|
|
248
|
+
See [Configuration](docs-src/configuration.md) for the full setup.
|
|
249
|
+
|
|
250
|
+
## MCP Tools
|
|
251
|
+
|
|
252
|
+
`agentgraph mcp-serve` exposes these tool families to MCP clients:
|
|
253
|
+
|
|
254
|
+
- `list_connectors_tool`
|
|
255
|
+
- `list_auth_providers_tool`
|
|
256
|
+
- `authenticate_provider_tool`
|
|
257
|
+
- `run_connector_command_tool`
|
|
258
|
+
- `search_entities_tool`
|
|
259
|
+
- `get_entity_tool`
|
|
260
|
+
- `get_edges_tool`
|
|
261
|
+
- `traverse_graph_tool`
|
|
262
|
+
- `query_by_filter_tool`
|
|
263
|
+
- `fetch_entity_tool`
|
|
264
|
+
- `fetch_entity_by_id_tool`
|
|
265
|
+
- `download_entity_tool`
|
|
266
|
+
- `poll_connectors_tool`
|
|
267
|
+
- `ingest_connector_tool`
|
|
268
|
+
- `bookmark_entity_tool`
|
|
269
|
+
- `delete_entity_tool`
|
|
270
|
+
- `unify_persons_tool`
|
|
271
|
+
|
|
272
|
+
## Contributing
|
|
273
|
+
|
|
274
|
+
See [AGENTS.md](AGENTS.md) for repo-specific development rules.
|
|
275
|
+
|
|
276
|
+
Before opening a change, run:
|
|
277
|
+
|
|
278
|
+
```bash
|
|
279
|
+
uv run pytest tests/ -m "not integration" -q
|
|
280
|
+
uv run pyright
|
|
281
|
+
uv run ruff check agentgraph/
|
|
282
|
+
```
|
|
283
|
+
|
|
284
|
+
## License
|
|
285
|
+
|
|
286
|
+
See [LICENSE](LICENSE).
|