Main Page

From Public AI Wiki
Revision as of 06:26, 26 December 2025 by Publicai admin (talk | contribs)

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

  1. Structured Data: Information is stored using MediaWiki's Cargo extension, making it queryable like a database
  2. MCP Server: A FastMCP server reads from this wiki and exposes the data as tools that AI assistants can use
  3. 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:
  • 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

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:

  1. Browse the tools above and find one with has_resources=true
  2. Create a page: Resource:ToolName/YourLocation
  3. Use the Template:ToolResource template
  4. Fill in your local data (phone numbers, websites, etc.)
  5. 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:

  1. Create a page: Tool:YourToolName
  2. Use the Template:Tool template
  3. Set has_resources=true if you'll add location-specific data
  4. Add your first resources (see option #1 above)
  5. 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:

  1. Fork the repository
  2. Add your @mcp.tool() function to main.py
  3. Test locally
  4. 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:

  1. Navigate to Special:CargoTables
  2. Find the relevant table (Tools or ToolResources)
  3. Click "Recreate" to update the database
  4. 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?

Examples to Learn From

Good Wiki Tools:

Good Resources to Study: