Documentation Index
Fetch the complete documentation index at: https://ahvn.top/llms.txt
Use this file to discover all available pages before exploring further.
This workshop builds a complete task tracker. You’ll define entities, route fields across backends, enable semantic search via Vector, attach structured metadata with HyperG’s sub-relational schema, compute derived fields at read time, and expose everything over MCP.
1. Define entities
Every entity has an implicitobject_id: Identifier primary key (max 63 chars). Supply one at write time or HeavenBase generates a deterministic hash.
HyperG is HeavenBase’s hypergraph schema type. It creates a sub-relational table owned by each entity row, where you define the schema as triples with customizable columns — {"slot": "...", "value": "...", "topic": "..."}. On SQL backends this becomes a physical side table with one row per triple; on other backends it is stored as a JSON column. Each main entity row can have many HyperG entries, forming a 1:N relationship that you query by conceptually JOINing the main table with this sub-table.
2. Store fields on backends
By default all fields go tomain (SQLite). Store Vector on a vector backend for semantic search. Add a compute function so embeddings are derived automatically from the description:
main. The workspace stores emb on vec (in-memory vector backend) and topics in a side table on SQL automatically.
3. Add a computed field
Computed fields are evaluated at read time — they are never stored:input field value is passed as a positional argument to the function.
4. Create a workspace and register
main) for structured data and an in-memory vector backend (vec).
5. Write and read tasks
HyperG accepts a list of triples — either dicts or(slot, value, topic) tuples. Each triple becomes one row in the sub-table:
slot column is your custom field key — define any slots your application needs:
entity_id | slot | value | topic |
|---|---|---|---|
| t1 | module | auth | security |
| t1 | assigned | alice | engineering |
| t1 | sprint | sprint-24 | planning |
| t2 | module | ui | frontend |
| t2 | assigned | bob | engineering |
| t2 | sprint | sprint-24 | planning |
6. Batch operations
Insert and retrieve multiple rows at once:7. Query with filters
query returns a QueryBuilder. Chain .where() for filters, .near() for vector search, .select() to narrow fields, and .limit() / .offset() for pagination. HyperG filters scan the sub-table and return main-table rows whose sub-table contains a matching entry.8. Update and delete
ws.delete() accepts a tuple (entity, entity_id), a dict {"entity": ..., "id": ...}, or just the id when unambiguous.9. Define from JSON
Entities can also be created from a dict for dynamic use cases — here aProject entity to group tasks:
10. Serve as MCP
Expose the workspace as an MCP server in one call:http://127.0.0.1:7001/mcp. Connect any MCP client:
- Claude Code
- OpenCode
- VS Code / Copilot
- LM Studio
- OpenClaw
- Codex CLI
- Hermes
The server runs until interrupted. Use
ws.to_mcp_json(name="tasklist-mcp") to print the config without starting the server.
