Building an Agent¶
Give an AI assistant its own knowledge and instructions, then make it available to the people and tools that should use it. The setup happens in the portal — creating memories, the agent and its App can't be done by asking an AI tool over MCP — and after that, you and your AI tools use the agent by asking.
What you'll put together:
- Memories hold the knowledge.
- The agent bundles memories with a system prompt.
- An App is an installed copy of the agent: the thing people and tools connect to.
Before you start¶
- A Hadron account (hadronmemory.com) and an organization (one is created when you sign up).
Step 1: Create a memory¶
A memory is a collection of knowledge — the container for your nodes.
- Open Memories in the sidebar and click + Add memory.
- Fill in:
- Name — e.g. "Engineering Knowledge".
- URN — the memory's permanent address; it suggests one from the name.
- Memory kind — Organization knowledge for something your team shares, or Personal / Private for yours alone.
- Visibility — for organization knowledge: Organization or Public.
- Click Add memory.
Adding knowledge¶
- Ask your AI tool. Once it's connected (Step 4), an agent can add and update notes for you — see Working through an agent.
- In the portal — open the memory's ⋯ menu and choose Add node; see Adding nodes to a memory.
- Git sync — point the memory at a GitHub repo, and nodes are kept as YAML and Markdown files; see Sync a memory with Git.
Structured data on nodes¶
Any node can carry structured JSON in its data field:
Edit it on the node's Data tab in the portal, or have your agent set it
(hadron_update_node_data merges keys; hadron_update_node with data
replaces the whole object).
Template variables¶
Node content can include Mustache templates:
Variables resolve from the node's data, a default data node at the memory
root, or other nodes' data (e.g. {{settings.theme}}). For the full
resolution rules, partials, escaping, and missing-variable behavior, see
Mustache template syntax.
Step 2: Create an agent¶
- Open Agents in the sidebar and click New Agent. (For a chatbot with its conversations scaffolded, use New Chatbot instead — see Getting started.)
- Fill in:
- Name — e.g. "Engineering Agent".
- URN — suggested from the name.
- Description — what the agent is for.
- System Prompt — instructions for the model, e.g. "You are a helpful engineering assistant. Always check the knowledge graph before answering."
- Visibility — Personal (the default), Organization or Public.
- Click Create Agent.
Add memories to the agent¶
On the agent's page, open the Memories tab:
- Choose a memory in the Select a memory dialog.
- Choose access: Read or Read/Write.
- Click Add.
An agent can have several memories — read-only knowledge plus a writable memory for what it learns.
System memory (for chatbot agents)¶
If your agent uses conversation designs (stages and prompts), choose its Agent system memory — the memory holding those conversation nodes — in the agent's Settings. It can't be changed once set. An agent with a system memory gets a Chatbot Control tab.
File uploads¶
There is no per-agent upload setting. Once the agent is installed in an App and has a memory attached with read-write access, users can attach files in the App's agent chat; the agent itself doesn't request them. See Upload a file in an agent chat.
Step 3: Install the agent as an App¶
An App is what people and tools connect to: an installed copy of the agent in your organization, with its own members and keys. Every App is created by installing an agent.
- Open Agents in the sidebar, find your agent and click Install on its row (it's on the agent's page too).
- The form suggests:
- App name — the agent's name.
- URN —
<your-org-urn>:<agent-slug>; a second install of the same agent gets-2, then-3. - App type — Workstation (for coding agents; the default), Chatbot, Agent, Automation, Cloud or IoT. Choose Chatbot if people will chat with the agent in the portal: other types have no working agent chat, and a Chatbot App has no Client tab.
- Click Install. You land on the new App.
The install also licenses the agent to your organization and — depending on the agent's install policy — makes you the App's first owner.
AI configuration¶
The install doesn't ask for an LLM provider. The App uses the AI configuration its agent or organization provides; to give this App its own, use Settings → AI providers on the App. See Configure your LLM provider.
Step 4: Connect your AI tool¶
Connect the AI tool you work in to Hadron once, and it can reach the memories you have access to. Its searches cover the memories of the App it's working in, once one is set; ask it to search all your memories when you want everything.
- Claude Desktop — Install Hadron in Claude Desktop
- Claude Code — Install in Claude Code
- Cursor, VS Code, OpenCode — Cursor, VS Code, OpenCode
Those pages use sign-in in the browser, with no key to copy.
Setup files from the App¶
If you'd rather configure a tool with an App key, open the App's Client
tab (on Apps that aren't Chatbots): give the key a Name, tick the tools
under Include plugins, and click Download setup files (.zip). Your
tool then talks to Hadron directly over HTTP with the key. (If you see a
Client mode choice, keep Direct: the other mode needs
hadron-client, which is retired for now.) Extract it into your project.
What's inside depends on the tools you chose: MCP configuration for each
tool, and a .hadron/ folder with instructions and settings.
Custom applications (GraphQL API)¶
For your own app — a web or mobile client, or a server integration — call the GraphQL API directly with an App key:
POST https://srv.hadronmemory.com/graphql
Authorization: Bearer your-key-here
Content-Type: application/json
Step 5: Use it¶
Ask your AI tool about what the agent knows, in plain language:
In the Engineering Knowledge memory, what do we say about how releases are
tagged? Quote the note you're relying on.
It searches the memory, reads the relevant notes and answers from them — and with write access, it can add or update notes when you ask. See Working through an agent for how to ask, and what to check.
- Coding agents can work in a structured session that records what they did — see Guided sessions.
- Chatbots are driven through the Chat API:
startChat, then one model turn with no user message — the welcome turn — sent toprocessChatResponse; after that,sendChatMessageandprocessChatResponsefor each user turn. There's no MCP route for a chatbot chat. See the Chat API reference.
Node types¶
Every node has a nodeType. Use the right one for your content:
| Type | Use for |
|---|---|
info |
Knowledge, specs, guides (default) |
abstract |
Summaries, TL;DRs — searched first |
reference |
External sources (papers, URLs, legislation) |
record |
Chat messages, session logs — searchable like info |
system |
Conversation designs, prompts — hidden from search |
For full semantics, search behavior, and guidance on the close calls
(info vs. abstract, info vs. reference), see the
Node types reference.
Related¶
- Entity architecture — how organizations, agents, memories and Apps relate, which is the model this recipe assembles.