openapi: 3.1.0 info: # Do not change the title, if the title changes, the import paths will be broken title: Api version: 0.2.0 description: OpenHuman — personal cognitive AI platform with semantic memory, relationships, journaling, and conversation analysis servers: - url: /api description: Base API path tags: - name: health description: Health operations - name: chat description: AI chat conversations - name: memory description: Semantic memory operations - name: relationships description: Relationship profiles and human context - name: journal description: Personal journal and reflection - name: analysis description: Conversation and behavioral analysis - name: home description: Dashboard summary paths: /healthz: get: operationId: healthCheck tags: [health] summary: Health check responses: "200": description: Healthy content: application/json: schema: $ref: "#/components/schemas/HealthStatus" /status: get: operationId: getAppStatus tags: [health] summary: Application status including AI capability flag responses: "200": description: App status content: application/json: schema: $ref: "#/components/schemas/AppStatus" # ─── DASHBOARD ──────────────────────────────────────────────────────────────── /home/summary: get: operationId: getHomeSummary tags: [home] summary: Dashboard summary with activity stats responses: "200": description: Dashboard summary content: application/json: schema: $ref: "#/components/schemas/HomeSummary" # ─── CHAT ───────────────────────────────────────────────────────────────────── /chat/conversations: get: operationId: listConversations tags: [chat] summary: List all conversations responses: "200": description: List of conversations content: application/json: schema: type: array items: $ref: "#/components/schemas/Conversation" post: operationId: createConversation tags: [chat] summary: Create a new conversation requestBody: required: true content: application/json: schema: $ref: "#/components/schemas/ConversationInput" responses: "201": description: Created conversation content: application/json: schema: $ref: "#/components/schemas/Conversation" /chat/conversations/{id}: get: operationId: getConversation tags: [chat] summary: Get conversation with messages parameters: - name: id in: path required: true schema: type: integer responses: "200": description: Conversation with messages content: application/json: schema: $ref: "#/components/schemas/ConversationWithMessages" "404": description: Not found content: application/json: schema: $ref: "#/components/schemas/ErrorEnvelope" delete: operationId: deleteConversation tags: [chat] summary: Delete a conversation parameters: - name: id in: path required: true schema: type: integer responses: "204": description: Deleted "404": description: Not found content: application/json: schema: $ref: "#/components/schemas/ErrorEnvelope" /chat/conversations/{id}/messages: post: operationId: sendMessage tags: [chat] summary: Send a message and receive a streaming response parameters: - name: id in: path required: true schema: type: integer requestBody: required: true content: application/json: schema: $ref: "#/components/schemas/MessageInput" responses: "200": description: SSE stream of assistant text chunks content: text/event-stream: {} # ─── MEMORY ─────────────────────────────────────────────────────────────────── /memory: get: operationId: listMemory tags: [memory] summary: List memory chunks with optional filters parameters: - name: source in: query required: false schema: type: string - name: type in: query required: false schema: type: string - name: limit in: query required: false schema: type: integer responses: "200": description: List of memory chunks content: application/json: schema: type: array items: $ref: "#/components/schemas/MemoryChunk" post: operationId: createMemory tags: [memory] summary: Create a memory chunk manually requestBody: required: true content: application/json: schema: $ref: "#/components/schemas/MemoryInput" responses: "201": description: Created memory chunk content: application/json: schema: $ref: "#/components/schemas/MemoryChunk" /memory/search: get: operationId: searchMemory tags: [memory] summary: Semantic + keyword search of memory parameters: - name: q in: query required: true schema: type: string - name: limit in: query required: false schema: type: integer - name: type in: query required: false schema: type: string responses: "200": description: Matching memory chunks content: application/json: schema: type: array items: $ref: "#/components/schemas/MemoryChunk" /memory/stats: get: operationId: getMemoryStats tags: [memory] summary: Memory statistics by source and type responses: "200": description: Memory stats content: application/json: schema: $ref: "#/components/schemas/MemoryStats" /memory/{id}: delete: operationId: deleteMemory tags: [memory] summary: Delete a memory chunk parameters: - name: id in: path required: true schema: type: integer responses: "204": description: Deleted # ─── RELATIONSHIPS ──────────────────────────────────────────────────────────── /relationships: get: operationId: listRelationships tags: [relationships] summary: List all relationship profiles responses: "200": description: List of relationship profiles content: application/json: schema: type: array items: $ref: "#/components/schemas/Relationship" post: operationId: createRelationship tags: [relationships] summary: Create a relationship profile requestBody: required: true content: application/json: schema: $ref: "#/components/schemas/RelationshipInput" responses: "201": description: Created relationship content: application/json: schema: $ref: "#/components/schemas/Relationship" /relationships/{id}: get: operationId: getRelationship tags: [relationships] summary: Get a relationship profile with full context parameters: - name: id in: path required: true schema: type: integer responses: "200": description: Full relationship profile content: application/json: schema: $ref: "#/components/schemas/RelationshipDetail" "404": description: Not found content: application/json: schema: $ref: "#/components/schemas/ErrorEnvelope" patch: operationId: updateRelationship tags: [relationships] summary: Update a relationship profile parameters: - name: id in: path required: true schema: type: integer requestBody: required: true content: application/json: schema: $ref: "#/components/schemas/RelationshipUpdate" responses: "200": description: Updated relationship content: application/json: schema: $ref: "#/components/schemas/Relationship" delete: operationId: deleteRelationship tags: [relationships] summary: Delete a relationship profile parameters: - name: id in: path required: true schema: type: integer responses: "204": description: Deleted /relationships/{id}/insights: post: operationId: generateRelationshipInsights tags: [relationships] summary: Generate AI insights for a relationship parameters: - name: id in: path required: true schema: type: integer responses: "200": description: Generated insights content: application/json: schema: $ref: "#/components/schemas/RelationshipInsights" /relationships/{id}/notes: post: operationId: addRelationshipNote tags: [relationships] summary: Add a note or observation to a relationship parameters: - name: id in: path required: true schema: type: integer requestBody: required: true content: application/json: schema: $ref: "#/components/schemas/RelationshipNoteInput" responses: "201": description: Note added content: application/json: schema: $ref: "#/components/schemas/RelationshipNote" # ─── JOURNAL ────────────────────────────────────────────────────────────────── /journal: get: operationId: listJournalEntries tags: [journal] summary: List journal entries parameters: - name: limit in: query required: false schema: type: integer - name: mood in: query required: false schema: type: string responses: "200": description: List of journal entries content: application/json: schema: type: array items: $ref: "#/components/schemas/JournalEntry" post: operationId: createJournalEntry tags: [journal] summary: Create a journal entry requestBody: required: true content: application/json: schema: $ref: "#/components/schemas/JournalEntryInput" responses: "201": description: Created journal entry content: application/json: schema: $ref: "#/components/schemas/JournalEntry" /journal/{id}: get: operationId: getJournalEntry tags: [journal] summary: Get a journal entry parameters: - name: id in: path required: true schema: type: integer responses: "200": description: Journal entry content: application/json: schema: $ref: "#/components/schemas/JournalEntry" "404": description: Not found content: application/json: schema: $ref: "#/components/schemas/ErrorEnvelope" patch: operationId: updateJournalEntry tags: [journal] summary: Update a journal entry parameters: - name: id in: path required: true schema: type: integer requestBody: required: true content: application/json: schema: $ref: "#/components/schemas/JournalEntryUpdate" responses: "200": description: Updated journal entry content: application/json: schema: $ref: "#/components/schemas/JournalEntry" delete: operationId: deleteJournalEntry tags: [journal] summary: Delete a journal entry parameters: - name: id in: path required: true schema: type: integer responses: "204": description: Deleted /journal/{id}/reflect: post: operationId: reflectOnJournalEntry tags: [journal] summary: Generate AI reflection on a journal entry parameters: - name: id in: path required: true schema: type: integer responses: "200": description: AI reflection content: application/json: schema: $ref: "#/components/schemas/Reflection" /journal/insights: get: operationId: getJournalInsights tags: [journal] summary: Get pattern insights across recent journal entries responses: "200": description: Aggregated journal insights content: application/json: schema: $ref: "#/components/schemas/JournalInsights" # ─── CONVERSATION ANALYSIS ──────────────────────────────────────────────────── /analysis/conversations: get: operationId: listAnalyzedConversations tags: [analysis] summary: List uploaded conversation analyses responses: "200": description: List of analyzed conversations content: application/json: schema: type: array items: $ref: "#/components/schemas/AnalyzedConversation" post: operationId: analyzeConversation tags: [analysis] summary: Upload and analyze a conversation requestBody: required: true content: application/json: schema: $ref: "#/components/schemas/ConversationAnalysisInput" responses: "201": description: Analysis complete content: application/json: schema: $ref: "#/components/schemas/AnalyzedConversation" /analysis/conversations/{id}: get: operationId: getAnalyzedConversation tags: [analysis] summary: Get a conversation analysis parameters: - name: id in: path required: true schema: type: integer responses: "200": description: Conversation analysis content: application/json: schema: $ref: "#/components/schemas/AnalyzedConversation" "404": description: Not found content: application/json: schema: $ref: "#/components/schemas/ErrorEnvelope" delete: operationId: deleteAnalyzedConversation tags: [analysis] summary: Delete a conversation analysis parameters: - name: id in: path required: true schema: type: integer responses: "204": description: Deleted # ─── COMPONENTS ─────────────────────────────────────────────────────────────── components: schemas: HealthStatus: type: object required: [status] properties: status: type: string ErrorEnvelope: type: object required: [error] properties: error: type: string # ─── HOME ─────────────────────────────────────────────────────────────── HomeSummary: type: object required: [totalConversations, totalMessages, totalMemoryChunks, totalRelationships, totalJournalEntries, recentConversations, recentMemory, recentJournalEntries] properties: totalConversations: type: integer totalMessages: type: integer totalMemoryChunks: type: integer totalRelationships: type: integer totalJournalEntries: type: integer recentConversations: type: array items: $ref: "#/components/schemas/Conversation" recentMemory: type: array items: $ref: "#/components/schemas/MemoryChunk" recentJournalEntries: type: array items: $ref: "#/components/schemas/JournalEntry" # ─── CHAT ─────────────────────────────────────────────────────────────── Conversation: type: object required: [id, title, createdAt] properties: id: type: integer title: type: string createdAt: type: string format: date-time ConversationInput: type: object required: [title] properties: title: type: string ConversationWithMessages: type: object required: [id, title, createdAt, messages] properties: id: type: integer title: type: string createdAt: type: string format: date-time messages: type: array items: $ref: "#/components/schemas/Message" Message: type: object required: [id, conversationId, role, content, createdAt] properties: id: type: integer conversationId: type: integer role: type: string content: type: string createdAt: type: string format: date-time MessageInput: type: object required: [content] properties: content: type: string # ─── MEMORY ───────────────────────────────────────────────────────────── MemoryChunk: type: object required: [id, content, source, memoryType, createdAt] properties: id: type: integer content: type: string source: type: string memoryType: type: string sourceRef: type: ["string", "null"] score: type: ["number", "null"] importanceScore: type: ["number", "null"] emotionalTags: type: ["string", "null"] topicTags: type: ["string", "null"] createdAt: type: string format: date-time MemoryInput: type: object required: [content, source] properties: content: type: string source: type: string memoryType: type: string importanceScore: type: ["number", "null"] emotionalTags: type: ["string", "null"] topicTags: type: ["string", "null"] MemoryStats: type: object required: [total, bySource, byType] properties: total: type: integer bySource: type: array items: $ref: "#/components/schemas/MemorySourceCount" byType: type: array items: $ref: "#/components/schemas/MemoryTypeCount" MemorySourceCount: type: object required: [source, count] properties: source: type: string count: type: integer MemoryTypeCount: type: object required: [memoryType, count] properties: memoryType: type: string count: type: integer # ─── RELATIONSHIPS ─────────────────────────────────────────────────────── Relationship: type: object required: [id, name, relationshipType, createdAt] properties: id: type: integer name: type: string relationshipType: type: string handle: type: ["string", "null"] context: type: ["string", "null"] communicationStyle: type: ["string", "null"] notes: type: ["string", "null"] createdAt: type: string format: date-time updatedAt: type: string format: date-time RelationshipInput: type: object required: [name, relationshipType] properties: name: type: string relationshipType: type: string handle: type: ["string", "null"] context: type: ["string", "null"] communicationStyle: type: ["string", "null"] notes: type: ["string", "null"] RelationshipUpdate: type: object properties: name: type: string relationshipType: type: string handle: type: ["string", "null"] context: type: ["string", "null"] communicationStyle: type: ["string", "null"] notes: type: ["string", "null"] RelationshipDetail: type: object required: [id, name, relationshipType, createdAt, updatedAt, recentNotes] properties: id: type: integer name: type: string relationshipType: type: string handle: type: ["string", "null"] context: type: ["string", "null"] communicationStyle: type: ["string", "null"] notes: type: ["string", "null"] createdAt: type: string format: date-time updatedAt: type: string format: date-time recentNotes: type: array items: $ref: "#/components/schemas/RelationshipNote" RelationshipNote: type: object required: [id, relationshipId, content, noteType, createdAt] properties: id: type: integer relationshipId: type: integer content: type: string noteType: type: string createdAt: type: string format: date-time RelationshipNoteInput: type: object required: [content] properties: content: type: string noteType: type: string RelationshipInsights: type: object required: [relationshipId, insights, communicationPatterns, suggestions, generatedAt] properties: relationshipId: type: integer insights: type: string communicationPatterns: type: string suggestions: type: string generatedAt: type: string format: date-time # ─── JOURNAL ──────────────────────────────────────────────────────────── JournalEntry: type: object required: [id, content, createdAt, updatedAt] properties: id: type: integer title: type: ["string", "null"] content: type: string mood: type: ["string", "null"] moodScore: type: ["integer", "null"] tags: type: ["string", "null"] aiReflection: type: ["string", "null"] createdAt: type: string format: date-time updatedAt: type: string format: date-time JournalEntryInput: type: object required: [content] properties: title: type: ["string", "null"] content: type: string mood: type: ["string", "null"] moodScore: type: ["integer", "null"] tags: type: ["string", "null"] JournalEntryUpdate: type: object properties: title: type: ["string", "null"] content: type: string mood: type: ["string", "null"] moodScore: type: ["integer", "null"] tags: type: ["string", "null"] Reflection: type: object required: [content, patterns, suggestions, generatedAt] properties: content: type: string patterns: type: string suggestions: type: string emotionalTone: type: ["string", "null"] generatedAt: type: string format: date-time AppStatus: type: object required: [aiEnabled, version] properties: aiEnabled: type: boolean version: type: string JournalInsights: type: object required: [totalEntries, averageMoodScore, commonThemes, recurringPatterns, recentTrend] properties: totalEntries: type: integer averageMoodScore: type: ["number", "null"] commonThemes: type: string recurringPatterns: type: string recentTrend: type: string # ─── CONVERSATION ANALYSIS ─────────────────────────────────────────────── AnalyzedConversation: type: object required: [id, title, rawContent, platform, createdAt] properties: id: type: integer title: type: string rawContent: type: string platform: type: ["string", "null"] participantNames: type: ["string", "null"] summary: type: ["string", "null"] emotionalProgression: type: ["string", "null"] toneShifts: type: ["string", "null"] communicationPatterns: type: ["string", "null"] keyInsights: type: ["string", "null"] suggestions: type: ["string", "null"] overallSentiment: type: ["string", "null"] conflictIndicators: type: ["string", "null"] createdAt: type: string format: date-time ConversationAnalysisInput: type: object required: [title, rawContent] properties: title: type: string rawContent: type: string platform: type: ["string", "null"] participantNames: type: ["string", "null"]