ugraph-kit 0.1.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.
- ugraph_kit-0.1.0/LICENSE +158 -0
- ugraph_kit-0.1.0/PKG-INFO +248 -0
- ugraph_kit-0.1.0/README.md +209 -0
- ugraph_kit-0.1.0/pyproject.toml +102 -0
- ugraph_kit-0.1.0/setup.cfg +4 -0
- ugraph_kit-0.1.0/src/ugraph/__init__.py +28 -0
- ugraph_kit-0.1.0/src/ugraph/_bundled/skills/channel-to-kb/SKILL.md +194 -0
- ugraph_kit-0.1.0/src/ugraph/_bundled/skills/channel-to-kb/references/candidate-extraction-text.md +39 -0
- ugraph_kit-0.1.0/src/ugraph/_bundled/skills/channel-to-kb/references/candidate-extraction.md +115 -0
- ugraph_kit-0.1.0/src/ugraph/_bundled/templates/SCHEMA.md +177 -0
- ugraph_kit-0.1.0/src/ugraph/_bundled/templates/taxonomy.json +44 -0
- ugraph_kit-0.1.0/src/ugraph/auth.py +194 -0
- ugraph_kit-0.1.0/src/ugraph/capture_intent.py +104 -0
- ugraph_kit-0.1.0/src/ugraph/cli.py +1465 -0
- ugraph_kit-0.1.0/src/ugraph/config.py +259 -0
- ugraph_kit-0.1.0/src/ugraph/embed.py +442 -0
- ugraph_kit-0.1.0/src/ugraph/extract.py +922 -0
- ugraph_kit-0.1.0/src/ugraph/graph.py +626 -0
- ugraph_kit-0.1.0/src/ugraph/indexes.py +329 -0
- ugraph_kit-0.1.0/src/ugraph/ingest.py +359 -0
- ugraph_kit-0.1.0/src/ugraph/ledger.py +366 -0
- ugraph_kit-0.1.0/src/ugraph/limits.py +184 -0
- ugraph_kit-0.1.0/src/ugraph/lint.py +462 -0
- ugraph_kit-0.1.0/src/ugraph/model.py +317 -0
- ugraph_kit-0.1.0/src/ugraph/person.py +221 -0
- ugraph_kit-0.1.0/src/ugraph/promote.py +150 -0
- ugraph_kit-0.1.0/src/ugraph/py.typed +0 -0
- ugraph_kit-0.1.0/src/ugraph/runs.py +191 -0
- ugraph_kit-0.1.0/src/ugraph/select.py +161 -0
- ugraph_kit-0.1.0/src/ugraph/sources/__init__.py +11 -0
- ugraph_kit-0.1.0/src/ugraph/sources/youtube.py +758 -0
- ugraph_kit-0.1.0/src/ugraph/status.py +292 -0
- ugraph_kit-0.1.0/src/ugraph/store.py +173 -0
- ugraph_kit-0.1.0/src/ugraph/templates.py +37 -0
- ugraph_kit-0.1.0/src/ugraph/verify.py +838 -0
- ugraph_kit-0.1.0/src/ugraph/wizard.py +187 -0
- ugraph_kit-0.1.0/src/ugraph_kit.egg-info/PKG-INFO +248 -0
- ugraph_kit-0.1.0/src/ugraph_kit.egg-info/SOURCES.txt +67 -0
- ugraph_kit-0.1.0/src/ugraph_kit.egg-info/dependency_links.txt +1 -0
- ugraph_kit-0.1.0/src/ugraph_kit.egg-info/entry_points.txt +2 -0
- ugraph_kit-0.1.0/src/ugraph_kit.egg-info/requires.txt +17 -0
- ugraph_kit-0.1.0/src/ugraph_kit.egg-info/top_level.txt +1 -0
- ugraph_kit-0.1.0/tests/test_api_backend.py +189 -0
- ugraph_kit-0.1.0/tests/test_auth.py +44 -0
- ugraph_kit-0.1.0/tests/test_backend_selection.py +39 -0
- ugraph_kit-0.1.0/tests/test_capture_intent.py +55 -0
- ugraph_kit-0.1.0/tests/test_capture_ux.py +62 -0
- ugraph_kit-0.1.0/tests/test_chunking.py +16 -0
- ugraph_kit-0.1.0/tests/test_config_env.py +20 -0
- ugraph_kit-0.1.0/tests/test_embed_reuse.py +95 -0
- ugraph_kit-0.1.0/tests/test_graph.py +162 -0
- ugraph_kit-0.1.0/tests/test_indexes.py +102 -0
- ugraph_kit-0.1.0/tests/test_kb_identity.py +108 -0
- ugraph_kit-0.1.0/tests/test_ledger.py +163 -0
- ugraph_kit-0.1.0/tests/test_limits.py +152 -0
- ugraph_kit-0.1.0/tests/test_lint.py +130 -0
- ugraph_kit-0.1.0/tests/test_model.py +170 -0
- ugraph_kit-0.1.0/tests/test_model_routing.py +102 -0
- ugraph_kit-0.1.0/tests/test_person.py +90 -0
- ugraph_kit-0.1.0/tests/test_playlist_pipeline.py +64 -0
- ugraph_kit-0.1.0/tests/test_reingest.py +82 -0
- ugraph_kit-0.1.0/tests/test_remembered_kb.py +150 -0
- ugraph_kit-0.1.0/tests/test_resume_checkpoints.py +173 -0
- ugraph_kit-0.1.0/tests/test_runs.py +80 -0
- ugraph_kit-0.1.0/tests/test_select.py +132 -0
- ugraph_kit-0.1.0/tests/test_templates.py +12 -0
- ugraph_kit-0.1.0/tests/test_text_extract.py +122 -0
- ugraph_kit-0.1.0/tests/test_verify.py +332 -0
- ugraph_kit-0.1.0/tests/test_wizard.py +230 -0
ugraph_kit-0.1.0/LICENSE
ADDED
|
@@ -0,0 +1,158 @@
|
|
|
1
|
+
Apache License
|
|
2
|
+
Version 2.0, January 2004
|
|
3
|
+
http://www.apache.org/licenses/
|
|
4
|
+
|
|
5
|
+
TERMS AND CONDITIONS FOR USE, REPRODUCTION, AND DISTRIBUTION
|
|
6
|
+
|
|
7
|
+
1. Definitions.
|
|
8
|
+
|
|
9
|
+
"License" shall mean the terms and conditions for use, reproduction,
|
|
10
|
+
and distribution as defined by Sections 1 through 9 of this document.
|
|
11
|
+
|
|
12
|
+
"Licensor" shall mean the copyright owner or entity authorized by
|
|
13
|
+
the copyright owner that is granting the License.
|
|
14
|
+
|
|
15
|
+
"Legal Entity" shall mean the union of the acting entity and all
|
|
16
|
+
other entities that control, are controlled by, or are under common
|
|
17
|
+
control with that entity. For the purposes of this definition,
|
|
18
|
+
"control" means (i) the power, direct or indirect, to cause the
|
|
19
|
+
direction or management of such entity, whether by contract or
|
|
20
|
+
otherwise, or (ii) ownership of fifty percent (50%) or more of the
|
|
21
|
+
outstanding shares, or (iii) beneficial ownership of such entity.
|
|
22
|
+
|
|
23
|
+
"You" (or "Your") shall mean an individual or Legal Entity
|
|
24
|
+
exercising permissions granted by this License.
|
|
25
|
+
|
|
26
|
+
"Source" form shall mean the preferred form for making modifications,
|
|
27
|
+
including but not limited to software source code, documentation
|
|
28
|
+
source, and configuration files.
|
|
29
|
+
|
|
30
|
+
"Object" form shall mean any form resulting from mechanical
|
|
31
|
+
transformation or translation of a Source form, including but
|
|
32
|
+
not limited to compiled object code, generated documentation,
|
|
33
|
+
and conversions to other media types.
|
|
34
|
+
|
|
35
|
+
"Work" shall mean the work of authorship, whether in Source or
|
|
36
|
+
Object form, made available under the License, as indicated by a
|
|
37
|
+
copyright notice that is included in or attached to the work
|
|
38
|
+
(an example is provided in the Appendix below).
|
|
39
|
+
|
|
40
|
+
"Derivative Works" shall mean any work, whether in Source or Object
|
|
41
|
+
form, that is based on (or derived from) the Work and for which the
|
|
42
|
+
editorial revisions, annotations, elaborations, or other modifications
|
|
43
|
+
represent, as a whole, an original work of authorship. For the purposes
|
|
44
|
+
of this License, Derivative Works shall not include works that remain
|
|
45
|
+
separable from, or merely link (or bind) by name to the interfaces of,
|
|
46
|
+
the Work and Derivative Works thereof.
|
|
47
|
+
|
|
48
|
+
"Contribution" shall mean any work of authorship, including
|
|
49
|
+
the original version of the Work and any modifications or additions
|
|
50
|
+
to that Work or Derivative Works thereof, that is intentionally
|
|
51
|
+
submitted to Licensor for inclusion in the Work by the copyright owner
|
|
52
|
+
or by an individual or Legal Entity authorized to submit on behalf of
|
|
53
|
+
the copyright owner. For the purposes of this definition, "submitted"
|
|
54
|
+
means any form of electronic, verbal, or written communication sent
|
|
55
|
+
to the Licensor or its representatives, including but not limited to
|
|
56
|
+
communication on electronic mailing lists, source code control systems,
|
|
57
|
+
and issue tracking systems that are managed by, or on behalf of, the
|
|
58
|
+
Licensor for the purpose of discussing and improving the Work, but
|
|
59
|
+
excluding communication that is conspicuously marked or otherwise
|
|
60
|
+
designated in writing by the copyright owner as "Not a Contribution."
|
|
61
|
+
|
|
62
|
+
"Contributor" shall mean Licensor and any individual or Legal Entity
|
|
63
|
+
on behalf of whom a Contribution has been received by Licensor and
|
|
64
|
+
subsequently incorporated within the Work.
|
|
65
|
+
|
|
66
|
+
2. Grant of Copyright License. Subject to the terms and conditions of
|
|
67
|
+
this License, each Contributor hereby grants You a perpetual,
|
|
68
|
+
worldwide, non-exclusive, no-charge, royalty-free, irrevocable
|
|
69
|
+
copyright license to reproduce, prepare Derivative Works of,
|
|
70
|
+
publicly display, publicly perform, sublicense, and distribute the
|
|
71
|
+
Work and such Derivative Works in Source or Object form.
|
|
72
|
+
|
|
73
|
+
3. Grant of Patent License. Subject to the terms and conditions of
|
|
74
|
+
this License, each Contributor hereby grants You a perpetual,
|
|
75
|
+
worldwide, non-exclusive, no-charge, royalty-free, irrevocable
|
|
76
|
+
(except as stated in this section) patent license to make, have made,
|
|
77
|
+
use, offer to sell, sell, import, and otherwise transfer the Work,
|
|
78
|
+
where such license applies only to those patent claims licensable
|
|
79
|
+
by such Contributor that are necessarily infringed by their
|
|
80
|
+
Contribution(s) alone or by combination of their Contribution(s)
|
|
81
|
+
with the Work to which such Contribution(s) was submitted. If You
|
|
82
|
+
institute patent litigation against any entity (including a
|
|
83
|
+
cross-claim or counterclaim) in a lawsuit alleging that the Work
|
|
84
|
+
or a Contribution incorporated within the Work constitutes direct
|
|
85
|
+
or contributory patent infringement, then any patent licenses for
|
|
86
|
+
the Work granted to You under this License for that Work shall
|
|
87
|
+
terminate as of the date such litigation is filed.
|
|
88
|
+
|
|
89
|
+
4. Redistribution. You may reproduce and distribute copies of the
|
|
90
|
+
Work or Derivative Works thereof in any medium, with or without
|
|
91
|
+
modifications, and in Source or Object form, provided that You
|
|
92
|
+
meet the following conditions:
|
|
93
|
+
|
|
94
|
+
(a) You must give any other recipients of the Work or
|
|
95
|
+
Derivative Works a copy of this License; and
|
|
96
|
+
|
|
97
|
+
(b) You must cause any modified files to carry prominent notices
|
|
98
|
+
stating that You changed the files; and
|
|
99
|
+
|
|
100
|
+
(c) You must retain, in the Source form of any Derivative Works
|
|
101
|
+
that You distribute, all copyright, patent, trademark, and
|
|
102
|
+
attribution notices from the Source form of the Work,
|
|
103
|
+
excluding those notices that do not pertain to any part of
|
|
104
|
+
the Derivative Works; and
|
|
105
|
+
|
|
106
|
+
(d) If the Work includes a "NOTICE" text file as part of its
|
|
107
|
+
distribution, then any Derivative Works that You distribute must
|
|
108
|
+
include a readable copy of the attribution notices contained
|
|
109
|
+
within such NOTICE file, excluding those notices that do not
|
|
110
|
+
pertain to any part of the Derivative Works, in at least one
|
|
111
|
+
of the following places: within a NOTICE text file distributed
|
|
112
|
+
as part of the Derivative Works; within the Source form or
|
|
113
|
+
documentation, if provided along with the Derivative Works; or,
|
|
114
|
+
within a display generated by the Derivative Works, if and
|
|
115
|
+
wherever such third-party notices normally appear. The contents
|
|
116
|
+
of the NOTICE file are for informational purposes only and
|
|
117
|
+
do not modify the License. You may add Your own attribution
|
|
118
|
+
notices within Derivative Works, but it is your responsibility
|
|
119
|
+
to ensure that the NOTICE file does not contain any additional
|
|
120
|
+
attribution notices.
|
|
121
|
+
|
|
122
|
+
Unless required by applicable law or agreed to in writing, Licensor
|
|
123
|
+
provides the Work (and each Contributor provides its Contributions)
|
|
124
|
+
on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND,
|
|
125
|
+
either express or implied, including, without limitation, any
|
|
126
|
+
warranties or conditions of TITLE, NON-INFRINGEMENT, MERCHANTABILITY,
|
|
127
|
+
or FITNESS FOR A PARTICULAR PURPOSE. You are specifically notified
|
|
128
|
+
that You may not use this software in violation of any applicable
|
|
129
|
+
laws or regulations. Aggregation of this Work with Derivative Works
|
|
130
|
+
for any purpose, however, shall be limited to your personal,
|
|
131
|
+
non-commercial use.
|
|
132
|
+
|
|
133
|
+
END OF TERMS AND CONDITIONS
|
|
134
|
+
|
|
135
|
+
APPENDIX: How to apply the Apache License to your work.
|
|
136
|
+
|
|
137
|
+
To apply the Apache License to your work, attach the following
|
|
138
|
+
boilerplate notice, with the fields enclosed by brackets "[]"
|
|
139
|
+
replaced with your own identifying information. (Don't include
|
|
140
|
+
the brackets!) The text should be enclosed in the appropriate
|
|
141
|
+
comment syntax for the file format. We also recommend that a
|
|
142
|
+
file or class name and description of purpose be included on the
|
|
143
|
+
same "printed page" as the copyright notice for easier
|
|
144
|
+
identification within third-party archives.
|
|
145
|
+
|
|
146
|
+
Copyright [yyyy] [name of copyright owner]
|
|
147
|
+
|
|
148
|
+
Licensed under the Apache License, Version 2.0 (the "License");
|
|
149
|
+
you may not use this file except in compliance with the License.
|
|
150
|
+
You may obtain a copy of the License at
|
|
151
|
+
|
|
152
|
+
http://www.apache.org/licenses/LICENSE-2.0
|
|
153
|
+
|
|
154
|
+
Unless required by applicable law or agreed to in writing, software
|
|
155
|
+
distributed under the License is distributed on an "AS IS" BASIS,
|
|
156
|
+
WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
|
157
|
+
See the License for the specific language governing permissions and
|
|
158
|
+
limitations under the License.
|
|
@@ -0,0 +1,248 @@
|
|
|
1
|
+
Metadata-Version: 2.4
|
|
2
|
+
Name: ugraph-kit
|
|
3
|
+
Version: 0.1.0
|
|
4
|
+
Summary: Build an agent-navigable, citation-verified knowledge base from sources you trust.
|
|
5
|
+
Author-email: saran-io <saran@tekvo.io>
|
|
6
|
+
License-Expression: Apache-2.0
|
|
7
|
+
Project-URL: Homepage, https://ugraph.build
|
|
8
|
+
Project-URL: Repository, https://github.com/tekvo-ai/app_ugraph_kit
|
|
9
|
+
Project-URL: Issues, https://github.com/tekvo-ai/app_ugraph_kit/issues
|
|
10
|
+
Project-URL: Changelog, https://github.com/tekvo-ai/app_ugraph_kit/blob/main/CHANGELOG.md
|
|
11
|
+
Keywords: knowledge-base,obsidian,ai,cli,provenance
|
|
12
|
+
Classifier: Development Status :: 3 - Alpha
|
|
13
|
+
Classifier: Environment :: Console
|
|
14
|
+
Classifier: Intended Audience :: Developers
|
|
15
|
+
Classifier: Operating System :: OS Independent
|
|
16
|
+
Classifier: Programming Language :: Python :: 3
|
|
17
|
+
Classifier: Programming Language :: Python :: 3.10
|
|
18
|
+
Classifier: Programming Language :: Python :: 3.11
|
|
19
|
+
Classifier: Programming Language :: Python :: 3.12
|
|
20
|
+
Classifier: Programming Language :: Python :: 3.13
|
|
21
|
+
Classifier: Topic :: Text Processing :: Markup :: Markdown
|
|
22
|
+
Requires-Python: >=3.10
|
|
23
|
+
Description-Content-Type: text/markdown
|
|
24
|
+
License-File: LICENSE
|
|
25
|
+
Requires-Dist: python-frontmatter>=1.0.0
|
|
26
|
+
Requires-Dist: tomli>=2.0.1; python_version < "3.11"
|
|
27
|
+
Requires-Dist: yt-dlp>=2025.1.15
|
|
28
|
+
Provides-Extra: api
|
|
29
|
+
Requires-Dist: anthropic>=0.34.0; extra == "api"
|
|
30
|
+
Requires-Dist: openai>=1.30.0; extra == "api"
|
|
31
|
+
Provides-Extra: dev
|
|
32
|
+
Requires-Dist: build>=1.2.2; extra == "dev"
|
|
33
|
+
Requires-Dist: mypy>=1.11; extra == "dev"
|
|
34
|
+
Requires-Dist: pytest>=8.0.0; extra == "dev"
|
|
35
|
+
Requires-Dist: pytest-cov>=5.0.0; extra == "dev"
|
|
36
|
+
Requires-Dist: ruff>=0.6; extra == "dev"
|
|
37
|
+
Requires-Dist: twine>=6.0.0; extra == "dev"
|
|
38
|
+
Dynamic: license-file
|
|
39
|
+
|
|
40
|
+
# ugraph
|
|
41
|
+
|
|
42
|
+
[](https://github.com/tekvo-ai/app_ugraph_kit/actions/workflows/ci.yml)
|
|
43
|
+
[](https://pypi.org/project/ugraph-kit/)
|
|
44
|
+
[](LICENSE)
|
|
45
|
+
|
|
46
|
+
Turn any CLI input — clipboard, paste, pipe, file, or URL — into a
|
|
47
|
+
filesystem-native knowledge base that Obsidian and agents can read. Raw sources
|
|
48
|
+
remain inspectable, chunk IDs are content-addressed, and extracted quotes are
|
|
49
|
+
checked against source text before they become candidates.
|
|
50
|
+
|
|
51
|
+
> **Alpha:** the ingestion foundation is usable; retrieval and the evaluation
|
|
52
|
+
> harness are still under active development.
|
|
53
|
+
|
|
54
|
+
## Install
|
|
55
|
+
|
|
56
|
+
The distribution is named `ugraph-kit` because `ugraph` is already taken on
|
|
57
|
+
PyPI. The installed command is still the short form: `ugraph`.
|
|
58
|
+
|
|
59
|
+
```bash
|
|
60
|
+
# Recommended: isolated command-line install
|
|
61
|
+
uv tool install ugraph-kit
|
|
62
|
+
|
|
63
|
+
# Or with pipx
|
|
64
|
+
pipx install ugraph-kit
|
|
65
|
+
```
|
|
66
|
+
|
|
67
|
+
To use Anthropic or OpenAI synthesis:
|
|
68
|
+
|
|
69
|
+
```bash
|
|
70
|
+
uv tool install "ugraph-kit[api]"
|
|
71
|
+
# pipx install "ugraph-kit[api]" also works
|
|
72
|
+
```
|
|
73
|
+
|
|
74
|
+
Python 3.10+ is required.
|
|
75
|
+
|
|
76
|
+
## First run
|
|
77
|
+
|
|
78
|
+
Create a knowledge folder inside an Obsidian vault (or anywhere on disk):
|
|
79
|
+
|
|
80
|
+
```bash
|
|
81
|
+
ugraph init ~/Documents/MyVault/knowledge
|
|
82
|
+
```
|
|
83
|
+
|
|
84
|
+
That is the whole setup. `init` remembers the folder for this machine, so every
|
|
85
|
+
later session finds it from any directory — no `--kb`, no environment variable:
|
|
86
|
+
|
|
87
|
+
```bash
|
|
88
|
+
cd /anywhere
|
|
89
|
+
ugraph status # works
|
|
90
|
+
```
|
|
91
|
+
|
|
92
|
+
To point at a different knowledge base later:
|
|
93
|
+
|
|
94
|
+
```bash
|
|
95
|
+
ugraph use ~/other/knowledge # remembered from then on
|
|
96
|
+
ugraph use # print the current one
|
|
97
|
+
```
|
|
98
|
+
|
|
99
|
+
Anything that describes the current invocation still wins over the remembered
|
|
100
|
+
default, in this order: `--kb` → `UGRAPH_KB` → the nearest `ugraph.toml` → standing
|
|
101
|
+
inside a knowledge base → the remembered one.
|
|
102
|
+
|
|
103
|
+
Copy some text and run:
|
|
104
|
+
|
|
105
|
+
```bash
|
|
106
|
+
ugraph
|
|
107
|
+
```
|
|
108
|
+
|
|
109
|
+
On macOS and supported Linux desktops, ugraph reads the clipboard. Otherwise it
|
|
110
|
+
prompts for a paste terminated by Ctrl+D. Piped input is always supported:
|
|
111
|
+
|
|
112
|
+
```bash
|
|
113
|
+
printf 'Hybrid retrieval combines lexical and semantic search.' | ugraph
|
|
114
|
+
```
|
|
115
|
+
|
|
116
|
+
## Add a person
|
|
117
|
+
|
|
118
|
+
Copy a profile or talk URL (or paste a bio) and run `ugraph`. It previews the
|
|
119
|
+
detected identity and asks before writing.
|
|
120
|
+
|
|
121
|
+
The explicit, scriptable form is:
|
|
122
|
+
|
|
123
|
+
```bash
|
|
124
|
+
ugraph person "https://example.com/about"
|
|
125
|
+
ugraph person "https://example.com/about" --yes
|
|
126
|
+
```
|
|
127
|
+
|
|
128
|
+
This creates:
|
|
129
|
+
|
|
130
|
+
- `entities/people/<name>.md` — the canonical, minimally verified person page
|
|
131
|
+
- `resources/people/<name>.md` — a compatibility redirect for existing vaults
|
|
132
|
+
|
|
133
|
+
Repeating the command does not duplicate the person or overwrite
|
|
134
|
+
human-authored canonical content.
|
|
135
|
+
|
|
136
|
+
## Model setup
|
|
137
|
+
|
|
138
|
+
Capture and person resolution do not require an LLM. Synthesis is optional:
|
|
139
|
+
|
|
140
|
+
```bash
|
|
141
|
+
ugraph auth set anthropic
|
|
142
|
+
ugraph auth use anthropic
|
|
143
|
+
|
|
144
|
+
# or
|
|
145
|
+
ugraph auth set openai
|
|
146
|
+
ugraph auth use openai
|
|
147
|
+
|
|
148
|
+
# or a running local Ollama installation
|
|
149
|
+
ugraph auth use ollama
|
|
150
|
+
```
|
|
151
|
+
|
|
152
|
+
Check the active configuration with `ugraph auth status`.
|
|
153
|
+
|
|
154
|
+
### Tuning the model
|
|
155
|
+
|
|
156
|
+
Everything about the model is configuration, not code. In `ugraph.toml`:
|
|
157
|
+
|
|
158
|
+
```toml
|
|
159
|
+
[extract]
|
|
160
|
+
model = "claude-opus-5" # any model, including ones released after this version
|
|
161
|
+
```
|
|
162
|
+
|
|
163
|
+
**A model ID selects its own backend.** `claude-*` goes to Anthropic, `gpt-*`/`o*` to
|
|
164
|
+
OpenAI, and anything else is treated as a local Ollama model — so a model released
|
|
165
|
+
tomorrow works without a code change or an entry in a list. Set `backend` explicitly
|
|
166
|
+
only to override that:
|
|
167
|
+
|
|
168
|
+
```toml
|
|
169
|
+
[extract]
|
|
170
|
+
backend = "api" # api | ollama | claude-code
|
|
171
|
+
```
|
|
172
|
+
|
|
173
|
+
Naming a model whose provider you have no key for is refused by name rather than
|
|
174
|
+
silently sent to the other provider.
|
|
175
|
+
|
|
176
|
+
Token budgets are **discovered, not hardcoded**. ugraph asks your provider what the
|
|
177
|
+
model accepts and caches the answer for a day, so switching models needs no code
|
|
178
|
+
change and no setting. Override only if you want a tighter ceiling than the model's:
|
|
179
|
+
|
|
180
|
+
```toml
|
|
181
|
+
[extract]
|
|
182
|
+
max_tokens = 48000 # optional — omit to use the model's own maximum
|
|
183
|
+
thinking = "adaptive" # optional — adaptive | disabled (Anthropic)
|
|
184
|
+
effort = "medium" # optional — low | medium | high | xhigh | max (Anthropic)
|
|
185
|
+
temperature = 0.1 # optional — omitted by default
|
|
186
|
+
```
|
|
187
|
+
|
|
188
|
+
Every one of these is unset by default, which means "whatever the provider does". If
|
|
189
|
+
the provider cannot be reached to report its limits, the budget is derived from the
|
|
190
|
+
size of the prompt rather than guessed.
|
|
191
|
+
|
|
192
|
+
## Other commands
|
|
193
|
+
|
|
194
|
+
```bash
|
|
195
|
+
ugraph --kb ./knowledge ingest file ./note.md
|
|
196
|
+
printf 'a claim you care about' | ugraph --kb ./knowledge --yes
|
|
197
|
+
ugraph ps
|
|
198
|
+
ugraph logs
|
|
199
|
+
ugraph lint
|
|
200
|
+
ugraph verify
|
|
201
|
+
```
|
|
202
|
+
|
|
203
|
+
`--kb` is a global option and therefore comes before the subcommand.
|
|
204
|
+
Alternatively set `UGRAPH_KB` once or run inside a configured knowledge base.
|
|
205
|
+
|
|
206
|
+
## Reliability contract
|
|
207
|
+
|
|
208
|
+
The current test suite enforces:
|
|
209
|
+
|
|
210
|
+
1. Re-ingesting the same document creates no duplicates.
|
|
211
|
+
2. Editing a document updates only affected chunks.
|
|
212
|
+
3. Interrupting ingestion and rerunning completes cleanly.
|
|
213
|
+
4. Model quotes must occur verbatim in their source chunk.
|
|
214
|
+
5. Person capture is idempotent and preserves existing human content.
|
|
215
|
+
|
|
216
|
+
Operational events are appended to `runs.jsonl` and exposed through
|
|
217
|
+
`ugraph ps` and `ugraph logs`.
|
|
218
|
+
|
|
219
|
+
## Source
|
|
220
|
+
|
|
221
|
+
Canonical repo (Tekvo open source): https://github.com/tekvo-ai/app_ugraph_kit
|
|
222
|
+
|
|
223
|
+
This is the Tekvo AI open-source home for ugraph.
|
|
224
|
+
Site: https://ugraph.build
|
|
225
|
+
|
|
226
|
+
## Development
|
|
227
|
+
|
|
228
|
+
```bash
|
|
229
|
+
git clone https://github.com/tekvo-ai/app_ugraph_kit.git
|
|
230
|
+
cd app_ugraph_kit
|
|
231
|
+
uv sync --extra dev
|
|
232
|
+
uv run pytest
|
|
233
|
+
uv build
|
|
234
|
+
```
|
|
235
|
+
|
|
236
|
+
Project artifacts:
|
|
237
|
+
|
|
238
|
+
- `docs/PRODUCT.md` — **product home**: goal, features, roadmap, public product log
|
|
239
|
+
- `CLAIMS.md` — claims backed by tests, ADRs, or measured runs
|
|
240
|
+
- `docs/adr/` — architecture decision records
|
|
241
|
+
- `docs/techniques/` — just-in-time technique scans
|
|
242
|
+
- `docs/releasing.md` — PyPI publish steps
|
|
243
|
+
- `CONTRIBUTING.md` — dev setup and the checks CI runs
|
|
244
|
+
- `CHANGELOG.md` — what changed, per release
|
|
245
|
+
- `eval/` — evaluation harness work
|
|
246
|
+
- `corpus/manifest.json` — loaded real-world data
|
|
247
|
+
|
|
248
|
+
Licensed under Apache-2.0.
|
|
@@ -0,0 +1,209 @@
|
|
|
1
|
+
# ugraph
|
|
2
|
+
|
|
3
|
+
[](https://github.com/tekvo-ai/app_ugraph_kit/actions/workflows/ci.yml)
|
|
4
|
+
[](https://pypi.org/project/ugraph-kit/)
|
|
5
|
+
[](LICENSE)
|
|
6
|
+
|
|
7
|
+
Turn any CLI input — clipboard, paste, pipe, file, or URL — into a
|
|
8
|
+
filesystem-native knowledge base that Obsidian and agents can read. Raw sources
|
|
9
|
+
remain inspectable, chunk IDs are content-addressed, and extracted quotes are
|
|
10
|
+
checked against source text before they become candidates.
|
|
11
|
+
|
|
12
|
+
> **Alpha:** the ingestion foundation is usable; retrieval and the evaluation
|
|
13
|
+
> harness are still under active development.
|
|
14
|
+
|
|
15
|
+
## Install
|
|
16
|
+
|
|
17
|
+
The distribution is named `ugraph-kit` because `ugraph` is already taken on
|
|
18
|
+
PyPI. The installed command is still the short form: `ugraph`.
|
|
19
|
+
|
|
20
|
+
```bash
|
|
21
|
+
# Recommended: isolated command-line install
|
|
22
|
+
uv tool install ugraph-kit
|
|
23
|
+
|
|
24
|
+
# Or with pipx
|
|
25
|
+
pipx install ugraph-kit
|
|
26
|
+
```
|
|
27
|
+
|
|
28
|
+
To use Anthropic or OpenAI synthesis:
|
|
29
|
+
|
|
30
|
+
```bash
|
|
31
|
+
uv tool install "ugraph-kit[api]"
|
|
32
|
+
# pipx install "ugraph-kit[api]" also works
|
|
33
|
+
```
|
|
34
|
+
|
|
35
|
+
Python 3.10+ is required.
|
|
36
|
+
|
|
37
|
+
## First run
|
|
38
|
+
|
|
39
|
+
Create a knowledge folder inside an Obsidian vault (or anywhere on disk):
|
|
40
|
+
|
|
41
|
+
```bash
|
|
42
|
+
ugraph init ~/Documents/MyVault/knowledge
|
|
43
|
+
```
|
|
44
|
+
|
|
45
|
+
That is the whole setup. `init` remembers the folder for this machine, so every
|
|
46
|
+
later session finds it from any directory — no `--kb`, no environment variable:
|
|
47
|
+
|
|
48
|
+
```bash
|
|
49
|
+
cd /anywhere
|
|
50
|
+
ugraph status # works
|
|
51
|
+
```
|
|
52
|
+
|
|
53
|
+
To point at a different knowledge base later:
|
|
54
|
+
|
|
55
|
+
```bash
|
|
56
|
+
ugraph use ~/other/knowledge # remembered from then on
|
|
57
|
+
ugraph use # print the current one
|
|
58
|
+
```
|
|
59
|
+
|
|
60
|
+
Anything that describes the current invocation still wins over the remembered
|
|
61
|
+
default, in this order: `--kb` → `UGRAPH_KB` → the nearest `ugraph.toml` → standing
|
|
62
|
+
inside a knowledge base → the remembered one.
|
|
63
|
+
|
|
64
|
+
Copy some text and run:
|
|
65
|
+
|
|
66
|
+
```bash
|
|
67
|
+
ugraph
|
|
68
|
+
```
|
|
69
|
+
|
|
70
|
+
On macOS and supported Linux desktops, ugraph reads the clipboard. Otherwise it
|
|
71
|
+
prompts for a paste terminated by Ctrl+D. Piped input is always supported:
|
|
72
|
+
|
|
73
|
+
```bash
|
|
74
|
+
printf 'Hybrid retrieval combines lexical and semantic search.' | ugraph
|
|
75
|
+
```
|
|
76
|
+
|
|
77
|
+
## Add a person
|
|
78
|
+
|
|
79
|
+
Copy a profile or talk URL (or paste a bio) and run `ugraph`. It previews the
|
|
80
|
+
detected identity and asks before writing.
|
|
81
|
+
|
|
82
|
+
The explicit, scriptable form is:
|
|
83
|
+
|
|
84
|
+
```bash
|
|
85
|
+
ugraph person "https://example.com/about"
|
|
86
|
+
ugraph person "https://example.com/about" --yes
|
|
87
|
+
```
|
|
88
|
+
|
|
89
|
+
This creates:
|
|
90
|
+
|
|
91
|
+
- `entities/people/<name>.md` — the canonical, minimally verified person page
|
|
92
|
+
- `resources/people/<name>.md` — a compatibility redirect for existing vaults
|
|
93
|
+
|
|
94
|
+
Repeating the command does not duplicate the person or overwrite
|
|
95
|
+
human-authored canonical content.
|
|
96
|
+
|
|
97
|
+
## Model setup
|
|
98
|
+
|
|
99
|
+
Capture and person resolution do not require an LLM. Synthesis is optional:
|
|
100
|
+
|
|
101
|
+
```bash
|
|
102
|
+
ugraph auth set anthropic
|
|
103
|
+
ugraph auth use anthropic
|
|
104
|
+
|
|
105
|
+
# or
|
|
106
|
+
ugraph auth set openai
|
|
107
|
+
ugraph auth use openai
|
|
108
|
+
|
|
109
|
+
# or a running local Ollama installation
|
|
110
|
+
ugraph auth use ollama
|
|
111
|
+
```
|
|
112
|
+
|
|
113
|
+
Check the active configuration with `ugraph auth status`.
|
|
114
|
+
|
|
115
|
+
### Tuning the model
|
|
116
|
+
|
|
117
|
+
Everything about the model is configuration, not code. In `ugraph.toml`:
|
|
118
|
+
|
|
119
|
+
```toml
|
|
120
|
+
[extract]
|
|
121
|
+
model = "claude-opus-5" # any model, including ones released after this version
|
|
122
|
+
```
|
|
123
|
+
|
|
124
|
+
**A model ID selects its own backend.** `claude-*` goes to Anthropic, `gpt-*`/`o*` to
|
|
125
|
+
OpenAI, and anything else is treated as a local Ollama model — so a model released
|
|
126
|
+
tomorrow works without a code change or an entry in a list. Set `backend` explicitly
|
|
127
|
+
only to override that:
|
|
128
|
+
|
|
129
|
+
```toml
|
|
130
|
+
[extract]
|
|
131
|
+
backend = "api" # api | ollama | claude-code
|
|
132
|
+
```
|
|
133
|
+
|
|
134
|
+
Naming a model whose provider you have no key for is refused by name rather than
|
|
135
|
+
silently sent to the other provider.
|
|
136
|
+
|
|
137
|
+
Token budgets are **discovered, not hardcoded**. ugraph asks your provider what the
|
|
138
|
+
model accepts and caches the answer for a day, so switching models needs no code
|
|
139
|
+
change and no setting. Override only if you want a tighter ceiling than the model's:
|
|
140
|
+
|
|
141
|
+
```toml
|
|
142
|
+
[extract]
|
|
143
|
+
max_tokens = 48000 # optional — omit to use the model's own maximum
|
|
144
|
+
thinking = "adaptive" # optional — adaptive | disabled (Anthropic)
|
|
145
|
+
effort = "medium" # optional — low | medium | high | xhigh | max (Anthropic)
|
|
146
|
+
temperature = 0.1 # optional — omitted by default
|
|
147
|
+
```
|
|
148
|
+
|
|
149
|
+
Every one of these is unset by default, which means "whatever the provider does". If
|
|
150
|
+
the provider cannot be reached to report its limits, the budget is derived from the
|
|
151
|
+
size of the prompt rather than guessed.
|
|
152
|
+
|
|
153
|
+
## Other commands
|
|
154
|
+
|
|
155
|
+
```bash
|
|
156
|
+
ugraph --kb ./knowledge ingest file ./note.md
|
|
157
|
+
printf 'a claim you care about' | ugraph --kb ./knowledge --yes
|
|
158
|
+
ugraph ps
|
|
159
|
+
ugraph logs
|
|
160
|
+
ugraph lint
|
|
161
|
+
ugraph verify
|
|
162
|
+
```
|
|
163
|
+
|
|
164
|
+
`--kb` is a global option and therefore comes before the subcommand.
|
|
165
|
+
Alternatively set `UGRAPH_KB` once or run inside a configured knowledge base.
|
|
166
|
+
|
|
167
|
+
## Reliability contract
|
|
168
|
+
|
|
169
|
+
The current test suite enforces:
|
|
170
|
+
|
|
171
|
+
1. Re-ingesting the same document creates no duplicates.
|
|
172
|
+
2. Editing a document updates only affected chunks.
|
|
173
|
+
3. Interrupting ingestion and rerunning completes cleanly.
|
|
174
|
+
4. Model quotes must occur verbatim in their source chunk.
|
|
175
|
+
5. Person capture is idempotent and preserves existing human content.
|
|
176
|
+
|
|
177
|
+
Operational events are appended to `runs.jsonl` and exposed through
|
|
178
|
+
`ugraph ps` and `ugraph logs`.
|
|
179
|
+
|
|
180
|
+
## Source
|
|
181
|
+
|
|
182
|
+
Canonical repo (Tekvo open source): https://github.com/tekvo-ai/app_ugraph_kit
|
|
183
|
+
|
|
184
|
+
This is the Tekvo AI open-source home for ugraph.
|
|
185
|
+
Site: https://ugraph.build
|
|
186
|
+
|
|
187
|
+
## Development
|
|
188
|
+
|
|
189
|
+
```bash
|
|
190
|
+
git clone https://github.com/tekvo-ai/app_ugraph_kit.git
|
|
191
|
+
cd app_ugraph_kit
|
|
192
|
+
uv sync --extra dev
|
|
193
|
+
uv run pytest
|
|
194
|
+
uv build
|
|
195
|
+
```
|
|
196
|
+
|
|
197
|
+
Project artifacts:
|
|
198
|
+
|
|
199
|
+
- `docs/PRODUCT.md` — **product home**: goal, features, roadmap, public product log
|
|
200
|
+
- `CLAIMS.md` — claims backed by tests, ADRs, or measured runs
|
|
201
|
+
- `docs/adr/` — architecture decision records
|
|
202
|
+
- `docs/techniques/` — just-in-time technique scans
|
|
203
|
+
- `docs/releasing.md` — PyPI publish steps
|
|
204
|
+
- `CONTRIBUTING.md` — dev setup and the checks CI runs
|
|
205
|
+
- `CHANGELOG.md` — what changed, per release
|
|
206
|
+
- `eval/` — evaluation harness work
|
|
207
|
+
- `corpus/manifest.json` — loaded real-world data
|
|
208
|
+
|
|
209
|
+
Licensed under Apache-2.0.
|