@clidey/dory 0.14.0 → 0.16.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
package/docs/features.mdx CHANGED
@@ -1,217 +1,440 @@
1
1
  ---
2
- title: "Conversational AI: Chatting with Your Documents"
3
- description: "Enable interactive Q&A over your uploaded documents using the Morphik Agent and Console chat. This step-by-step guide shows how to setup, invoke, and optimize conversational workflows for research and support scenarios."
2
+ title: 'Features'
3
+ description: 'Overview of available components and features'
4
4
  ---
5
5
 
6
- # Conversational AI: Chatting with Your Documents
6
+ ## Headings Examples
7
7
 
8
- Enable interactive Q&A over your uploaded documents using the Morphik Agent and Console chat. This step-by-step guide shows you how to set up, invoke, and optimize conversational workflows for research and support scenarios, empowering you to get precise, context-aware answers directly from your document collections.
8
+ ```mdx
9
+ # Heading 1
10
+ ```
11
+ # Heading 1
9
12
 
10
- ---
13
+ ```mdx
14
+ ## Heading 2
15
+ ```
16
+ # Heading 2
11
17
 
12
- ## 1. Introduction
18
+ ```mdx
19
+ ### Heading 3
20
+ ```
21
+ # Heading 3
22
+ ```mdx
23
+ #### Heading 4
24
+ ```
25
+ # Heading 4
26
+ ```mdx
27
+ ##### Heading 5
28
+ ```
29
+ # Heading 5
30
+ ```mdx
31
+ ###### Heading 6
32
+ ```
33
+ # Heading 6
13
34
 
14
- Conversational AI with Morphik lets you transform your document repositories into intelligent, interactive knowledge assistants. By leveraging Morphik's agent framework and chat interface, you can ask natural language questions about your documents and receive accurate, sourced responses combining search, analysis, and knowledge graph insights.
35
+ <br />
15
36
 
16
- This guide focuses specifically on the **chatting experience** — how to activate and use the Morphik Agent alongside the Morphik Console or SDK to carry contextual conversations grounded in your document data.
37
+ ## Lists Examples
17
38
 
18
- ---
39
+ ```mdx
40
+ - List item 1
41
+ - List item 2
42
+ - List item 3
43
+ ```
19
44
 
20
- ## 2. Prerequisites
45
+ - List item 1
46
+ - List item 2
47
+ - List item 3
21
48
 
22
- Before starting, ensure you have:
49
+ ```mdx
50
+ 1. List item 1
51
+ 2. List item 2
52
+ 3. List item 3
53
+ ```
23
54
 
24
- - A running Morphik server instance (hosted or self-hosted).
25
- - Documents uploaded to Morphik via the Console or SDK.
26
- - The Morphik Agent enabled and configured (part of Morphik Core).
27
- - Access to the Morphik Console for interactive chat or access to the Python SDK for programmatic use.
55
+ 1. List item 1
56
+ 2. List item 2
57
+ 3. List item 3
28
58
 
29
- > <Check>
30
- > Make sure your user account has permissions to query documents and knowledge graphs.
31
- >
32
- ---
33
59
 
34
- ## 3. Workflow Overview
35
60
 
36
- ### What You Will Accomplish
61
+ <br />
37
62
 
38
- - Set up Morphik Agent to interpret user queries.
39
- - Use natural language to query documents interactively.
40
- - Receive well-organized answers with clear source attributions.
41
- - Understand how the agent leverages multiple tools for retrieval and analysis.
63
+ ### Images
42
64
 
43
- ### Time Estimate
65
+ ```mdx
66
+ <img src="./assets/dory.jpeg" alt="Example image" className="object-cover w-64 h-64" />
67
+ ```
44
68
 
45
- ~15–30 minutes to get a working chat interface and basic conversational flow.
69
+ <img src="./assets/dory.jpeg" alt="Example image" className="object-cover w-64 h-64" />
46
70
 
47
- ### Difficulty Level
48
71
 
49
- Intermediate — some familiarity with Morphik platform and basic querying.
72
+ <br />
73
+ <br />
74
+ <br />
50
75
 
51
- ---
76
+ ## Code Components
52
77
 
53
- ## 4. Setting Up Conversational AI
78
+ ### Code Block
79
+ ```typescript
80
+ function example() {
81
+ return "Hello World";
82
+ }
83
+ ```
54
84
 
55
- ### Step 1: Confirm Documents Are Ingested
85
+ ### Code Group Block
56
86
 
