Skip to main content
Notion’s built-in AI keyword-searches. It returns the document you asked about and stops. It can’t tell you why a decision was made, who influenced it, or whether it’s been superseded by something newer. HydraDB is different. It doesn’t just store vectors - it builds a living context graph. Every memory is parsed, enriched, and connected to other memories. When your agent calls POST /recall/full_recall, it doesn’t just get semantically similar chunks. It gets the most useful context for that exact query - weighted by recency, relevance, relationships, and historical usage patterns.
All code in this cookbook is real. Base URL is https://api.hydradb.com. Get your API key at app.hydradb.com.

Prerequisites

Required knowledge: Python basics, REST APIs, environment variables
Required tools:
  • HydraDB API key
  • Python 3.11 or 3.12 (python --version)
  • pip install hydradb-sdk

What You’ll Build

By the end of this cookbook, you’ll be able to:
  • Ingest Notion pages, Confluence docs, and Slack threads into a unified HydraDB workspace
  • Answer “why did we decide X?” by retrieving decision context across linked documents
  • Batch-upload documents with verified indexing before any recall query
  • Build a conversational interface grounded in your team’s actual knowledge

How HydraDB Works

Before writing code, understand the three primitives you’ll use throughout this cookbook:
  • Tenant - your workspace. All data is isolated per tenant. Think of it as your “company” in HydraDB. Create one per application.
  • Memory - any unit of context: a Notion page, a Confluence doc, a Slack thread, a user preference. HydraDB automatically chunks, embeds, and connects memories into a context graph.
  • Recall - the retrieval call your agent makes before acting. HydraDB’s recall runs a multi-stage pipeline: metadata filtering → graph traversal → semantic retrieval → personalized ranking.
LongMemEvals recall accuracy: 90%

Comparison: Traditional RAG vs HydraDB Recall


Step 01 - Create a Tenant

Every HydraDB workspace starts with a tenant. Create one for your knowledge base - it provides complete data isolation and multi-tenant support out of the box. Endpoint: POST /tenants/create - Create your workspace

Bash

Python

Sub-tenants for teams: Use sub_tenant_id to isolate data by department. Engineering, Sales, HR each get their own namespace within your tenant - no configuration needed, just pass the ID on upload.

Step 02 - Upload Knowledge Memories

HydraDB automatically parses, chunks, embeds, and connects your content into a context graph. You don’t manage embeddings or vector indexes. You just upload.

Notion Connector

Fetch pages from Notion, format them into HydraDB’s app source structure, and batch upload. HydraDB builds the context graph automatically - no edge creation needed.
Batch limit: Max 20 sources per request. Wait 1 second between batches to respect rate limits.

Confluence Connector

Confluence pages follow the same typed app-source format. Use kind: "knowledge_base", provider: "confluence", and the Confluence page ID as external_id so Recall can use page IDs and hierarchy safely.

Verify Indexing

After uploading, always verify that HydraDB has fully processed and indexed your content before running recall queries. Endpoint: POST /ingestion/verify_processing?file_ids=FILE_ID&tenant_id=TENANT - Check indexing status

Step 03 - Add User Memories

Beyond documents, HydraDB stores user memories - preferences, habits, and patterns that personalize recall per user. Set infer: true to let HydraDB extract implicit signals from text. Set infer: false to store facts verbatim. Endpoint: POST /memories/add_memory - Add a user memory

Bash

Python

After a few interactions, HydraDB builds a behavioral model per user. Alice’s recall results will be ranked and formatted differently from Bob’s - automatically, without any extra code.

Step 04 - Recall Context

This is the call your agent makes before answering any question. POST /recall/full_recall runs HydraDB’s full multi-stage pipeline and returns ranked, contextually relevant chunks - including graph context showing relationships between entities. Endpoint: POST /recall/full_recall - Retrieve agent context

Step 05 - Recall and Answer Generation

For conversational, AI-generated answers, first retrieve context with POST /recall/full_recall. Then pass the returned chunks and sources into your application-layer LLM prompt. Key parameters: alpha (0-1, balance semantic vs lexical), recency_bias (0-1, prefer newer content), and graph_context. Endpoint: POST /recall/full_recall - retrieved context for app-layer answer generation
Maintaining conversation context: Store chat history in your application and include relevant prior turns in your LLM prompt. HydraDB returns retrieval context; your app owns the final answer and conversation state.

Step 06 - Slack Interface

Expose your knowledge base as a Slack bot. When a user mentions @wiki, the bot calls ask_workspace() to retrieve context, then your application can pass that context to an LLM for the final Slack response.

API Reference

All endpoints used in this cookbook. Base URL: https://api.hydradb.com. Header: Authorization: Bearer YOUR_API_KEY

Tenant management

POST /tenants/create - Create workspace - idempotent

Upload app sources (Notion, Slack, Confluence…)

POST /ingestion/upload_knowledge - Max 20/call, 1s between batches

Upload a single file (PDF / DOCX)

POST /ingestion/upload_knowledge - Single file with tenant_id as form field

Verify processing

POST /ingestion/verify_processing?file_ids=FILE_ID&tenant_id=YOUR_TENANT - Poll until status = “completed”

Full recall

POST /recall/full_recall - Searches knowledge base - returns chunks + graph_context

Recall for answer generation

POST /recall/full_recall - retrieved context for app-layer answer generation

Add user memory

POST /memories/add_memory - memories[] array wrapper - consistent SDK format

Recall user memories

POST /recall/recall_preferences - user_name key - consistent across all calls

Delete memory

DELETE /memories/delete_memory - Remove stale or incorrect data by memory_id

Benchmarks

HydraDB leads LongMemEvals with 90% recall accuracy. Compared to a naive RAG pipeline over the same 12,400-document corpus:
Benchmark methodology. Figures are based on internal HydraDB testing. For the formal benchmark paper see research.hydradb.com/hydradb.pdf. Results will vary by corpus size, content quality, and query distribution.