summaryrefslogtreecommitdiff
path: root/src/mcp/tools/common/memory_index.h
diff options
context:
space:
mode:
Diffstat (limited to 'src/mcp/tools/common/memory_index.h')
-rw-r--r--src/mcp/tools/common/memory_index.h24
1 files changed, 24 insertions, 0 deletions
diff --git a/src/mcp/tools/common/memory_index.h b/src/mcp/tools/common/memory_index.h
new file mode 100644
index 0000000..fbe43a7
--- /dev/null
+++ b/src/mcp/tools/common/memory_index.h
@@ -0,0 +1,24 @@
+#ifndef TINY_CONVMEM_MCP_TOOLS_MEMORY_INDEX_H
+#define TINY_CONVMEM_MCP_TOOLS_MEMORY_INDEX_H
+
+#include "storage/store.h"
+
+typedef struct tiny_relation_reference
+{
+ size_t source_index;
+ tiny_relation_type_t type;
+} tiny_relation_reference_t;
+
+typedef struct tiny_memory_index tiny_memory_index_t;
+
+tiny_memory_index_t *tiny_memory_index_build(const tiny_store_t *store);
+void tiny_memory_index_free(tiny_memory_index_t *index);
+bool tiny_memory_index_find(const tiny_memory_index_t *index,
+ const char *message_id,
+ size_t *entry_index);
+bool tiny_memory_index_incoming(const tiny_memory_index_t *index,
+ const char *message_id,
+ const tiny_relation_reference_t **references,
+ size_t *count);
+
+#endif