57
- You must have documents ingested into Morphik.
87
+ <CodeGroup>
88
+ ```typescript
89
+ function example(): string {
90
+ return "Hello World";
91
+ }
92
+ ```
93
+ ```javascript
94
+ function example() {
95
+ return "Hello World";
96
+ }
97
+ ```
98
+ </CodeGroup>
58
99
 
59
- - Use the Console to upload or verify documents.
60
- - Or use the Python SDK `ingest_text()` or `ingest_file()` functions.
61
100
 
62
- ### Step 2: Configure the Morphik Agent
101
+ <br />
102
+ <br />
103
+ <br />
63
104
 
64
- The Morphik Agent acts as the orchestrator between user queries and Morphik's internal tools.
65
105
 
66
- - The agent uses a system prompt describing available tools like chunk retrieval, document analysis, knowledge graph queries, and code execution.
67
- - It converts user input into function calls to relevant Morphik APIs.
106
+ ## Interactive Components
68
107
 
69
- Typical agent setup (embedded in Morphik Core):
108
+ ### Mermaid
70
109
 
71
- ```python
72
- from core.agent import MorphikAgent
110
+ ```mdx
111
+ mermaid
112
+ graph TD
73
113
 
74
- # Assume document_service is your Morphik document API client
75
- agent = MorphikAgent(document_service=document_service, model="gpt-4") # or any supported model
76
- ```
114
+ %% Main Start
115
+ Start([Start Process]) --> Validate[Validate Input]
77
116
 
78
- ### Step 3: Build a Chat Interface
117
+ %% Decision Point
118
+ Validate -->|Valid| ProcessData{Is Data Clean?}
119
+ Validate -->|Invalid| Error[Show Error Message]
79
120
 
80
- You can interact with the agent through several clients:
121
+ %% Clean Data Branch
122
+ ProcessData -->|Yes| Clean[Clean Data]
123
+ Clean --> Analyze[Analyze Data]
81
124
 
82
- - **Morphik Console Chat**: Web-based chat UI within the Morphik Console.
83
- - **Python SDK**: Run queries programmatically by sending conversational history and user queries.
125
+ %% Dirty Data Branch
126
+ ProcessData -->|No| Notify[Notify User]
127
+ Notify --> Wait[Wait for Input]
128
+ Wait --> Validate
84
129
 
85
- Example: Basic agent run call from Python
130
+ %% Parallel Branches After Analysis
131
+ Analyze --> Split1 & Split2
86
132
 
87
- ```python
88
- import asyncio
133
+ subgraph Parallel Tasks
134
+ Split1[Generate Report] --> Merge
135
+ Split2[Update Dashboard] --> Merge
136
+ end
89
137
 
90
- async def chat(agent, user_query):
91
- auth_context = ... # your auth context
92
- response = await agent.run(query=user_query, auth=auth_context)
93
- print(response["response"])
138
+ Merge --> Decision2{Is More Input Needed?}
139
+ Decision2 -->|Yes| WaitMore[Wait for More Input]
140
+ WaitMore --> Validate
141
+ Decision2 -->|No| End([End Process])
142
+
143
+ %% Style and Class Definitions
144
+ classDef decision fill:#f9f,stroke:#333,stroke-width:2px;
145
+ class ProcessData,Decision2 decision;
94
146
 
95
- asyncio.run(chat(agent, "What is reinforcement learning?"))
96
147
  ```
97
148
 
98
- > <Tip>
99
- > The agent requires an authenticated user context (`auth`) to respect data access control.
100
- >
101
- ### Step 4: Execute Conversational Queries
149
+ <strong>
150
+ <p>Note: Mermaid should be inside a code block with type "mermaid"</p>
151
+ </strong>
102
152
 
103
- With the agent configured and interface in place, you can ask questions like:
153
+ ```mermaid
154
+ graph TD
104
155
 
105
- - "Summarize the key points in the document about AI."
106
- - "Show me diagrams related to reinforcement learning."
107
- - "What entities appear in the contract documents?"
156
+ %% Main Start
157
+ Start([Start Process]) --> Validate[Validate Input]
108
158
 
109
- The agent breaks these queries into tool calls behind the scenes and constructs rich, sourced responses.
159
+ %% Decision Point
160
+ Validate -->|Valid| ProcessData{Is Data Clean?}
161
+ Validate -->|Invalid| Error[Show Error Message]
110
162
 
111
- ---
163
+ %% Clean Data Branch
164
+ ProcessData -->|Yes| Clean[Clean Data]
165
+ Clean --> Analyze[Analyze Data]
112
166
 
