agentgraph-server 0.5.1__tar.gz → 0.5.3__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.
Files changed (110) hide show
  1. agentgraph_server-0.5.3/.agents/skills/AgentGraph/SKILL.md +76 -0
  2. agentgraph_server-0.5.3/.agents/skills/AgentGraph/references/commands.md +45 -0
  3. agentgraph_server-0.5.3/.agents/skills/AgentGraph/references/data-model.md +51 -0
  4. agentgraph_server-0.5.3/.agents/skills/AgentGraph/references/operations.md +77 -0
  5. agentgraph_server-0.5.3/PKG-INFO +175 -0
  6. agentgraph_server-0.5.3/README.md +135 -0
  7. {agentgraph_server-0.5.1 → agentgraph_server-0.5.3}/agentgraph/auth/credentials.py +21 -9
  8. {agentgraph_server-0.5.1 → agentgraph_server-0.5.3}/agentgraph/backends/__init__.py +9 -2
  9. {agentgraph_server-0.5.1 → agentgraph_server-0.5.3}/agentgraph/backends/sqlite/backend.py +564 -144
  10. {agentgraph_server-0.5.1 → agentgraph_server-0.5.3}/agentgraph/backends/sqlite/schema.sql +15 -11
  11. {agentgraph_server-0.5.1 → agentgraph_server-0.5.3}/agentgraph/cli.py +68 -19
  12. agentgraph_server-0.5.3/agentgraph/cli_query.py +355 -0
  13. agentgraph_server-0.5.3/agentgraph/cli_sync.py +106 -0
  14. agentgraph_server-0.5.3/agentgraph/config.py +144 -0
  15. {agentgraph_server-0.5.1 → agentgraph_server-0.5.3}/agentgraph/connectors/base.py +33 -8
  16. agentgraph_server-0.5.3/agentgraph/connectors/command_effects.py +18 -0
  17. {agentgraph_server-0.5.1 → agentgraph_server-0.5.3}/agentgraph/core/runtime.py +5 -1
  18. {agentgraph_server-0.5.1 → agentgraph_server-0.5.3}/agentgraph/core/storage.py +30 -13
  19. agentgraph_server-0.5.3/agentgraph/demo.py +356 -0
  20. agentgraph_server-0.5.3/agentgraph/demo_fixtures/reliable-webhooks.md +21 -0
  21. agentgraph_server-0.5.3/agentgraph/demo_fixtures/retry-guidance.md +21 -0
  22. agentgraph_server-0.5.3/agentgraph/graph/__init__.py +1 -0
  23. {agentgraph_server-0.5.1 → agentgraph_server-0.5.3}/agentgraph/graph/bookmark.py +1 -1
  24. {agentgraph_server-0.5.1 → agentgraph_server-0.5.3}/agentgraph/graph/delete.py +9 -0
  25. agentgraph_server-0.5.3/agentgraph/graph/expiration.py +80 -0
  26. {agentgraph_server-0.5.1 → agentgraph_server-0.5.3}/agentgraph/graph/fetch.py +48 -0
  27. agentgraph_server-0.5.3/agentgraph/graph/operations.py +98 -0
  28. {agentgraph_server-0.5.1 → agentgraph_server-0.5.3}/agentgraph/graph/query.py +2 -5
  29. {agentgraph_server-0.5.1 → agentgraph_server-0.5.3}/agentgraph/mcp/server.py +273 -126
  30. agentgraph_server-0.5.3/agentgraph/server/app.py +230 -0
  31. {agentgraph_server-0.5.1 → agentgraph_server-0.5.3}/agentgraph/server/cli_api.py +44 -246
  32. agentgraph_server-0.5.3/agentgraph/server/meta_api.py +51 -0
  33. agentgraph_server-0.5.3/agentgraph/server/observation.py +188 -0
  34. {agentgraph_server-0.5.1 → agentgraph_server-0.5.3}/agentgraph/server/router.py +5 -4
  35. {agentgraph_server-0.5.1 → agentgraph_server-0.5.3}/agentgraph/server/static/viewer.html +234 -147
  36. {agentgraph_server-0.5.1 → agentgraph_server-0.5.3}/agentgraph/server/sync.py +20 -5
  37. agentgraph_server-0.5.3/agentgraph/server/sync_api.py +67 -0
  38. {agentgraph_server-0.5.1 → agentgraph_server-0.5.3}/agentgraph/skills.py +38 -4
  39. agentgraph_server-0.5.3/agentgraph_server.egg-info/PKG-INFO +175 -0
  40. {agentgraph_server-0.5.1 → agentgraph_server-0.5.3}/agentgraph_server.egg-info/SOURCES.txt +19 -6
  41. {agentgraph_server-0.5.1 → agentgraph_server-0.5.3}/pyproject.toml +7 -3
  42. {agentgraph_server-0.5.1 → agentgraph_server-0.5.3}/tests/test_auth.py +12 -0
  43. {agentgraph_server-0.5.1 → agentgraph_server-0.5.3}/tests/test_benchmarks.py +6 -4
  44. {agentgraph_server-0.5.1 → agentgraph_server-0.5.3}/tests/test_browse.py +94 -47
  45. {agentgraph_server-0.5.1 → agentgraph_server-0.5.3}/tests/test_cli.py +401 -93
  46. agentgraph_server-0.5.3/tests/test_command_effects.py +59 -0
  47. agentgraph_server-0.5.3/tests/test_config.py +144 -0
  48. {agentgraph_server-0.5.1 → agentgraph_server-0.5.3}/tests/test_connectors.py +139 -15
  49. agentgraph_server-0.5.3/tests/test_docs_build.py +305 -0
  50. agentgraph_server-0.5.3/tests/test_expiration.py +478 -0
  51. agentgraph_server-0.5.3/tests/test_graph_operations.py +215 -0
  52. agentgraph_server-0.5.3/tests/test_launch_demo.py +108 -0
  53. agentgraph_server-0.5.3/tests/test_observation.py +408 -0
  54. {agentgraph_server-0.5.1 → agentgraph_server-0.5.3}/tests/test_query.py +208 -132
  55. {agentgraph_server-0.5.1 → agentgraph_server-0.5.3}/tests/test_release_metadata.py +1 -2
  56. {agentgraph_server-0.5.1 → agentgraph_server-0.5.3}/tests/test_rss_connector.py +41 -2
  57. {agentgraph_server-0.5.1 → agentgraph_server-0.5.3}/tests/test_schema.py +129 -22
  58. {agentgraph_server-0.5.1 → agentgraph_server-0.5.3}/tests/test_slack_auth_artifacts.py +8 -27
  59. {agentgraph_server-0.5.1 → agentgraph_server-0.5.3}/tests/test_sync.py +72 -0
  60. {agentgraph_server-0.5.1 → agentgraph_server-0.5.3}/tests/test_upsert.py +91 -6
  61. {agentgraph_server-0.5.1 → agentgraph_server-0.5.3}/tests/test_viewer_layout_contract.py +76 -20
  62. {agentgraph_server-0.5.1 → agentgraph_server-0.5.3}/tests/test_web_connector.py +137 -1
  63. agentgraph_server-0.5.1/.agents/skills/graph/SKILL.md +0 -159
  64. agentgraph_server-0.5.1/PKG-INFO +0 -286
  65. agentgraph_server-0.5.1/README.md +0 -246
  66. agentgraph_server-0.5.1/agentgraph/cli_query.py +0 -519
  67. agentgraph_server-0.5.1/agentgraph/config.py +0 -90
  68. agentgraph_server-0.5.1/agentgraph/graph/__init__.py +0 -1
  69. agentgraph_server-0.5.1/agentgraph/graph/gc.py +0 -26
  70. agentgraph_server-0.5.1/agentgraph/server/app.py +0 -133
  71. agentgraph_server-0.5.1/agentgraph/server/dwell.py +0 -79
  72. agentgraph_server-0.5.1/agentgraph/server/graph_api.py +0 -46
  73. agentgraph_server-0.5.1/agentgraph_server.egg-info/PKG-INFO +0 -286
  74. agentgraph_server-0.5.1/tests/test_config.py +0 -64
  75. agentgraph_server-0.5.1/tests/test_docs_build.py +0 -137
  76. agentgraph_server-0.5.1/tests/test_gc.py +0 -228
  77. agentgraph_server-0.5.1/tests/test_observe.py +0 -156
  78. {agentgraph_server-0.5.1 → agentgraph_server-0.5.3}/.agents/skills/slack-auth/SKILL.md +0 -0
  79. {agentgraph_server-0.5.1 → agentgraph_server-0.5.3}/LICENSE +0 -0
  80. {agentgraph_server-0.5.1 → agentgraph_server-0.5.3}/agentgraph/__init__.py +0 -0
  81. {agentgraph_server-0.5.1 → agentgraph_server-0.5.3}/agentgraph/auth/__init__.py +0 -0
  82. {agentgraph_server-0.5.1 → agentgraph_server-0.5.3}/agentgraph/backends/sqlite/__init__.py +0 -0
  83. {agentgraph_server-0.5.1 → agentgraph_server-0.5.3}/agentgraph/backends/sqlite/vector.py +0 -0
  84. {agentgraph_server-0.5.1 → agentgraph_server-0.5.3}/agentgraph/connectors/__init__.py +0 -0
  85. {agentgraph_server-0.5.1 → agentgraph_server-0.5.3}/agentgraph/connectors/registry.py +0 -0
  86. {agentgraph_server-0.5.1 → agentgraph_server-0.5.3}/agentgraph/connectors/status.py +0 -0
  87. {agentgraph_server-0.5.1 → agentgraph_server-0.5.3}/agentgraph/core/__init__.py +0 -0
  88. {agentgraph_server-0.5.1 → agentgraph_server-0.5.3}/agentgraph/core/context.py +0 -0
  89. {agentgraph_server-0.5.1 → agentgraph_server-0.5.3}/agentgraph/graph/download.py +0 -0
  90. {agentgraph_server-0.5.1 → agentgraph_server-0.5.3}/agentgraph/graph/embeddings.py +0 -0
  91. {agentgraph_server-0.5.1 → agentgraph_server-0.5.3}/agentgraph/graph/link.py +0 -0
  92. {agentgraph_server-0.5.1 → agentgraph_server-0.5.3}/agentgraph/graph/person.py +0 -0
  93. {agentgraph_server-0.5.1 → agentgraph_server-0.5.3}/agentgraph/graph/upsert.py +0 -0
  94. {agentgraph_server-0.5.1 → agentgraph_server-0.5.3}/agentgraph/logging.py +0 -0
  95. {agentgraph_server-0.5.1 → agentgraph_server-0.5.3}/agentgraph/mcp/__init__.py +0 -0
  96. {agentgraph_server-0.5.1 → agentgraph_server-0.5.3}/agentgraph/perf.py +0 -0
  97. {agentgraph_server-0.5.1 → agentgraph_server-0.5.3}/agentgraph/server/__init__.py +0 -0
  98. {agentgraph_server-0.5.1 → agentgraph_server-0.5.3}/agentgraph_server.egg-info/dependency_links.txt +0 -0
  99. {agentgraph_server-0.5.1 → agentgraph_server-0.5.3}/agentgraph_server.egg-info/entry_points.txt +0 -0
  100. {agentgraph_server-0.5.1 → agentgraph_server-0.5.3}/agentgraph_server.egg-info/requires.txt +0 -0
  101. {agentgraph_server-0.5.1 → agentgraph_server-0.5.3}/agentgraph_server.egg-info/top_level.txt +0 -0
  102. {agentgraph_server-0.5.1 → agentgraph_server-0.5.3}/setup.cfg +0 -0
  103. {agentgraph_server-0.5.1 → agentgraph_server-0.5.3}/tests/test_discord_attachments.py +0 -0
  104. {agentgraph_server-0.5.1 → agentgraph_server-0.5.3}/tests/test_embeddings.py +0 -0
  105. {agentgraph_server-0.5.1 → agentgraph_server-0.5.3}/tests/test_fetch.py +0 -0
  106. {agentgraph_server-0.5.1 → agentgraph_server-0.5.3}/tests/test_logging.py +0 -0
  107. {agentgraph_server-0.5.1 → agentgraph_server-0.5.3}/tests/test_registry.py +0 -0
  108. {agentgraph_server-0.5.1 → agentgraph_server-0.5.3}/tests/test_router.py +0 -0
  109. {agentgraph_server-0.5.1 → agentgraph_server-0.5.3}/tests/test_server_imports.py +0 -0
  110. {agentgraph_server-0.5.1 → agentgraph_server-0.5.3}/tests/test_slack_oauth.py +0 -0
