One graph database holds both what every Ally knows and how everything connects — and Pinecone retires.
Most AI apps answer with vector search: embed the text, find the most similar passages, hand them to the model. That is good at “find text that looks like this,” but it is blind to the things you have said Kiduna is about — who owns a fact, who it is about, how it connects, and who may see it.
Your design is full of those statements: “all allies have the same context about Jeya,” “node types such as member, ally, and Duna,” knowledge that is “public, private, or secret.” Those are relationship and permission claims. A graph expresses them natively; a vector index cannot.
Consolidate knowledge into the graph (Apache AGE on Postgres), keep fast semantic search by moving vectors into the same database (pgvector), and retire Pinecone.
Everything in Kiduna is a node; every meaningful relationship is an edge. One model carries both the organization and its knowledge — so an Ally can reason across people, orgs, and facts in a single traversal.
It spans six layers — identity/wallet, the Ally and its skills, community & access, social & commerce, governance, and the knowledge content itself — all projected from your three databases, joined by wallet. The full node-and-edge catalog is in the appendix.
Each Ally is an NFT. At registration, Kiduna mints an NFT identity for the Ally into the owner’s wallet. In the graph that is one node — NFT — that links the Ally to the Wallet holding it. It delivers two things you called for: traceability (every action an Ally takes is attributable to a token on-chain — “if the ally has an address … we can trace”) and portable ownership (transfer the token, transfer the Ally).
NFT node between Ally and Wallet.When a user — or an Ally, on command — adds knowledge (an upload, a Google Doc/Drive connection, or a “research X and build me a knowledge base” instruction), it flows through one pipeline and lands in the graph:
Dropping Pinecone does not mean dropping similarity search. It moves into the same Postgres via pgvector, so vectors sit next to the graph. A single query can then filter by relationship, then rank by similarity — impossible when the vectors live in a separate system.
Every question runs the same loop. The step that makes the Ally understand the situation rather than just retrieve text is Traverse — walking the graph out from the passages it found.
This is the part to get exactly right. Your rule — “my ally also sees what Jeya says, but it won’t take instructions from Jeya — just context that it stores — and all allies have the same context about Jeya” — falls straight out of the graph: context is shared, authority is not.
Concretely, every knowledge base and chunk carries one of three scopes, and every read is checked against the Ally that is asking:
Four rules make those scopes actually hold — this is where permission is enforced, not merely described:
SCOPED_TO edge. Every read is anchored to the caller and only walks edges they are allowed — an off-limits chunk is never traversed, not “fetched then hidden.”| You said (meeting / whiteboard) | The architecture answer |
|---|---|
| “Users interact exclusively through natural language” | The Ally reasons over the graph; chat is the only interface — no menus. |
| “Node types such as member, ally, and Duna” | Those are the graph’s core nodes (§02). |
| “Update the graph database to include these tasks/actions” | Skills, Tools and Actions are nodes; the action inventory lives in the same graph. |
| Knowledge is “public, private, or secret” | A SCOPED_TO edge, enforced during retrieval (§03, §06). |
| “All allies have the same context about Jeya” | Shared read over one graph; authority gated by ownership (§06). |
| “Create a knowledge base about X … do research” | The ingestion pipeline the Ally drives on command (§03). |
| A single per-person Ally | One Ally node per person, reasoning over the shared graph (§02, §05). |
| Traceability (the Ally-NFT idea) | Every write is a provenance-linked node/edge (§01, §05). |
No big-bang cutover. Each phase leaves the system fully working, and Pinecone is only removed once pgvector matches it on recall.
The graph is a projection of your three databases (joined by wallet), organized in six layers — about 27 node types and 46 edge types. Postgres stays the system of record; the graph is rebuildable from scratch.
The Wallet is the hub. The whole wallet section — balance, deposits, withdrawals, rewards, and history — anchors on the Wallet node.
Wallet; rewards fan out up the lineage tree as Reward nodes (EARNED); deposits, withdrawals and transfers are recorded as transaction nodes — all anchored on the one Wallet.kiduna_kb). Left column names the layer and the database it is projected from; chips are representative node types — the full list is below.| Layer | Nodes | Key edges | From |
|---|---|---|---|
| Identity · wallet · rewards | Wallet (holds balance) · User · Reward · Ally NFT · OnchainAccount · OnchainTx | IDENTIFIED_BY · REFERRED_BY · EARNED · HELD_BY · RECORDED | kinship-backend |
| Agent — the Ally | Agent (Ally / Presence / Worker) · KnowledgeBase · Prompt · Skill · SkillTemplate · Tool · GlobalToolAccount | OWNED_BY · USES_KB · HAS_SKILL · USES_PROMPT · REPORTS_TO · MINTED_AS | kinship-agent-be |
| Community & access | Context · NestedContext · ContextRole · Code | MEMBER_OF · GRANTS_ACCESS_TO · SCOPED_TO · REDEEMED · PART_OF | kinship-agent-be |
| Social & commerce | Alliance · Bot · Offering · Purchase | TEAM_MEMBER · INSIDE · OF_OFFERING · CAME_FROM | kinship-backend |
| Governance · forums | Market (Forum) · Objective · Dimension · Operator · Elector · Proposal | IN_MARKET · IS_AGENT · PRODUCED · TRADED · VOTED · SPONSORED_BY | kinship-shared |
| Content | Document · Chunk · Entity | HAS_DOCUMENT · HAS_CHUNK · NEXT · MENTIONS · RELATED_TO | KB text (LLM) |
owner_wallet · visibility {public · private · secret} · access_level {PUBLIC · PRIVATE · ADMIN · CREATOR} · kb_id / market_id / context_id. No node exists without a scope — that is what the permission model (§6) enforces.
Live today vs. planned. The structural, content and lineage layers are built; a few nodes are planned extensions that slot into the same model without changing it — OnchainAccount / OnchainTx (wallet accounts & on-chain history), Subscription (commerce), Conversation (agent), Post / Chat (social), Launch (governance), Visitor (identity).