113
- ## 5. How the Morphik Agent Works Behind the Scenes
167
+ %% Dirty Data Branch
168
+ ProcessData -->|No| Notify[Notify User]
169
+ Notify --> Wait[Wait for Input]
170
+ Wait --> Validate
114
171
 
115
- The Morphik Agent integrates several internal tools to answer user questions effectively:
172
+ %% Parallel Branches After Analysis
173
+ Analyze --> Split1 & Split2
116
174
 
117
- - **`retrieve_chunks`**: Finds the most relevant text and image fragments from indexed documents.
118
- - **`retrieve_document`**: Accesses full documents or metadata by ID.
119
- - **`document_analyzer`**: Extracts entities, facts, sentiment, and summaries.
120
- - **`knowledge_graph_query`**: Navigates entities and relationships in knowledge graphs.
121
- - **Other tools** like code execution and persistent memory saving.
175
+ subgraph Parallel Tasks
176
+ Split1[Generate Report] --> Merge
177
+ Split2[Update Dashboard] --> Merge
178
+ end
122
179
 
123
- The agent dynamically decides which APIs to invoke based on the query context.
180
+ Merge --> Decision2{Is More Input Needed?}
181
+ Decision2 -->|Yes| WaitMore[Wait for More Input]
182
+ WaitMore --> Validate
183
+ Decision2 -->|No| End([End Process])
124
184
 
125
- ---
185
+ %% Style and Class Definitions
186
+ classDef decision fill:#f9f,stroke:#333,stroke-width:2px;
187
+ class ProcessData,Decision2 decision;
126
188
 
127
- ## 6. Best Practices & Tips
189
+ ```
128
190
 
129
- - **Scope Your Queries**: Use filters like folder name or user ID to limit results and speed up responses.
130
- - **Use Multi-Turn Conversations**: Provide context from earlier messages to get more precise answers.
131
- - **Attribute Your Sources**: The agent returns source references for transparent answers.
132
- - **Monitor Token Limits**: Be mindful of model token constraints; truncate or segment documents if needed.
133
- - **Keep Your Documents Up to Date**: Re-ingest changed documents so retrieval returns current info.
191
+ ### Accordion
134
192
 
135
- ---
193
+ ```mdx
194
+ <AccordionGroup>
195
+ <Accordion title="First Section" icon="DocumentIcon">
196
+ This is the content of the first accordion section.
197
+ </Accordion>
198
+ <Accordion title="Second Section" icon="CodeBracketIcon">
199
+ This is the content of the second accordion section.
200
+ </Accordion>
201
+ </AccordionGroup>
202
+ ```
136
203
 
137
- ## 7. Troubleshooting Common Issues
138
-
139
- <AccordionGroup title="Troubleshooting Conversational AI">
140
- <Accordion title="Agent Returns No or Irrelevant Results">
141
- - Verify your documents are indexed and visible to your user.
142
- - Check query filters and ensure they match existing document metadata.
143
- - Increase the number of chunks retrieved to widen the search scope.
144
- </Accordion>
145
- <Accordion title="Agent Fails or Crashes During Execution">
146
- - Confirm your Morphik service is running with adequate resources.
147
- - Check logs for errors related to tool invocation or model loading.
148
- - Validate your authentication token or context is correct.
149
- - Check model supported in your configuration (e.g. GPT-4).
150
- </Accordion>
151
- <Accordion title="Sources or Citations Are Missing in Responses">
152
- - Ensure your documents contain proper metadata with chunks.
153
- - Confirm the agent is using the correct source map.
154
- - Verify that retrieval calls return source IDs.
155
- </Accordion>
204
+ <AccordionGroup>
205
+ <Accordion title="First Section" icon="DocumentIcon">
206
+ This is the content of the first accordion section.
207
+ </Accordion>
208
+ <Accordion title="Second Section" icon="CodeBracketIcon">
209
+ This is the content of the second accordion section.
210
+ </Accordion>
156
211
  </AccordionGroup>
157
212
 
158
- ---
213
+ ### Callouts
159
214
 
160
- ## 8. Example: Interactive Chat with Morphik Console
215
+ ```mdx
216
+ <Note>
217
+ This is a note callout with important information.
218
+ </Note>
219
+ ```
161
220
 
162
- 1. Open the Morphik Console in your browser.
163
- 2. Navigate to the 'Chat' tab.
164
- 3. Enter the query:
221
+ <Note>
222
+ This is a note callout with important information.
223
+ </Note>
165
224
 
166
- ```text
167
- What does the document say about reinforcement learning?
225
+ ```mdx
226
+ <Warning>
227
+ This is a warning callout for critical information.
228
+ </Warning>
168
229
  ```