@@ -0,0 +1,76 @@
1
+ ---
2
+ name: AgentGraph
3
+ description: Use AgentGraph through its CLI or MCP tools to search and traverse selected local context, retrieve full source-backed evidence, fetch missing or stale resources, and troubleshoot connector availability.
4
+ ---
5
+
6
+ # AgentGraph CLI skill
7
+
8
+ AgentGraph is a local knowledge graph for the agent the user already uses. It stores
9
+ selected messages, documents, people, feeds, pages, and relationships; the agent is
10
+ responsible for searching that graph, comparing evidence, and explaining its reasoning.
11
+
12
+ Prefer the `agentgraph` CLI when a shell is available. Use the equivalent MCP tools
13
+ when AgentGraph is connected directly to the agent. Do not query AgentGraph's SQLite
14
+ database or connector internals directly.
15
+
16
+ ## Commands that use localhost
17
+
18
+ `agentgraph poll` and connector or authentication commands that queue a poll or
19
+ historical ingest call the configured local AgentGraph HTTP server. If a sandbox blocks
20
+ one of these commands, request permission to contact that localhost server and retry
21
+ the command after approval.
22
+
23
+ ## Investigation workflow
24
+
25
+ 1. Discover likely entities with `agentgraph search "<query>" --json` or
26
+ `search_entities_tool`.
27
+ 2. Open promising results with `agentgraph get <target> --json` or
28
+ `get_entity_tool` to read full content and source metadata. Search and query results
29
+ contain bounded snippets and set `content_truncated` when content was shortened.
30
+ 3. Follow relationships with `agentgraph edges`, `agentgraph traverse`,
31
+ `get_edges_tool`, or `traverse_graph_tool`.
32
+ 4. If an entity is a stub, or known context is stale, resolve or re-fetch it through
33
+ the owning connector and then repeat the read or traversal.
34
+ 5. Compare source dates and contents. Distinguish source facts from inference and cite
35
+ each source URL or entity identifier used.
36
+
37
+ Start with search unless the user already supplied a graph ID, platform reference, or
38
+ known indexed URL. Use structured `query` only when the entity type or filters are
39
+ already known.
40
+
41
+ ## Context lifecycle
42
+
43
+ - **Connect** is setup: installed connectors and their authentication/configuration
44
+ determine which selected sources AgentGraph can access.
45
+ - **Observe** records human attention to a supported browser URL and triggers a
46
+ targeted connector fetch.
47
+ - **Fetch** retrieves missing or stale context at the agent's request.
48
+ - **Refresh** uses polling or connector-owned ingest commands to update configured or
49
+ already-known context.
50
+
51
+ Only browser observation updates `observed_at`. Direct fetch, polling, and ingest can
52
+ change graph content without implying that the human viewed it.
53
+
54
+ ## Evidence rules
55
+
56
+ - Use full entity content before making a source-backed claim; do not treat a search
57
+ snippet as the complete source.
58
+ - Treat an entity with no title and no content as an unresolved stub.
59
+ - Use source timestamps for chronology. `created_at` and `updated_at` describe the
60
+ local graph record; `source_created_at` and `source_updated_at` describe the source.
61
+ - Chat uploads live on `Message.metadata.attachments`. Gmail attachments are
62
+ `Document` stubs referenced by their owning `Email` and are downloaded separately.
63
+ - Inspect connector and auth state only when freshness matters, a fetch is required,
64
+ or a graph operation reports a connector or credential problem.
65
+ - Never merge Person entities without user confirmation. Treat delete, credential
66
+ removal, and unbookmarking as destructive actions.
67
+
68
+ ## References
69
+
70
+ - Read [references/commands.md](references/commands.md) for CLI syntax, MCP mappings,
71
+ target formats, stub resolution, and result-size behavior.
72
+ - Read [references/data-model.md](references/data-model.md) for entity types, edges,
73
+ attachment representation, timestamps, and retention semantics.
74
+ - Read [references/operations.md](references/operations.md) for connectors, auth,
75
+ polling, connector-owned commands, downloads, bookmarks, deletion, person merging,
76
+ server setup, and skill installation.
@@ -0,0 +1,45 @@
1
+ # Query and traversal commands
2
+
3
+ ## CLI
4
+
5
+ ```bash
6
+ agentgraph search "<query>" [--type <type>] [--platform <platform>] [--limit N] [--min-score N] [--json]
7
+ agentgraph query --type <entity-type> [--filter key=value] [--since 12h|30m|2d] [--mine] [--has-attachments] [--limit N] [--order-by created_at|updated_at|source_created_at|source_updated_at|observed_at|synced_at] [--json]
8
+ agentgraph get <entity-id|platform/ref|url> [--resolve] [--json]
9
+ agentgraph edges <entity-id|platform/ref> [--type <edge-type>] [--direction in|out|both] [--json]
10
+ agentgraph traverse <entity-id|platform/ref> [--resolve] [--depth 0..4] [--json]
11
+ ```
12
+
13
+ `get` and `traverse` do not resolve stubs unless `--resolve` is supplied. Depth 0
14
+ returns only the starting entity; depths 1 through 4 include that many relationship
15
+ hops.
16
+
17
+ Use `--json` when results will be parsed programmatically. Search and query return
18
+ bounded content snippets with `content_truncated`; use `get` for the complete entity.
19
+
20
+ Targets accepted by `get` are full UUIDs, unambiguous UUID prefixes, platform
21
+ references such as `slack/T123/C123`, and indexed HTTP(S) URLs. `edges` and `traverse`
22
+ accept full UUIDs, unambiguous UUID prefixes, and platform references.
23
+
24
+ ## MCP equivalents
25
+
26
+ ```text
27
+ agentgraph search ... -> search_entities_tool(query, entity_types, platform, limit, min_score, refresh)
28
+ agentgraph query ... -> query_by_filter_tool(entity_type, filters, since, authored_by_me, has_attachments, limit, order_by, refresh)
29
+ agentgraph get ... -> get_entity_tool(entity_id, resolve)
30
+ agentgraph edges ... -> get_edges_tool(entity_id, edge_type, direction)
31
+ agentgraph traverse ... -> traverse_graph_tool(entity_id, max_depth, resolve)
32
+ ```
33
+
34
+ MCP search and query default to `refresh=false`; set it only when fresh
35
+ connector-owned presentation metadata is needed. It does not replace a targeted
36
+ source fetch for stale content.
37
+
38
+ ## Stubs
39
+
40
+ An entity is a stub when it has neither a title nor content. With the CLI, pass
41
+ `--resolve` to `get` or `traverse`. With MCP, set `resolve=true`, or call
42
+ `fetch_entity_by_id_tool` for the stub UUID and repeat the original operation.
43
+
44
+ For a known platform resource that is absent from the graph, use `agentgraph fetch
45
+ <platform> <resource-id>` or `fetch_entity_tool(platform, resource_id)`.
@@ -0,0 +1,51 @@
1
+ # AgentGraph data model
2
+
3
+ ## Entity types
4
+
5
+ | Type | Contains |
6
+ |---|---|
7
+ | `Channel` | Chat channels and DM threads. |
8
+ | `Document` | Text documents, feed/web pages, Drive files, and Gmail attachment stubs. |
9
+ | `Email` | Gmail email threads. |
10
+ | `Folder` | Drive folders and RSS feed containers. |
11
+ | `Message` | Chat messages. Chat images and uploads are stored in `metadata.attachments`. |
12
+ | `Person` | Source identities and confirmed cross-source identity merges. |
13
+ | `Spreadsheet` | Google Sheets and other spreadsheet resources. |
14
+
15
+ The valid core model does not currently include `Task` or `Project`.
16
+
17
+ ## Relationships
18
+
19
+ Edges connect entities with types such as `authored`, `participated_in`, `posted_in`,
20
+ `replied_to`, `mentions`, `contains`, and `references`. Use direct edges when one-hop
21
+ context is sufficient and traversal when the investigation needs a bounded subgraph.
22
+
23
+ ## Attachments
24
+
25
+ Chat photos and file uploads are attachments on `Message` entities. Query them with:
26
+
27
+ ```bash
28
+ agentgraph query --type Message --has-attachments --since 7d --json
29
+ ```
30
+
31
+ `metadata.attachments` is a JSON array containing `url`, `filename`, `content_type`,
32
+ and optional `width` and `height` fields.
33
+
34
+ Gmail attachments are different: they are `Document` stubs referenced by the owning
35
+ `Email`. Re-fetch the email thread, traverse one hop, then download the attachment
36
+ document.
37
+
38
+ ## Timestamps and retention
39
+
40
+ - `created_at`: local graph insertion time.
41
+ - `updated_at`: last material change to the stored entity.
42
+ - `source_created_at`: source-reported creation or publication time.
43
+ - `source_updated_at`: source-reported modification time.
44
+ - `synced_at`: last successful connector synchronization.
45
+ - `observed_at`: last accepted browser observation of that exact observable entity.
46
+
47
+ Observable entities expire from `observed_at`, or local `created_at` if never
48
+ observed. Messages and Gmail attachment documents follow their parent. Persons remain
49
+ while connected. Configured RSS feed Folders are persistent source entities and are
50
+ removed by the RSS connector's `remove` command or explicit deletion. Bookmarks protect
51
+ an entity from automatic expiration.
@@ -0,0 +1,77 @@
1
+ # AgentGraph operations
2
+
3
+ ## Availability and authentication
4
+
5
+ ```bash
6
+ agentgraph connectors [--verify] [--json]
7
+ agentgraph auth [--verify] [--json] status
8
+ agentgraph auth <provider> [--add] [--account <account-id>]
9
+ agentgraph auth remove <provider> [--account <account-id>] [--json]
10
+ ```
11
+
12
+ Use `agentgraph connectors --json` to discover installed connector source names,
13
+ valid platform values, URL ownership, polling delegation, and sync state. Do not rely
14
+ on a hardcoded platform list. Use `--verify` only when a live provider check is
15
+ needed.
16
+
17
+ MCP equivalents are `list_connectors_tool`, `list_auth_providers_tool`,
18
+ `authenticate_provider_tool`, and `remove_auth_provider_tool`.
19
+
20
+ ## Fetch and refresh
21
+
22
+ ```bash
23
+ agentgraph fetch <platform> <resource-id> [--json]
24
+ agentgraph fetch-entity <entity-id> [--json]
25
+ agentgraph poll [<source>] [--json]
26
+ agentgraph connector <source> <command> [args...] [--json]
27
+ agentgraph connector <source> --help
28
+ ```
29
+
30
+ The MCP equivalents are `fetch_entity_tool`, `fetch_entity_by_id_tool`,
31
+ `poll_connectors_tool`, and `run_connector_command_tool`.
32
+
33
+ Fetch persists the connector's complete returned batch before reporting counts and
34
+ does not update `observed_at`. Poll reports `polled`, `already_running`, and `skipped`.
35
+ A connector can be refreshed by another connector, so also inspect `polled_by` and
36
+ `sync` in connector status.
37
+
38
+ Historical ingest is connector-owned. Discover it through connector help. For
39
+ example, Gmail exposes:
40
+
41
+ ```bash
42
+ agentgraph connector gmail ingest [--account <account-id>] [--json]
43
+ ```
44
+
45
+ The MCP form is `run_connector_command_tool("gmail", ["ingest", ...])`. There is no
46
+ top-level `agentgraph ingest` command or `ingest_connector_tool`.
47
+
48
+ ## Files and retained context
49
+
50
+ ```bash
51
+ agentgraph download <entity-id|platform/ref> [--output <file-or-dir>] [--json]
52
+ agentgraph bookmark <entity-id|platform/ref|url> [--remove] [--json]
53
+ agentgraph delete <entity-id|platform/ref|url> [--json]
54
+ agentgraph unify-persons <primary-person-id> <duplicate-person-id>... [--json]
55
+ ```
56
+
57
+ Use `download_entity_tool`, `bookmark_entity_tool`, `delete_entity_tool`, and
58
+ `unify_persons_tool` through MCP. Confirm identity before person unification. The
59
+ first Person is canonical and keeps its ID. Deletion removes connected edges.
60
+
61
+ ## Server and skill setup
62
+
63
+ `agentgraph serve` runs the required local AgentGraph service. Follow the environment's
64
+ process-management instructions rather than starting a duplicate foreground server
65
+ when a service manager already owns it.
66
+
67
+ `agentgraph poll` and connector or authentication commands that queue a poll or ingest
68
+ contact that service over localhost. If sandboxed execution blocks one of those
69
+ commands, request permission to contact the configured localhost server and retry it.
70
+
71
+ ```bash
72
+ agentgraph mcp-config
73
+ agentgraph mcp-serve
74
+ agentgraph install-skill [AgentGraph] [--target user|project] [--no-claude] [--force] [--json]
75
+ ```
76
+
77
+ The skill installer is available only through the `agentgraph install-skill` CLI command.
@@ -0,0 +1,175 @@
1
+ Metadata-Version: 2.4
2
+ Name: agentgraph-server
3
+ Version: 0.5.3
4
+ Summary: A local-first CLI and MCP server that turns selected digital sources into a searchable graph for the AI agent you already use.
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
+ **Give the AI agent you already use a searchable world.**
44
+
45
+ AgentGraph is a local-first, self-hosted CLI and MCP server that turns the sources you choose into a searchable graph for the AI agent you already use. Connect Gmail, Google Drive, Slack, Discord, RSS, and web pages; AgentGraph translates them into local entities, people, relationships, and searchable content.
46
+
47
+ > **AgentGraph stores context; your agent reasons over it.** It is not an agent, chatbot, hosted graph service, or replacement for the tools you already use.
48
+
49
+ [See the demo](docs-src/demo.md) · [Install](docs-src/install.md) · [Documentation](https://simonexmachina.github.io/agent-graph/) · [Chrome extension](https://chromewebstore.google.com/detail/agentgraph-extension/iilkfclglabllelhjacijldknapbhidi)
50
+
51
+ <picture>
52
+ <source media="(prefers-color-scheme: dark)" srcset="docs-src/assets/diagrams/architecture-overview-dark.svg">
53
+ <img src="docs-src/assets/diagrams/architecture-overview-light.svg" alt="Observe, Fetch, and Refresh converge on connector packages that read selected services and write to a local graph. Agents access the graph through the CLI or MCP, while Expiry applies the retention model.">
54
+ </picture>
55
+
56
+ ## Why AgentGraph
57
+
58
+ Coding agents work well because their source of truth is already on disk. They can search files, follow references, inspect history, and build a model of the system without the user pasting every relevant detail.
59
+
60
+ The rest of a person's digital context is fragmented across messages, documents, feeds, and web pages. AgentGraph makes the parts you choose locally searchable and navigable through MCP, so a coding agent can investigate that context instead of starting every conversation blind.
61
+
62
+ ## How context enters the graph
63
+
64
+ AgentGraph builds context in three ways:
65
+
66
+ 1. **Observe:** the Chrome extension recognizes a supported URL, waits until you have kept it focused for the observation threshold, and reports the resource to your local AgentGraph server. The owning connector fetches it through the source API.
67
+ 2. **Fetch:** your agent or the CLI can request a specific resource. The connector adds or refreshes its entities, people, and edges before returning.
68
+ 3. **Refresh:** connector polling and ingest keep configured or already-known resources current in the background.
69
+
70
+ Observation is also an attention signal. Browser observation updates `observed_at`; direct fetch, polling, ingest, and source changes do not. Observable entities expire after 90 days by default unless they are observed again or bookmarked. See [How AgentGraph works](docs-src/how-it-works.md) and [Entity retention](docs-src/retention.md).
71
+
72
+ The extension sends recognized URLs, plus the Gmail thread identifier where required, to the local server. It does not upload arbitrary page content to an AgentGraph-operated service.
73
+
74
+ ## Trace a decision across sources
75
+
76
+ The launch demo asks an existing coding agent:
77
+
78
+ > Before I reply to Maya, reconstruct the Atlas synchronization decision. What did she require, what did engineering agree, does the Drive plan match, and which research supports the decision? Flag contradictions and link every source.
79
+
80
+ The agent uses the Graph skill and AgentGraph CLI to search a fictional Gmail thread, traverse a Slack discussion and its authors, check a stale Drive plan, and compare two research documents. Everything is included in one deterministic fixture; no provider credentials, browser observation, or MCP setup are required. [Run the demo](docs-src/demo.md).
81
+
82
+ ## What each connector makes perceptible
83
+
84
+ | Connector | What it contributes | Context paths |
85
+ | --- | --- | --- |
86
+ | Gmail | Email threads, participants, subjects, bodies, and attachment references | Observe, fetch, poll, ingest |
87
+ | Google Drive, Docs, Sheets | Folders, files, content, ownership, authorship, and containment | Observe, fetch, poll |
88
+ | Slack | Channels and DMs, messages, replies, authors, mentions, and attachments | Observe, fetch, poll |
89
+ | Discord | Channels, DMs, threads, messages, authors, mentions, and attachments | Observe, fetch, poll |
90
+ | RSS | Feeds, posts, dates, authors, and publication relationships | Observe, fetch, poll, ingest |
91
+ | Web | Configured pages and bookmarks with titles, text, metadata, and URLs | Observe, fetch |
92
+
93
+ These connectors are proof of the pattern, not the boundary of the product. A connector can translate an API, export, webhook, local database, browser surface, or structured file into AgentGraph's shared model.
94
+
95
+ **Bring any service into your agent's world.** Teams can keep private connectors for internal systems, individuals can connect niche tools, and open-source contributors can publish integrations for the wider community. See [Connectors](docs-src/connectors.md) and [Extending AgentGraph](docs-src/extending.md).
96
+
97
+ ## Quickstart
98
+
99
+ AgentGraph requires Python 3.12+, [`uv`](https://docs.astral.sh/uv/), and Chrome for browser observation.
100
+
101
+ ```bash
102
+ git clone https://github.com/simonexmachina/agent-graph
103
+ cd agent-graph
104
+ uv sync --extra all
105
+ source .venv/bin/activate
106
+ agentgraph onboard
107
+ agentgraph serve
108
+ ```
109
+
110
+ Install the [AgentGraph Chrome extension](https://chromewebstore.google.com/detail/agentgraph-extension/iilkfclglabllelhjacijldknapbhidi), browse a supported resource, then verify that context landed:
111
+
112
+ ```bash
113
+ agentgraph connectors
114
+ agentgraph search "project kickoff notes"
115
+ agentgraph traverse <entity-id> --depth 2
116
+ ```
117
+
118
+ Connect the agent you already use:
119
+
120
+ ```bash
121
+ agentgraph mcp-config
122
+ ```
123
+
124
+ Use the printed stdio configuration with Claude Desktop, Claude Code, Codex, or another compatible MCP client. ChatGPT developer mode uses the streamable HTTP `/mcp` endpoint through HTTPS. See [Install](docs-src/install.md) for the complete setup path.
125
+
126
+ ## What AgentGraph is and is not
127
+
128
+ | AgentGraph is | AgentGraph is not |
129
+ | --- | --- |
130
+ | Local-first infrastructure | An AI agent or autonomous assistant |
131
+ | A CLI and MCP server | A replacement for your agent |
132
+ | A searchable graph of selected context | A chatbot or LLM |
133
+ | An open connector architecture | A hosted integration SaaS |
134
+ | Semantic search plus typed entities and edges | Only a vector database |
135
+ | Self-hosted and open source | A project-operated store for your graph data |
136
+
137
+ ## Local data and privacy
138
+
139
+ Indexed content is stored in SQLite on your machine. Provider credentials stay in the AgentGraph config directory, and source API calls run directly from your machine under your credentials. AgentGraph does not operate a hosted graph service or send indexed content to a project-controlled backend.
140
+
141
+ An MCP client you connect can receive content from the local graph, subject to that client's data practices. Read the complete [Privacy Policy](docs-src/privacy.md), [Terms of Service](docs-src/terms.md), and [retention model](docs-src/retention.md).
142
+
143
+ ## Interfaces
144
+
145
+ | Surface | Use it for | Entry point |
146
+ | --- | --- | --- |
147
+ | MCP | Let an existing agent search, traverse, fetch, and manage context | `agentgraph mcp-config`, `agentgraph mcp-serve` |
148
+ | CLI | Search, fetch, ingest, debug, and operate the graph | `agentgraph search`, `agentgraph fetch`, `agentgraph serve` |
149
+ | Browser extension | Turn focused browsing on supported URLs into observations | [Chrome Web Store](https://chromewebstore.google.com/detail/agentgraph-extension/iilkfclglabllelhjacijldknapbhidi) |
150
+ | Viewer | Inspect entities, people, relationships, and observation state | `http://127.0.0.1:8765/viewer` |
151
+
152
+ ## Documentation
153
+
154
+ - [Install](docs-src/install.md)
155
+ - [Install](docs-src/install.md)
156
+ - [How AgentGraph works](docs-src/how-it-works.md)
157
+ - [Connectors](docs-src/connectors.md)
158
+ - [Configuration](docs-src/configuration.md)
159
+ - [Commands](docs-src/commands/index.md)
160
+ - [MCP tools](docs-src/mcp/index.md)
161
+ - [Extending](docs-src/extending.md)
162
+
163
+ ## Contributing
164
+
165
+ See [AGENTS.md](AGENTS.md) for repository-specific development rules. Before opening a change, run:
166
+
167
+ ```bash
168
+ uv run pytest tests/ -m "not integration and not browser" -q
169
+ uv run pyright
170
+ uv run ruff check agentgraph/ packages/ scripts/ tests/
171
+ ```
172
+
173
+ ## License
174
+
175
+ See [LICENSE](LICENSE).
@@ -0,0 +1,135 @@
1
+ # AgentGraph
2
+
3
+ **Give the AI agent you already use a searchable world.**
4
+
5
+ AgentGraph is a local-first, self-hosted CLI and MCP server that turns the sources you choose into a searchable graph for the AI agent you already use. Connect Gmail, Google Drive, Slack, Discord, RSS, and web pages; AgentGraph translates them into local entities, people, relationships, and searchable content.
6
+
7
+ > **AgentGraph stores context; your agent reasons over it.** It is not an agent, chatbot, hosted graph service, or replacement for the tools you already use.
8
+
9
+ [See the demo](docs-src/demo.md) · [Install](docs-src/install.md) · [Documentation](https://simonexmachina.github.io/agent-graph/) · [Chrome extension](https://chromewebstore.google.com/detail/agentgraph-extension/iilkfclglabllelhjacijldknapbhidi)
10
+
11
+ <picture>
12
+ <source media="(prefers-color-scheme: dark)" srcset="docs-src/assets/diagrams/architecture-overview-dark.svg">
13
+ <img src="docs-src/assets/diagrams/architecture-overview-light.svg" alt="Observe, Fetch, and Refresh converge on connector packages that read selected services and write to a local graph. Agents access the graph through the CLI or MCP, while Expiry applies the retention model.">
14
+ </picture>
15
+
16
+ ## Why AgentGraph
17
+
18
+ Coding agents work well because their source of truth is already on disk. They can search files, follow references, inspect history, and build a model of the system without the user pasting every relevant detail.
19
+
20
+ The rest of a person's digital context is fragmented across messages, documents, feeds, and web pages. AgentGraph makes the parts you choose locally searchable and navigable through MCP, so a coding agent can investigate that context instead of starting every conversation blind.
21
+
22
+ ## How context enters the graph
23
+
24
+ AgentGraph builds context in three ways:
25
+
26
+ 1. **Observe:** the Chrome extension recognizes a supported URL, waits until you have kept it focused for the observation threshold, and reports the resource to your local AgentGraph server. The owning connector fetches it through the source API.
27
+ 2. **Fetch:** your agent or the CLI can request a specific resource. The connector adds or refreshes its entities, people, and edges before returning.
28
+ 3. **Refresh:** connector polling and ingest keep configured or already-known resources current in the background.
29
+
30
+ Observation is also an attention signal. Browser observation updates `observed_at`; direct fetch, polling, ingest, and source changes do not. Observable entities expire after 90 days by default unless they are observed again or bookmarked. See [How AgentGraph works](docs-src/how-it-works.md) and [Entity retention](docs-src/retention.md).
31
+
32
+ The extension sends recognized URLs, plus the Gmail thread identifier where required, to the local server. It does not upload arbitrary page content to an AgentGraph-operated service.
33
+
34
+ ## Trace a decision across sources
35
+
36
+ The launch demo asks an existing coding agent:
37
+
38
+ > Before I reply to Maya, reconstruct the Atlas synchronization decision. What did she require, what did engineering agree, does the Drive plan match, and which research supports the decision? Flag contradictions and link every source.
39
+
40
+ The agent uses the Graph skill and AgentGraph CLI to search a fictional Gmail thread, traverse a Slack discussion and its authors, check a stale Drive plan, and compare two research documents. Everything is included in one deterministic fixture; no provider credentials, browser observation, or MCP setup are required. [Run the demo](docs-src/demo.md).
41
+
42
+ ## What each connector makes perceptible
43
+
44
+ | Connector | What it contributes | Context paths |
45
+ | --- | --- | --- |
46
+ | Gmail | Email threads, participants, subjects, bodies, and attachment references | Observe, fetch, poll, ingest |
47
+ | Google Drive, Docs, Sheets | Folders, files, content, ownership, authorship, and containment | Observe, fetch, poll |
48
+ | Slack | Channels and DMs, messages, replies, authors, mentions, and attachments | Observe, fetch, poll |
49
+ | Discord | Channels, DMs, threads, messages, authors, mentions, and attachments | Observe, fetch, poll |
50
+ | RSS | Feeds, posts, dates, authors, and publication relationships | Observe, fetch, poll, ingest |
51
+ | Web | Configured pages and bookmarks with titles, text, metadata, and URLs | Observe, fetch |
52
+
53
+ These connectors are proof of the pattern, not the boundary of the product. A connector can translate an API, export, webhook, local database, browser surface, or structured file into AgentGraph's shared model.
54
+
55
+ **Bring any service into your agent's world.** Teams can keep private connectors for internal systems, individuals can connect niche tools, and open-source contributors can publish integrations for the wider community. See [Connectors](docs-src/connectors.md) and [Extending AgentGraph](docs-src/extending.md).
56
+
57
+ ## Quickstart
58
+
59
+ AgentGraph requires Python 3.12+, [`uv`](https://docs.astral.sh/uv/), and Chrome for browser observation.
60
+
61
+ ```bash
62
+ git clone https://github.com/simonexmachina/agent-graph
63
+ cd agent-graph
64
+ uv sync --extra all
65
+ source .venv/bin/activate
66
+ agentgraph onboard
67
+ agentgraph serve
68
+ ```
69
+
70
+ Install the [AgentGraph Chrome extension](https://chromewebstore.google.com/detail/agentgraph-extension/iilkfclglabllelhjacijldknapbhidi), browse a supported resource, then verify that context landed:
71
+
72
+ ```bash
73
+ agentgraph connectors
74
+ agentgraph search "project kickoff notes"
75
+ agentgraph traverse <entity-id> --depth 2
76
+ ```
77
+
78
+ Connect the agent you already use:
79
+
80
+ ```bash
81
+ agentgraph mcp-config
82
+ ```
83
+
84
+ Use the printed stdio configuration with Claude Desktop, Claude Code, Codex, or another compatible MCP client. ChatGPT developer mode uses the streamable HTTP `/mcp` endpoint through HTTPS. See [Install](docs-src/install.md) for the complete setup path.
85
+
86
+ ## What AgentGraph is and is not
87
+
88
+ | AgentGraph is | AgentGraph is not |
89
+ | --- | --- |
90
+ | Local-first infrastructure | An AI agent or autonomous assistant |
91
+ | A CLI and MCP server | A replacement for your agent |
92
+ | A searchable graph of selected context | A chatbot or LLM |
93
+ | An open connector architecture | A hosted integration SaaS |
94
+ | Semantic search plus typed entities and edges | Only a vector database |
95
+ | Self-hosted and open source | A project-operated store for your graph data |
96
+
97
+ ## Local data and privacy
98
+
99
+ Indexed content is stored in SQLite on your machine. Provider credentials stay in the AgentGraph config directory, and source API calls run directly from your machine under your credentials. AgentGraph does not operate a hosted graph service or send indexed content to a project-controlled backend.
100
+
101
+ An MCP client you connect can receive content from the local graph, subject to that client's data practices. Read the complete [Privacy Policy](docs-src/privacy.md), [Terms of Service](docs-src/terms.md), and [retention model](docs-src/retention.md).
102
+
103
+ ## Interfaces
104
+
105
+ | Surface | Use it for | Entry point |
106
+ | --- | --- | --- |
107
+ | MCP | Let an existing agent search, traverse, fetch, and manage context | `agentgraph mcp-config`, `agentgraph mcp-serve` |
108
+ | CLI | Search, fetch, ingest, debug, and operate the graph | `agentgraph search`, `agentgraph fetch`, `agentgraph serve` |
109
+ | Browser extension | Turn focused browsing on supported URLs into observations | [Chrome Web Store](https://chromewebstore.google.com/detail/agentgraph-extension/iilkfclglabllelhjacijldknapbhidi) |
110
+ | Viewer | Inspect entities, people, relationships, and observation state | `http://127.0.0.1:8765/viewer` |
111
+
112
+ ## Documentation
113
+
114
+ - [Install](docs-src/install.md)
115
+ - [Install](docs-src/install.md)
116
+ - [How AgentGraph works](docs-src/how-it-works.md)
117
+ - [Connectors](docs-src/connectors.md)
118
+ - [Configuration](docs-src/configuration.md)
119
+ - [Commands](docs-src/commands/index.md)
120
+ - [MCP tools](docs-src/mcp/index.md)
121
+ - [Extending](docs-src/extending.md)
122
+
123
+ ## Contributing
124
+
125
+ See [AGENTS.md](AGENTS.md) for repository-specific development rules. Before opening a change, run:
126
+
127
+ ```bash
128
+ uv run pytest tests/ -m "not integration and not browser" -q
129
+ uv run pyright
130
+ uv run ruff check agentgraph/ packages/ scripts/ tests/
131
+ ```
132
+
133
+ ## License
134
+
135
+ See [LICENSE](LICENSE).
@@ -9,11 +9,20 @@ from __future__ import annotations
9
9
  import json
10
10
  import os
11
11
  import tempfile
12
+ from pathlib import Path
12
13
  from typing import Any, cast
13
14
 
14
15
  from pydantic import BaseModel
15
16
 
16
- from agentgraph.config import CONFIG_DIR, CREDENTIALS_FILE
17
+ from agentgraph.config import CONFIG_DIR, CREDENTIALS_FILE, get_config_paths
18
+
19
+
20
+ def _credential_paths() -> tuple[Path, Path]:
21
+ """Resolve credentials dynamically while preserving local path overrides."""
22
+ if "AGENTGRAPH_CONFIG_DIR" in os.environ:
23
+ config_dir, _, _, credentials_file, _ = get_config_paths()
24
+ return config_dir, credentials_file
25
+ return CONFIG_DIR, CREDENTIALS_FILE
17
26
 
18
27
 
19
28
  class CredentialsFileError(ValueError):
@@ -26,34 +35,36 @@ class PlatformAccounts(BaseModel):
26
35
 
27
36
 
28
37
  def _load_all_credentials() -> dict[str, Any]:
29
- if not CREDENTIALS_FILE.exists():
38
+ _, credentials_file = _credential_paths()
39
+ if not credentials_file.exists():
30
40
  return {}
31
41
  try:
32
- data = json.loads(CREDENTIALS_FILE.read_text())
42
+ data = json.loads(credentials_file.read_text())
33
43
  except Exception as exc:
34
44
  # Never fall back to "no credentials" here: callers would treat a
35
45
  # damaged file as a first-time setup and overwrite every platform.
36
46
  raise CredentialsFileError(
37
- f"Could not parse {CREDENTIALS_FILE}: {exc}. "
47
+ f"Could not parse {credentials_file}: {exc}. "
38
48
  "Fix or move the file aside, then re-run auth for each platform."
39
49
  ) from exc
40
50
  if not isinstance(data, dict):
41
51
  raise CredentialsFileError(
42
- f"Expected a JSON object at the top level of {CREDENTIALS_FILE}, got {type(data).__name__}."
52
+ f"Expected a JSON object at the top level of {credentials_file}, got {type(data).__name__}."
43
53
  )
44
54
  return cast(dict[str, Any], data)
45
55
 
46
56
 
47
57
  def _write_all_credentials(raw: dict[str, Any]) -> None:
48
- CONFIG_DIR.mkdir(parents=True, exist_ok=True)
58
+ config_dir, credentials_file = _credential_paths()
59
+ config_dir.mkdir(parents=True, exist_ok=True)
49
60
  # Write via a temp file in the same directory and rename, so a concurrent
50
61
  # writer can never leave a shorter document overlaid on a longer one.
51
- fd, tmp_name = tempfile.mkstemp(dir=CONFIG_DIR, prefix=".credentials-", suffix=".json")
62
+ fd, tmp_name = tempfile.mkstemp(dir=config_dir, prefix=".credentials-", suffix=".json")
52
63
  try:
53
64
  with os.fdopen(fd, "w") as handle:
54
65
  json.dump(raw, handle, indent=2, default=str)
55
66
  os.chmod(tmp_name, 0o600)
56
- os.replace(tmp_name, CREDENTIALS_FILE)
67
+ os.replace(tmp_name, credentials_file)
57
68
  except BaseException:
58
69
  if os.path.exists(tmp_name):
59
70
  os.unlink(tmp_name)
@@ -64,8 +75,9 @@ def _validate_accounts(platform: str, val: dict[str, Any]) -> PlatformAccounts:
64
75
  try:
65
76
  return PlatformAccounts.model_validate(val)
66
77
  except Exception as exc:
78
+ _, credentials_file = _credential_paths()
67
79
  raise CredentialsFileError(
68
- f"Stored '{platform}' credentials in {CREDENTIALS_FILE} are malformed: {exc}. "
80
+ f"Stored '{platform}' credentials in {credentials_file} are malformed: {exc}. "
69
81
  f"Fix the file or re-run auth for {platform}."
70
82
  ) from exc
71
83