Graph db
Use when building or querying a lightweight CogDB graph layer for agentic research, planning, provenance, citations, blockers, or markdown-derived relationship indexes.From its SKILL.md
npx -y skills add xlyk/agent-skills --skill graph-dbAssembled from the repository path, not quoted from the project. Check it against their README if it does not work.
2 things to look at
- no licenseNo license file was found in the repository. Code published without one is not open source by default, so using it at work is a question for whoever answers licensing questions where you are.
- 2 stars2 stars. Stars are a popularity signal and not a quality one, but at this level it is likely that nobody has read this closely except its author, and you would be relying on your own review.
What its file declares
Copied from the file, not written here
The file declares its own license as MIT. That is the author’s claim about this one file, and it is not the same thing as the license GitHub reports for the repository, which is listed with the other numbers below.
SKILL.md
3.8 KB, 890 tokens by cl100k_base, as published. Nobody here has run it
Graph DB
Overview
Use CogDB as a derived graph index over durable notes/data. It is useful for agent planning and research because it makes relationships queryable without replacing the canonical archive.
Best stack:
Markdown / JSONL / SQLite = canonical archive
CogDB = relationship traversal layer
When to Use
Use for:
- claim/source/provenance graphs
- task blockers and plan dependencies
- citation/literature maps
- entity/topic/source relationships
- markdown-derived wikilink/tag indexes
- lightweight local graph prototypes for agents
Do not use for:
- the only source of truth
- production transactional storage
- concurrent multi-writer agent memory
- full-text search or vector ANN search
- data that needs mature backups, replication, ACLs, or operations tooling
Setup
python3 -m pip install cogdb==3.8.2
Always configure a durable path. CogDB defaults under /tmp; these scripts default to ./.agent-state, so pass --state-dir for project-specific state.
from cog.torque import Graph
from cog.config import CogConfig
cfg = CogConfig(COG_HOME="cogdb", COG_PATH_PREFIX="/path/to/project/.agent-state")
g = Graph("research", config=cfg)
Good Edge Shapes
claim_x --supported_by--> source_y
task_a --blocked_by--> task_b
goal_g --requires--> task_t
paper_a --cites--> paper_b
note_n --mentions--> entity_e
answer_a --derived_from--> source_s
Query Patterns
# blockers
g.v("task:write-report").out("blocked_by").all()
# provenance
g.v("claim:graph-useful").out("supported_by").all()
# context expansion
g.v("goal:evaluate-cog").bfs(direction="out", max_depth=2).all()
# reverse lookup
g.v("source:README").inc("supported_by").all()
Rules
- Keep source text/data canonical elsewhere; write graph edges as an index.
- Use stable IDs:
note:path-slug,source:url-sha,claim:slug,task:slug. - Prefer JSON/JSONL script output so agents can parse it reliably.
- Use one-shot traversal chains starting with
v();Graphkeeps mutable traversal state. - Do not share one mutable
Graphobject across concurrent writers. - Avoid exposing
g.serve()to untrusted users; remote query execution uses restrictedeval(). - Prefer SQLite/Postgres/NoSQL for transactions, concurrent writes, full-text search, backups, and production durability.
Example Scripts
Linked scripts:
scripts/research_graph_demo.py— seed/query a claim-task-source graph; emits JSON.scripts/markdown_link_index.py— index markdown wikilinks and tags into CogDB; supports--dry-runand emits JSON.
Run:
python scripts/research_graph_demo.py --state-dir /tmp/cogdb-demo-state
mkdir -p /tmp/cogdb-vault
printf '# A\n\nLinks to [[B]] and #research.\n' > /tmp/cogdb-vault/A.md
printf '# B\n' > /tmp/cogdb-vault/B.md
python scripts/markdown_link_index.py /tmp/cogdb-vault --state-dir /tmp/cogdb-demo-state --dry-run
python scripts/markdown_link_index.py /tmp/cogdb-vault --state-dir /tmp/cogdb-demo-state
Expected output shape:
{"graph": "notes", "notes_indexed": 2, "edges": 3}
Verification Checklist
-
python3 -m pip install cogdb==3.8.2succeeds in the active environment. -
research_graph_demo.pyemits valid JSON with requirements/blockers/provenance keys. -
markdown_link_index.py --dry-runemits valid JSON triples without writing. - Persistent uses pass a non-
/tmp--state-dir.
What ships with it: 2 files
5.3 KB alongside SKILL.md, 2 of them executable
scripts/
- markdown_link_index.pyruns3.6 KB
- research_graph_demo.pyruns1.7 KB