169
230
 
170
- 4. The chat will return a detailed answer with markdown formatting and source attributions.
171
- 5. Explore linked entities or images directly within the chat where available.
231
+ <Warning>
232
+ This is a warning callout for critical information.
233
+ </Warning>
172
234
 
173
- ---
235
+ ```mdx
236
+ <Info>
237
+ This is an info callout for general information.
238
+ </Info>
239
+ ```
174
240
 
175
- ## 9. Example: Python SDK Conversational Query
241
+ <Info>
242
+ This is an info callout for general information.
243
+ </Info>
176
244
 
177
- ```python
178
- from morphik import Morphik
245
+ ```mdx
246
+ <Tip>
247
+ This is a tip callout for helpful suggestions.
248
+ </Tip>
249
+ ```
179
250
 
180
- morphik = Morphik("morphik://user:token@api.morphik.ai")
251
+ <Tip>
252
+ This is a tip callout for helpful suggestions.
253
+ </Tip>
181
254
 
182
- response = morphik.query("Explain the advantage of Retrieval Augmented Generation.")
183
- print(response.completion)
255
+ ```mdx
256
+ <Check>
257
+ This is a check callout for completed items.
258
+ </Check>
184
259
  ```
185
260
 
186
- This sends a natural language query routed to the Morphik Agent that returns composed answers referencing documents.
261
+ <Check>
262
+ This is a check callout for completed items.
263
+ </Check>
264
+
265
+
266
+ <br />
267
+
268
+ ### Cards
269
+ ```mdx
270
+ <CardGroup cols={2}>
271
+ <Card
272
+ title="Example Card"
273
+ description="This is an example card component with an icon and title."
274
+ icon="FileText"
275
+ href="#"
276
+ />
277
+ <Card
278
+ title="Another Card"
279
+ description="This is another example card with different content."
280
+ icon="Code"
281
+ href="#"
282
+ />
283
+ </CardGroup>
284
+ ```
187
285
 
188
- ---
286
+ <CardGroup cols={2}>
287
+ <Card
288
+ title="Example Card"
289
+ description="This is an example card component with an icon and title."
290
+ icon="FileText"
291
+ href="#"
292
+ />
293
+ <Card
294
+ title="Another Card"
295
+ description="This is another example card with different content."
296
+ icon="Code"
297
+ href="#"
298
+ />
299
+ </CardGroup>
300
+
301
+ <br />
302
+
303
+ ### Expandable
304
+
305
+ ```mdx
306
+ <Expandable title="Click to Expand">
307
+ This is an expandable section that can be toggled.
308
+ </Expandable>
309
+ ```
189
310
 
190
- ## 10. Next Steps & Further Reading
311
+ <Expandable title="Click to Expand">
312
+ This is an expandable section that can be toggled.
313
+ </Expandable>
191
314
 
192
- - Explore [Multimodal Search & Retrieval guide](/guides/core-workflows/multimodal-search) to understand how retrieval integrates with chat.
193
- - Learn about [Building Knowledge Graphs](/guides/knowledge-graphs/build-knowledge-graph) to enhance entity-level understanding.
194
- - Review [Cache-Augmented Generation](/guides/integrations-and-caching/cache-augmentation) to accelerate response times via document caching.
195
- - Deep dive into Morphik Console features in [Using the Morphik Console](/getting-started/first-steps-and-validation/using-the-morphik-console).
196
- - Consult the [Agent code & tools description](/core/agent.py) for advanced customization.
315
+ ### Source
197
316
 
198
- ---
317
+ ```mdx
318
+ <Source url="https://github.com/clidey/dory" paths={[
319
+ { path: "src/mdx/source.tsx", range: "1-46" },
320
+ { path: "docs/features.mdx", range: "318-322" },
321
+ ]} />
322
+ ```
199
323
 
200
- ## 11. Summary
324
+ <Source url="https://github.com/clidey/dory" paths={[
325
+ { path: "src/mdx/source.tsx", range: "1-46" },
326
+ { path: "docs/features.mdx", range: "318-322" },
327
+ ]} />
201
328
 
202
- By following this guide, you will have enabled a robust conversational AI interface backed by Morphik’s multimodal document understanding and knowledge graph capabilities. This conversational workflow transforms your static documents into interactive assistants that can support research, customer support, and knowledge discovery efficiently.
329
+ <br />
330
+ <br />
331
+ <br />
203
332
 
204
- ---
205
333
 
206
- ## References and Links
334
+ ## Special Components
207
335
 
208
- - [Morphik Console Guide](https://morphik.ai/docs/getting-started/first-steps-and-validation/using-the-morphik-console)
209
- - [Morphik Python SDK](https://morphik.ai/docs/sdks/python/README)
210
- - [Multimodal Search Guide](https://morphik.ai/docs/guides/core-workflows/multimodal-search)
211
- - [Knowledge Graph Guide](https://morphik.ai/docs/guides/knowledge-graphs/build-knowledge-graph)
212
- - [Cache Augmented Generation Guide](https://morphik.ai/docs/guides/integrations-and-caching/cache-augmentation)
213
- - [Morphik Agent Source Code](https://github.com/morphik-org/morphik-core/blob/main/core/agent.py)
336
+ ### Grids
214
337
 
215
- <Tip>
216
- Engage with the Morphik Discord community for live support and tips on using conversational AI effectively.
217
- </Tip>
338
+ #### Rows
339
+ ```mdx
340
+ <Row cols={2}>
341
+ <Icon icon="FileText" />
342
+ <Icon icon="CheckCircle" />
343
+ </Row>
344
+ ```
345
+
346
+ <Row cols={2}>
347
+ <Icon icon="FileText" />
348
+ <Icon icon="CheckCircle" />
349
+ </Row>
350
+
351
+ <br />
352
+
353
+ #### Columns
354
+
355
+ ```mdx
356
+ <Col>
357
+ <Icon icon="FileText" />
358
+ <Icon icon="FileText" />
359
+ </Col>
360
+ ```
361
+
362
+ <Col>
363
+ <Icon icon="FileText" />
364
+ <Icon icon="FileText" />
365
+ </Col>
366
+
367
+ <br />
368
+ <br />
369
+ <br />
370
+
371
+ ### Latex
372
+
373
+ ```mdx
374
+ <Latex>
375
+ E = mc^2
376
+ </Latex>
377
+ ```
378
+
379
+ <Latex>
380
+ E = mc^2
381
+ </Latex>
382
+
383
+ <br />
384
+ <br />
385
+ <br />
386
+
387
+ ### Tables
388
+
389
+ ```mdx
390
+ | Property | Description |
391
+ | -------- | ------------------------------------- |
392
+ | Name | Full name of user |
393
+ | Age | Reported age |
394
+ | Joined | Whether the user joined the community |
395
+ ```
396
+
397
+ | Property | Description |
398
+ | -------- | ------------------------------------- |
399
+ | Name | Full name of user |
400
+ | Age | Reported age |
401
+ | Joined | Whether the user joined the community |
402
+
403
+
404
+ ### Steps
405
+
406
+ ```mdx
407
+ <Steps>
408
+ <Step title="First Step">
409
+ This is the first step in the process.
410
+ </Step>
411
+ <Step title="Second Step">
412
+ This is the second step in the process.
413
+ </Step>
414
+ </Steps>
415
+ ```
416
+
417
+ <Steps>
418
+ <Step title="First Step">
419
+ This is the first step in the process.
420
+ </Step>
421
+ <Step title="Second Step">
422
+ This is the second step in the process.
423
+ </Step>
424
+ </Steps>
425
+
426
+ ### Icons
427
+
428
+ ```mdx
429
+ <Col rows={2}>
430
+ <Icon icon="Code" />
431
+ <Icon icon="FileText" />
432
+ <Icon icon="CheckCircle" />
433
+ </Col>
434
+ ```
435
+
436
+ <Row cols={3}>
437
+ <Icon icon="Code" />
438
+ <Icon icon="FileText" />
439
+ <Icon icon="CheckCircle" />
440
+ </Row>
package/k8s/Dockerfile CHANGED
@@ -7,8 +7,7 @@ RUN apk add --no-cache git
7
7
 
8
8
  COPY ./k8s/config/nginx-default.conf /app/k8s/config/nginx-default.conf
9
9
 
10
- # Install dory globally
11
- RUN npm install -g @clidey/dory@latest
10
+ RUN npm install -g @clidey/dory@0.15.0
12
11
  EXPOSE 3000
13
12
 
14
13
  CMD ["dory", "preview"]
package/package.json CHANGED
@@ -1,7 +1,7 @@
1
1
  {
2
2
  "name": "@clidey/dory",
3
3
  "private": false,
4
- "version": "0.14.0",
4
+ "version": "0.16.0",
5
5
  "type": "module",
6
6
  "description": "A CLI tool for building and previewing documentation sites",
7
7
  "keywords": [