Main Page: Difference between revisions
No edit summary |
No edit summary |
||
| Line 17: | Line 17: | ||
* '''Location Services''': Search for places and get geographic information | * '''Location Services''': Search for places and get geographic information | ||
* '''And more...''': Any information that benefits from being current, localized, and structured | * '''And more...''': Any information that benefits from being current, localized, and structured | ||
== Understanding Public AI Tools == | |||
Public AI has two types of tools, each serving different purposes: | |||
{| class="wikitable" style="width: 100%;" | |||
! style="width: 50%;" | Wiki Tools | |||
! style="width: 50%;" | MCP Tools | |||
|- | |||
| '''Data lives in this wiki'''<br/>The MCP server reads and serves wiki content to AI assistants | |||
| '''Code lives in GitHub repository'''<br/>Python functions that integrate with external APIs | |||
|- | |||
| '''Examples:''' | |||
* [[Tool:SuicideHotline]] - Hotline numbers in ToolResources | |||
* [[Tool:UpcomingBTO]] - BTO details in page content | |||
| '''Examples:''' | |||
* Swiss Transit - Calls transport.opendata.ch API | |||
* OSM Nominatim - Searches OpenStreetMap | |||
|- | |||
| '''Who can contribute:''' Anyone (no coding required) | |||
| '''Who can contribute:''' Developers (Python required) | |||
|- | |||
| '''Best for:''' | |||
* Location-specific resources | |||
* Information that changes over time | |||
* Data that needs community verification | |||
| '''Best for:''' | |||
* Real-time API integrations | |||
* Complex data processing | |||
* External service connections | |||
|} | |||
== Browse All Tools == | == Browse All Tools == | ||
| Line 22: | Line 53: | ||
{{#cargo_query: | {{#cargo_query: | ||
tables=Tools | tables=Tools | ||
|fields=_pageName=Tool,description | |fields=_pageName=Tool,description,community,has_resources | ||
|order by=_pageName | |order by=_pageName | ||
|format=table | |format=table | ||
| Line 41: | Line 72: | ||
== How to Contribute == | == How to Contribute == | ||
=== | Choose your contribution pathway based on what you want to do: | ||
=== 1️⃣ Improve a Wiki Tool === | |||
# Create a page | '''Add or update localized data for an existing tool''' | ||
'''Difficulty:''' Easy (no coding required) | |||
'''Perfect for:''' | |||
* Adding suicide hotline numbers for your country | |||
* Updating BTO launch information | |||
* Contributing local crisis resources | |||
* Verifying and updating existing information | |||
'''Quick start:''' | |||
# Browse the tools above and find one with <code>has_resources=true</code> | |||
# Create a page: <code>Resource:ToolName/YourLocation</code> | |||
# Use the [[Template:ToolResource]] template | |||
# Fill in your local data (phone numbers, websites, etc.) | |||
# Save and done! | |||
'''💡 For technically-minded contributors:''' You can set up automations (GitHub Actions, cron jobs) to periodically update wiki data via the MediaWiki API. | |||
---- | |||
=== 2️⃣ Add a New Wiki Tool === | |||
'''Create a new tool where community members can contribute data''' | |||
'''Difficulty:''' Easy to Medium | |||
'''When to use this:''' | |||
* You have location-specific data that communities can maintain | |||
* The information doesn't require API calls | |||
* Multiple people can verify and update the information | |||
'''Quick start:''' | |||
# Create a page: <code>Tool:YourToolName</code> | |||
# Use the [[Template:Tool]] template | # Use the [[Template:Tool]] template | ||
# | # Set <code>has_resources=true</code> if you'll add location-specific data | ||
# Add your first resources (see option #1 above) | |||
# | # The tool is now available to AI assistants! | ||
# | |||
'''Example tools to create:''' | |||
* Public Library Hours (by location) | |||
* Community Event Calendars | |||
* Local Government Service Contact Info | |||
* Emergency Services by Region | |||
---- | |||
''' | === 3️⃣ Add a New MCP Tool === | ||
< | |||
'''Implement a Python tool that integrates with external APIs''' | |||
'''Difficulty:''' Advanced (requires Python/coding) | |||
| | '''When to use this:''' | ||
* You need to call external APIs (weather, transit, etc.) | |||
| | * The tool requires real-time data | ||
* Complex logic or data transformation is needed | |||
</ | |||
'''Quick start:''' | |||
# Fork the [https://github.com/yourusername/pai-mcp-server repository] | |||
# Add your <code>@mcp.tool()</code> function to <code>main.py</code> | |||
# Test locally | |||
# Submit a Pull Request | |||
'''Example tools to create:''' | |||
* Weather API integrations | |||
* Stock market data | |||
* Real-time transit for other countries | |||
* News aggregators | |||
---- | |||
=== Quick Decision Guide === | |||
{| class="wikitable" | |||
! I want to... | |||
! Use this pathway | |||
|- | |||
| Add data for an existing tool | |||
| <span style="font-size: 1.2em;">1️⃣</span> Improve a Wiki Tool | |||
|- | |||
| Create a tool with community-maintainable data | |||
| <span style="font-size: 1.2em;">2️⃣</span> Add a New Wiki Tool | |||
|- | |||
| Build an API integration or complex tool | |||
| <span style="font-size: 1.2em;">3️⃣</span> Add a New MCP Tool | |||
|} | |||
---- | |||
== Detailed Templates & Examples == | |||
=== Adding a Resource | === Adding a Wiki Tool Resource === | ||
Create a page: <code>Resource:ToolName/Location</code> | |||
'''Example:''' | '''Example:''' Adding US suicide hotline | ||
<pre> | <pre> | ||
{{ToolResource | {{ToolResource | ||
| Line 89: | Line 182: | ||
|data_field2_name=Text Service | |data_field2_name=Text Service | ||
|data_field2_value=Text "HELLO" to 741741 (Crisis Text Line) | |data_field2_value=Text "HELLO" to 741741 (Crisis Text Line) | ||
|additional_info=Free and confidential support | |data_field3_name=Online Chat | ||
|last_verified= | |data_field3_value=https://988lifeline.org/chat | ||
|additional_info=Free and confidential support. Services available in English and Spanish. | |||
|last_verified=2025-12-26 | |||
}} | }} | ||
</pre> | </pre> | ||
=== | === Creating a New Wiki Tool === | ||
Create a page: <code>Tool:YourToolName</code> | |||
'''Example:''' Public Library Hours | |||
<pre> | |||
=== | {{Tool | ||
|name=Public Library Hours | |||
|description=Operating hours for public libraries by location | |||
|community=Singapore | |||
|has_resources=true | |||
|overview=Provides current operating hours for public libraries across Singapore, including special hours for holidays and events. | |||
|usage=Query by library name or region to get current hours. | |||
}} | |||
</pre> | |||
Then add resources for each library location. | |||
=== | === Important: Updating Cargo Tables === | ||
After adding or editing wiki tools/resources: | |||
# Navigate to [[Special:CargoTables]] | |||
# Find the relevant table (Tools or ToolResources) | |||
# Click "Recreate" to update the database | |||
# Your changes are now live! | |||
== Guidelines == | == Guidelines == | ||
| Line 138: | Line 227: | ||
=== What Belongs Here === | === What Belongs Here === | ||
✅ '''Good candidates for | ✅ '''Good candidates for Wiki Tools:''' | ||
* Information that changes over time (phone numbers, schedules) | * Information that changes over time (phone numbers, schedules) | ||
* Localized data (country/region-specific resources) | * Localized data (country/region-specific resources) | ||
| Line 149: | Line 238: | ||
* Information that rarely changes and is well-known (e.g., historical facts) | * Information that rarely changes and is well-known (e.g., historical facts) | ||
* Opinion pieces or subjective content | * Opinion pieces or subjective content | ||
== Technical Documentation == | |||
=== For Developers === | |||
This wiki uses: | |||
* '''MediaWiki''': The underlying wiki platform | |||
* '''Cargo Extension''': Structured data storage and querying | |||
* '''FastMCP Server''': Exposes wiki data as MCP tools for AI assistants | |||
'''Repository:''' [https://github.com/yourusername/pai-mcp-server pai-mcp-server] | |||
=== API Access === | |||
Data can be queried via: | |||
* '''MediaWiki API''': Standard MediaWiki API endpoints (<code>https://wiki.publicai.co/w/api.php</code>) | |||
* '''Cargo API''': Special:CargoQuery for structured queries | |||
* '''MCP Server''': FastMCP server provides simplified access for AI assistants | |||
=== Cargo Tables === | |||
View and manage the structured data: | |||
* [[Special:CargoTables|View all Cargo tables]] | |||
* '''Tools''' table: Stores all tool definitions | |||
* '''ToolResources''' table: Stores locale-specific resource data | |||
== Need Help? == | == Need Help? == | ||
* [[Template:Tool| | * '''Wiki editing''': [[Template:Tool|Tool Template]] | [[Template:ToolResource|Resource Template]] | ||
* '''Development''': [https://github.com/yourusername/pai-mcp-server/blob/main/CONTRIBUTING.md Full Contributing Guide] | |||
* [[Special:CargoTables|Manage | * '''Cargo tables''': [[Special:CargoTables|Manage Tables]] | ||
* '''Questions''': Open an issue in the repository | |||
== Examples to Learn From == | |||
'''Good Wiki Tools:''' | |||
* [[Tool:SuicideHotline]] - Clean resource structure with multiple countries | |||
* [[Tool:UpcomingBTO]] - Rich page content that updates regularly | |||
'''Good Resources to Study:''' | |||
* [[Resource:SuicideHotline/Singapore]] - Well-structured with all fields | |||
* [[Resource:SuicideHotline/Switzerland]] - Multiple contact methods | |||
[[Category:Public AI]] | [[Category:Public AI]] | ||
Revision as of 06:25, 26 December 2025
Public AI is a structured knowledge base of tools and resources that AI assistants can access programmatically to help users with real-world tasks.
What is Public AI?
Public AI serves as a bridge between AI assistants (like Claude, ChatGPT, etc.) and real-world information that users need. Instead of AI assistants having outdated or incomplete information, they can query this wiki to get current, accurate, and localized data.
How It Works
- Structured Data: Information is stored using MediaWiki's Cargo extension, making it queryable like a database
- MCP Server: A FastMCP server reads from this wiki and exposes the data as tools that AI assistants can use
- AI Integration: When you ask an AI assistant a question (e.g., "What's the suicide hotline in Singapore?"), it queries this wiki and gives you current information
Use Cases
- Crisis Support: Get current hotline numbers and resources for mental health emergencies
- Transit Information: Real-time public transportation schedules and routes
- Location Services: Search for places and get geographic information
- And more...: Any information that benefits from being current, localized, and structured
Understanding Public AI Tools
Public AI has two types of tools, each serving different purposes:
| Wiki Tools | MCP Tools |
|---|---|
| Data lives in this wiki The MCP server reads and serves wiki content to AI assistants |
Code lives in GitHub repository Python functions that integrate with external APIs |
Examples:
|
Examples:
|
| Who can contribute: Anyone (no coding required) | Who can contribute: Developers (Python required) |
Best for:
|
Best for:
|
Browse All Tools
| Tool | description | community | has resources |
|---|---|---|---|
| Tool:SuicideHotline | International suicide prevention hotlines and crisis support resources | Singapore • Switzerland | Yes |
| Tool:UpcomingBTO | Upcoming Build-To-Order (BTO) public housing launches in Singapore | Singapore | Yes |
| Tool:UpcomingEvents | Community and public events happening in various locations | Singapore | Yes |
Recent Resources
No results
How to Contribute
Choose your contribution pathway based on what you want to do:
1️⃣ Improve a Wiki Tool
Add or update localized data for an existing tool
Difficulty: Easy (no coding required)
Perfect for:
- Adding suicide hotline numbers for your country
- Updating BTO launch information
- Contributing local crisis resources
- Verifying and updating existing information
Quick start:
- Browse the tools above and find one with
has_resources=true - Create a page:
Resource:ToolName/YourLocation - Use the Template:ToolResource template
- Fill in your local data (phone numbers, websites, etc.)
- Save and done!
💡 For technically-minded contributors: You can set up automations (GitHub Actions, cron jobs) to periodically update wiki data via the MediaWiki API.
2️⃣ Add a New Wiki Tool
Create a new tool where community members can contribute data
Difficulty: Easy to Medium
When to use this:
- You have location-specific data that communities can maintain
- The information doesn't require API calls
- Multiple people can verify and update the information
Quick start:
- Create a page:
Tool:YourToolName - Use the Template:Tool template
- Set
has_resources=trueif you'll add location-specific data - Add your first resources (see option #1 above)
- The tool is now available to AI assistants!
Example tools to create:
- Public Library Hours (by location)
- Community Event Calendars
- Local Government Service Contact Info
- Emergency Services by Region
3️⃣ Add a New MCP Tool
Implement a Python tool that integrates with external APIs
Difficulty: Advanced (requires Python/coding)
When to use this:
- You need to call external APIs (weather, transit, etc.)
- The tool requires real-time data
- Complex logic or data transformation is needed
Quick start:
- Fork the repository
- Add your
@mcp.tool()function tomain.py - Test locally
- Submit a Pull Request
Example tools to create:
- Weather API integrations
- Stock market data
- Real-time transit for other countries
- News aggregators
Quick Decision Guide
| I want to... | Use this pathway |
|---|---|
| Add data for an existing tool | 1️⃣ Improve a Wiki Tool |
| Create a tool with community-maintainable data | 2️⃣ Add a New Wiki Tool |
| Build an API integration or complex tool | 3️⃣ Add a New MCP Tool |
Detailed Templates & Examples
Adding a Wiki Tool Resource
Create a page: Resource:ToolName/Location
Example: Adding US suicide hotline
{{ToolResource
|tool=Tool:SuicideHotline
|country=United States
|region=National
|data_field1_name=Phone
|data_field1_value=988 (Suicide & Crisis Lifeline, 24/7)
|data_field2_name=Text Service
|data_field2_value=Text "HELLO" to 741741 (Crisis Text Line)
|data_field3_name=Online Chat
|data_field3_value=https://988lifeline.org/chat
|additional_info=Free and confidential support. Services available in English and Spanish.
|last_verified=2025-12-26
}}
Creating a New Wiki Tool
Create a page: Tool:YourToolName
Example: Public Library Hours
{{Tool
|name=Public Library Hours
|description=Operating hours for public libraries by location
|community=Singapore
|has_resources=true
|overview=Provides current operating hours for public libraries across Singapore, including special hours for holidays and events.
|usage=Query by library name or region to get current hours.
}}
Then add resources for each library location.
Important: Updating Cargo Tables
After adding or editing wiki tools/resources:
- Navigate to Special:CargoTables
- Find the relevant table (Tools or ToolResources)
- Click "Recreate" to update the database
- Your changes are now live!
Guidelines
Quality Standards
- Accuracy: All information must be current and verified
- Verification: Always include a last_verified date
- Completeness: Provide all relevant contact methods (phone, text, online)
- Localization: Information should be specific to the country/region
- Neutrality: Present information objectively without bias
What Belongs Here
✅ Good candidates for Wiki Tools:
- Information that changes over time (phone numbers, schedules)
- Localized data (country/region-specific resources)
- Public services (hotlines, transit, emergency services)
- Data that AI assistants frequently need but may not have current info on
❌ Not appropriate:
- Personal or private information
- Copyrighted content without permission
- Information that rarely changes and is well-known (e.g., historical facts)
- Opinion pieces or subjective content
Technical Documentation
For Developers
This wiki uses:
- MediaWiki: The underlying wiki platform
- Cargo Extension: Structured data storage and querying
- FastMCP Server: Exposes wiki data as MCP tools for AI assistants
Repository: pai-mcp-server
API Access
Data can be queried via:
- MediaWiki API: Standard MediaWiki API endpoints (
https://wiki.publicai.co/w/api.php) - Cargo API: Special:CargoQuery for structured queries
- MCP Server: FastMCP server provides simplified access for AI assistants
Cargo Tables
View and manage the structured data:
- View all Cargo tables
- Tools table: Stores all tool definitions
- ToolResources table: Stores locale-specific resource data
Need Help?
- Wiki editing: Tool Template | Resource Template
- Development: Full Contributing Guide
- Cargo tables: Manage Tables
- Questions: Open an issue in the repository
Examples to Learn From
Good Wiki Tools:
- Tool:SuicideHotline - Clean resource structure with multiple countries
- Tool:UpcomingBTO - Rich page content that updates regularly
Good Resources to Study:
- Resource:SuicideHotline/Singapore - Well-structured with all fields
- Resource:SuicideHotline/Switzerland - Multiple contact methods