Main Page
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?[edit | edit source]
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[edit | edit source]
- 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[edit | edit source]
- 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[edit | edit source]
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[edit | edit source]
| 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 | No |
Recent Resources[edit | edit source]
| Resource | country | tool |
|---|---|---|
| Resource:SuicideHotline/Singapore | Singapore | Tool:SuicideHotline |
| Resource:SuicideHotline/Switzerland | Switzerland | Tool:SuicideHotline |
How to Contribute[edit | edit source]
Choose your contribution pathway based on what you want to do:
1️⃣ Improve a Wiki Tool[edit | edit source]
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[edit | edit source]
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[edit | edit source]
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[edit | edit source]
| 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[edit | edit source]
Adding a Wiki Tool Resource[edit | edit source]
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[edit | edit source]
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[edit | edit source]
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[edit | edit source]
Quality Standards[edit | edit source]
- 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[edit | edit source]
✅ 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[edit | edit source]
For Developers[edit | edit source]
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[edit | edit source]
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[edit | edit source]
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?[edit | edit source]
- Wiki editing: Tool Template | Resource Template
- Cargo tables: Manage Tables
- Questions: Open an issue in the repository
Examples to Learn From[edit | edit source]
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