Skip to content

Commit 4a78b67

Browse files
committed
Enhance internal documentation guide by adding new sections for GitHub integration, including markdown file syncing and advanced filtering options. Update existing documentation for AI-powered query testing to clarify usage and improve user experience.
1 parent b7ca877 commit 4a78b67

File tree

2 files changed

+120
-156
lines changed

2 files changed

+120
-156
lines changed

docs/guides/all/find-internal-documentation-with-ai.md

Lines changed: 120 additions & 156 deletions
Original file line numberDiff line numberDiff line change
@@ -169,7 +169,8 @@ Let's add some sample internal documentation to demonstrate the AI capabilities:
169169
<Tabs groupId="ingestion-method" queryString defaultValue="ui" values={[
170170
{label: "Port UI", value: "ui"},
171171
{label: "API", value: "api"},
172-
{label: "Webhook", value: "webhook"}
172+
{label: "Webhook", value: "webhook"},
173+
{label: "Integration", value: "integration"}
173174
]}>
174175

175176
<TabItem value="ui">
@@ -187,24 +188,24 @@ Let's add some sample internal documentation to demonstrate the AI capabilities:
187188

188189
```json showLineNumbers
189190
{
190-
"properties": {
191-
"content": "# User Authentication API\n\n## Overview\nThis API handles user authentication and authorization for our platform.\n\n## Endpoints\n\n### POST /auth/login\nAuthenticates a user and returns a JWT token.\n\n**Request Body:**\n```json\n{\n \"email\": \"user@example.com\",\n \"password\": \"password123\"\n}\n```\n\n**Response:**\n```json\n{\n \"token\": \"eyJhbGciOiJIUzI1NiIsInR5cCI6IkpXVCJ9...\",\n \"expires_in\": 3600\n}\n```\n\n### GET /auth/me\nReturns current user information.\n\n**Headers:**\n- `Authorization: Bearer <token>`\n\n**Response:**\n```json\n{\n \"id\": \"user123\",\n \"email\": \"user@example.com\",\n \"name\": \"John Doe\"\n}\n```\n\n## Error Codes\n- `400`: Invalid credentials\n- `401`: Unauthorized\n- `429`: Rate limit exceeded",
192-
"documentType": "API Documentation",
193-
"product": "Authentication Service",
194-
"team": "Backend Engineering",
195-
"owner": "john.doe@company.com",
196-
"lastUpdated": "2024-01-15T10:30:00.000Z",
197-
"version": "2.1.0",
198-
"status": "Approved",
199-
"tags": ["api", "authentication", "jwt", "backend"],
200-
"summary": "Complete API documentation for user authentication endpoints",
201-
"audience": "Engineering",
202-
"priority": "High"
191+
"properties": {
192+
"content": "# User Authentication API\n\n## Overview\nThis API handles user authentication and authorization for our platform.\n\n## Endpoints\n\n### POST /auth/login\nAuthenticates a user and returns a JWT token.\n\n**Request Body:**\n```json\n{\n \"email\": \"user@example.com\",\n \"password\": \"password123\"\n}\n```\n\n**Response:**\n```json\n{\n \"token\": \"eyJhbGciOiJIUzI1NiIsInR5cCI6IkpXVCJ9...\",\n \"expires_in\": 3600\n}\n```\n\n### GET /auth/me\nReturns current user information.\n\n**Headers:**\n- `Authorization: Bearer <token>`\n\n**Response:**\n```json\n{\n \"id\": \"user123\",\n \"email\": \"user@example.com\",\n \"name\": \"John Doe\"\n}\n```\n\n## Error Codes\n- `400`: Invalid credentials\n- `401`: Unauthorized\n- `429`: Rate limit exceeded",
193+
"documentType": "API Documentation",
194+
"product": "Authentication Service",
195+
"team": "Backend Engineering",
196+
"owner": "john.doe@company.com",
197+
"lastUpdated": "2024-01-15T10:30:00.000Z",
198+
"version": "2.1.0",
199+
"status": "Approved",
200+
"tags": ["api", "authentication", "jwt", "backend"],
201+
"summary": "Complete API documentation for user authentication endpoints",
202+
"audience": "Engineering",
203+
"priority": "High"
203204
},
204-
"relations": {},
205-
"icon": "FileText",
206-
"identifier": "auth-api-docs-v2",
207-
"title": "User Authentication API Documentation"
205+
"relations": {},
206+
"icon": "FileText",
207+
"identifier": "auth-api-docs-v2",
208+
"title": "User Authentication API Documentation"
208209
}
209210
```
210211
</details>
@@ -222,24 +223,24 @@ Let's add some sample internal documentation to demonstrate the AI capabilities:
222223

223224
```json showLineNumbers
224225
{
225-
"properties": {
226-
"content": "# Database Connection Issues Troubleshooting\n\n## Common Issues\n\n### Connection Timeout\n**Symptoms:**\n- API requests timing out\n- Database connection errors in logs\n- High response times\n\n**Diagnosis:**\n1. Check database connection pool status\n2. Review connection timeout settings\n3. Monitor database server resources\n\n**Solutions:**\n1. Increase connection pool size\n2. Adjust timeout values\n3. Scale database resources\n\n### Connection Pool Exhaustion\n**Symptoms:**\n- \"No available connections\" errors\n- Application hangs\n- Database locks\n\n**Diagnosis:**\n1. Check active connections\n2. Review connection leak patterns\n3. Analyze connection usage\n\n**Solutions:**\n1. Fix connection leaks in code\n2. Implement connection monitoring\n3. Add connection pool alerts\n\n## Prevention\n- Regular connection pool monitoring\n- Code reviews for connection management\n- Load testing with realistic scenarios",
227-
"documentType": "Troubleshooting",
228-
"product": "Database Infrastructure",
229-
"team": "Platform Engineering",
230-
"owner": "jane.smith@company.com",
231-
"lastUpdated": "2024-01-20T14:15:00.000Z",
232-
"version": "1.3.0",
233-
"status": "Approved",
234-
"tags": ["database", "troubleshooting", "connections", "performance"],
235-
"summary": "Comprehensive guide for diagnosing and resolving database connection issues",
236-
"audience": "Engineering",
237-
"priority": "Critical"
238-
},
239-
"relations": {},
240-
"icon": "FileText",
241-
"identifier": "db-connection-troubleshooting",
242-
"title": "Database Connection Issues Troubleshooting Guide"
226+
"properties": {
227+
"content": "# Database Connection Issues Troubleshooting\n\n## Common Issues\n\n### Connection Timeout\n**Symptoms:**\n- API requests timing out\n- Database connection errors in logs\n- High response times\n\n**Diagnosis:**\n1. Check database connection pool status\n2. Review connection timeout settings\n3. Monitor database server resources\n\n**Solutions:**\n1. Increase connection pool size\n2. Adjust timeout values\n3. Scale database resources\n\n### Connection Pool Exhaustion\n**Symptoms:**\n- \"No available connections\" errors\n- Application hangs\n- Database locks\n\n**Diagnosis:**\n1. Check active connections\n2. Review connection leak patterns\n3. Analyze connection usage\n\n**Solutions:**\n1. Fix connection leaks in code\n2. Implement connection monitoring\n3. Add connection pool alerts\n\n## Prevention\n- Regular connection pool monitoring\n- Code reviews for connection management\n- Load testing with realistic scenarios",
228+
"documentType": "Troubleshooting",
229+
"product": "Database Infrastructure",
230+
"team": "Platform Engineering",
231+
"owner": "jane.smith@company.com",
232+
"lastUpdated": "2024-01-20T14:15:00.000Z",
233+
"version": "1.3.0",
234+
"status": "Approved",
235+
"tags": ["database", "troubleshooting", "connections", "performance"],
236+
"summary": "Comprehensive guide for diagnosing and resolving database connection issues",
237+
"audience": "Engineering",
238+
"priority": "Critical"
239+
},
240+
"relations": {},
241+
"icon": "FileText",
242+
"identifier": "db-connection-troubleshooting",
243+
"title": "Database Connection Issues Troubleshooting Guide"
243244
}
244245
```
245246
</details>
@@ -257,24 +258,24 @@ Let's add some sample internal documentation to demonstrate the AI capabilities:
257258

258259
```json showLineNumbers
259260
{
260-
"properties": {
261-
"content": "# New Developer Onboarding Guide\n\n## Week 1: Environment Setup\n\n### Day 1-2: Development Environment\n1. **Access Setup**\n - Request VPN access\n - Set up development machine\n - Install required tools (Docker, Git, IDE)\n\n2. **Repository Access**\n - Clone main repositories\n - Set up SSH keys\n - Configure Git settings\n\n### Day 3-5: First Project\n1. **Choose Starter Task**\n - Pick from \"good first issue\" list\n - Set up local development environment\n - Make first contribution\n\n## Week 2: Team Integration\n\n### Meetings and Processes\n1. **Team Meetings**\n - Daily standups (9:30 AM)\n - Weekly planning (Monday 2 PM)\n - Retrospectives (Friday 4 PM)\n\n2. **Development Process**\n - Code review process\n - Testing requirements\n - Deployment procedures\n\n## Resources\n- [Internal Wiki](https://wiki.company.com)\n- [API Documentation](/docs/api)\n- [Architecture Overview](/docs/architecture)\n- [Team Slack Channel](#dev-team)",
262-
"documentType": "Onboarding",
263-
"product": "Engineering",
264-
"team": "Engineering",
265-
"owner": "hr@company.com",
266-
"lastUpdated": "2024-01-10T09:00:00.000Z",
267-
"version": "3.0.0",
268-
"status": "Approved",
269-
"tags": ["onboarding", "new-hires", "development", "process"],
270-
"summary": "Complete onboarding guide for new developers joining the engineering team",
271-
"audience": "New Hires",
272-
"priority": "High"
273-
},
274-
"relations": {},
275-
"icon": "FileText",
276-
"identifier": "dev-onboarding-guide",
277-
"title": "New Developer Onboarding Guide"
261+
"properties": {
262+
"content": "# New Developer Onboarding Guide\n\n## Week 1: Environment Setup\n\n### Day 1-2: Development Environment\n1. **Access Setup**\n - Request VPN access\n - Set up development machine\n - Install required tools (Docker, Git, IDE)\n\n2. **Repository Access**\n - Clone main repositories\n - Set up SSH keys\n - Configure Git settings\n\n### Day 3-5: First Project\n1. **Choose Starter Task**\n - Pick from \"good first issue\" list\n - Set up local development environment\n - Make first contribution\n\n## Week 2: Team Integration\n\n### Meetings and Processes\n1. **Team Meetings**\n - Daily standups (9:30 AM)\n - Weekly planning (Monday 2 PM)\n - Retrospectives (Friday 4 PM)\n\n2. **Development Process**\n - Code review process\n - Testing requirements\n - Deployment procedures\n\n## Resources\n- [Internal Wiki](https://wiki.company.com)\n- [API Documentation](/docs/api)\n- [Architecture Overview](/docs/architecture)\n- [Team Slack Channel](#dev-team)",
263+
"documentType": "Onboarding",
264+
"product": "Engineering",
265+
"team": "Engineering",
266+
"owner": "hr@company.com",
267+
"lastUpdated": "2024-01-10T09:00:00.000Z",
268+
"version": "3.0.0",
269+
"status": "Approved",
270+
"tags": ["onboarding", "new-hires", "development", "process"],
271+
"summary": "Complete onboarding guide for new developers joining the engineering team",
272+
"audience": "New Hires",
273+
"priority": "High"
274+
},
275+
"relations": {},
276+
"icon": "FileText",
277+
"identifier": "dev-onboarding-guide",
278+
"title": "New Developer Onboarding Guide"
278279
}
279280
```
280281
</details>
@@ -383,123 +384,86 @@ Set up a webhook to automatically sync documentation from external systems:
383384

384385
</TabItem>
385386

386-
</Tabs>
387-
388-
## Test AI-powered documentation queries
389-
390-
Now let's test the AI capabilities with various types of questions. **Key principle**: Keep questions concise when the context is clear, but add specificity when there's potential for ambiguity.
391-
392-
<h3> Basic document discovery</h3>
393-
394-
**Question**: "What API documentation do we have in our catalog?"
395-
396-
**Expected response**: The AI should list all documents with `documentType: "API Documentation"` and provide summaries.
397-
398-
**Note**: Without "in our catalog", this question is ambiguous - the AI will search Port's own API documentation (docs.getport.io) instead of your cataloged internal docs.
399-
400-
<h3> Ownership and maintenance</h3>
401-
402-
**Question**: "Who owns the authentication API documentation?"
387+
<TabItem value="integration">
403388

404-
**Expected response**: The AI should identify the owner and provide document details.
389+
<h3> GitHub Integration for markdown files</h3>
405390

406-
**Note**: The context of "authentication API documentation" makes it clear you're asking about cataloged docs, not external documentation.
391+
Another popular use case is documentation being markdown files in a GitHub repo.
392+
You can set up a GitHub integration to automatically sync markdown files (excluding README files):
407393

408-
<h3> Time-based queries</h3>
394+
1. Install the [Port GitHub App](https://github.com/apps/getport-io) in your organization.
409395

410-
**Question**: "What documentation was updated in the last month in our catalog?"
396+
2. Go to [data sources](https://app.getport.io/settings/data-sources).
411397

412-
**Expected response**: The AI should filter documents by `lastUpdated` date and show recent changes.
398+
3. Under `Exporters`, click on your GitHub organization.
413399

414-
**Note**: Without "in our catalog", this could be ambiguous - the AI might search Port's documentation instead of your cataloged internal docs.
415-
416-
<h3> Product-specific queries</h3>
417-
418-
**Question**: "Show me all documentation related to the authentication service in our catalog"
419-
420-
**Expected response**: The AI should find documents where `product` contains "authentication" or related tags.
421-
422-
**Note**: Without "in our catalog", this could be ambiguous - the AI might search Port's documentation about authentication instead of your cataloged docs.
423-
424-
<h3> Status and priority queries</h3>
425-
426-
**Question**: "What critical documentation needs review in our catalog?"
427-
428-
**Expected response**: The AI should find documents with `priority: "Critical"` and `status: "Review"`.
429-
430-
**Note**: Without "in our catalog", this could be ambiguous - the AI might search Port's documentation instead of your cataloged internal docs.
431-
432-
## Advanced AI prompt techniques
433-
434-
Here are some effective ways to get the most out of your documentation AI:
435-
436-
<h3> 1. Start concise, add context only when needed:</h3>
437-
438-
**✅ Concise (when context is clear):**
439-
- "Who owns the database docs?" (ownership implies cataloged entities)
440-
- "Show me troubleshooting guides" (in catalog context, this is clear)
441-
- "What's the status of our onboarding docs?" (status implies cataloged entities)
442-
443-
**✅ Add context when ambiguous with Port docs:**
444-
- "What API documentation do we have in our catalog?" (vs Port's API docs)
445-
- "Show me troubleshooting guides in our catalog" (vs Port's troubleshooting docs)
446-
- "What documentation was updated recently in our catalog?" (vs Port's docs)
447-
448-
**❌ Ambiguous (will search Port docs instead):**
449-
- "What API documentation do we have?" (searches docs.getport.io)
450-
- "Show me authentication documentation" (searches Port's auth docs)
451-
- "What's the latest documentation?" (searches Port's docs)
452-
453-
<h3> 2. Use specific keywords when needed</h3>
454-
455-
**❌ Vague queries:**
456-
- "Show me docs"
457-
- "What's available?"
458-
459-
**✅ Specific queries:**
460-
- "Show me all documentation for the authentication service in our catalog"
461-
- "What documentation was updated this week in our catalog?"
462-
- "Find critical documentation that needs review in our catalog"
463-
464-
<h3> 3. Contextual Queries</h3>
465-
466-
Instead of: "Show me the API docs"
467-
Try: "I'm working on integrating user authentication, what API documentation should I reference in our catalog?"
468-
469-
<h3> 4. Comparative Analysis</h3>
470-
471-
"Compare the troubleshooting guides for database and authentication issues in our catalog"
472-
473-
<h3> 5. Gap Analysis</h3>
474-
475-
"What documentation do we have for new developers versus what's missing in our catalog?"
476-
477-
<h3> 6. Maintenance Queries</h3>
400+
4. Add a file mapping to sync markdown files:
401+
402+
<details>
403+
<summary>GitHub integration configuration</summary>
404+
405+
```yaml showLineNumbers
406+
resources:
407+
- kind: file
408+
selector:
409+
query: '.file.name | contains("README") | not'
410+
files:
411+
- path: '**/*.md'
412+
skipParsing: true
413+
port:
414+
entity:
415+
mappings:
416+
identifier: .file.path | split("/") | last | split(".") | first
417+
title: .file.name | split(".") | first | replace("-", " ") | title
418+
blueprint: '"internal_docs"'
419+
properties:
420+
content: .file.content
421+
documentType: .file.path | split("/") | first | title
422+
product: .repo.name
423+
team: .repo.owner.login
424+
owner: .repo.owner.login + "@company.com"
425+
lastUpdated: .file.lastModified
426+
version: .file.sha[0:7]
427+
status: "Approved"
428+
tags:
429+
- (.file.path | split("/") | first | downcase)
430+
- "github"
431+
- "markdown"
432+
summary: .file.content | split("\n") | first | replace("#", "") | strip
433+
audience: "All Teams"
434+
priority: "Medium"
435+
```
436+
437+
:::tip Advanced Filtering
438+
You can customize the `query` field to filter files more specifically:
439+
- `'.file.name | contains("README") | not'` - Exclude README files
440+
- `'.file.path | startswith("docs/")'` - Only sync files from docs/ directory
441+
- `'.file.name | contains("draft") | not'` - Exclude draft files
442+
:::
478443

479-
"Which documents haven't been updated in 6 months and might be outdated in our catalog?"
444+
</details>
480445

481-
<h3> 7. Cross-referencing</h3>
446+
</TabItem>
482447

483-
"Find all documents that reference the authentication service in our catalog"
448+
</Tabs>
484449

485-
<h3> 8. When to add context</h3>
450+
## Test AI-powered documentation queries
486451

487-
**Key rule**: Any question that could be answered by docs.getport.io will be ambiguous and needs "in our catalog" to clarify.
452+
You can toggle the AI assistant on and off by pressing `Ctrl + I` (or `Command + I` on Mac).
488453

489-
**Always add "in our catalog" for:**
490-
- **"API documentation"** - Without this, searches Port's API docs (docs.getport.io)
491-
- **"Authentication docs"** - Without this, searches Port's authentication docs
492-
- **"Troubleshooting guides"** - Without this, searches Port's troubleshooting docs
493-
- **"What documentation..."** - Without this, searches Port's general docs
494-
- **"Show me docs..."** - Without this, searches Port's docs
454+
<img src="/img/guides/port-ai-assistant-interface.png" width="100%" border="1px" />
495455

496-
**Don't need "in our catalog" for:**
497-
- **"Who owns..."** - Ownership implies cataloged entities
498-
- **"What's the status of..."** - Status implies cataloged entities
499-
- **"Which team maintains..."** - Team ownership implies cataloged entities
456+
Try these example queries to test your AI-powered documentation search:
500457

501-
**Rule of thumb**: If Port has documentation on the topic, add "in our catalog" to avoid ambiguity.
458+
- "What API documentation do we have in our catalog?"
459+
- "Who owns the authentication API documentation?"
460+
- "What documentation was updated in the last month in our catalog?"
461+
- "Show me all documentation related to the authentication service in our catalog"
462+
- "What critical documentation needs review in our catalog?"
502463

464+
:::tip AI Response Behavior
465+
Sometimes, the AI might think you want to query Port technical documentation. In that case, you can instruct it to focus on your internal documentation by adding "in our catalog" or "from our internal documentation" to your prompt to clarify that you're asking about your cataloged entities rather than Port's general documentation.
466+
:::
503467

504468
## Conclusion
505469

562 KB
Loading

0 commit comments

Comments
 (0)