
A knowledge graph-based wiki for Texas municipal information, powered by GraphRAG and implementing the Texas Ontology Protocol (TOP)
Explore the docs »
View Demo
·
Report Bug
·
Request Feature
Table of Contents
Fort Worth Wiki provides citizens with intelligent access to Fort Worth municipal information through state-of-the-art Knowledge Graph Retrieval-Augmented Generation (GraphRAG). This project introduces the Texas Ontology Protocol (TOP), a standardized framework for modeling Texas municipal and county government structures in knowledge graphs.
- Temporal Knowledge Graph: Bi-temporal data model tracking both event occurrence and data recording times
- Texas-Specific Ontology: Models home-rule cities, council-manager government, and Texas Local Government Code structures
- GraphRAG-Powered Search: Combines graph traversal with LLM-based retrieval for intelligent query responses
- AI Research Agents: Autonomous agents using Agno framework with OpenAI for live data collection
- Live Data Synchronization: Scheduled updates from official Fort Worth sources
- Interactive Web Client: Modern UI with graph visualization and chat interface
- Entity Resolution: Automatic deduplication using embeddings and similarity search
- Open Source Protocol: TOP provides a reusable standard for any Texas municipality
To get a local copy up and running follow these simple steps.
- Python 3.13+
- Docker (for FalkorDB)
- uv (recommended for Python package management)
curl -LsSf https://astral.sh/uv/install.sh | sh
-
Clone the repo
git clone https://github.com/FWTX-DAO/fwtx-wiki-engine.git cd fwtx-wiki-engine
-
Install Python dependencies
uv sync
-
Set up environment variables
cp .env.example .env
Edit
.env
and add your:OPENAI_API_KEY
(required for embeddings/LLM)- Optional:
OPENAI_MODEL
(defaults to gpt-4o-mini),OPENAI_API_BASE
for custom endpoints - Optional: API authentication key, PostgreSQL settings
-
Start FalkorDB
docker run -p 6379:6379 -p 3000:3000 -it --rm falkordb/falkordb:latest
-
Initialize the knowledge graph (first time only)
# Option 1: Load TOP-compliant base data (recommended) uv run init_top_data.py # Option 2: Reset database and load all data uv run reset_and_init.py
This will:
- Build graph indices following Texas Ontology Protocol (TOP)
- Create complete Fort Worth government structure
- Process data from
data/
directory (JSON, PDFs, Markdown) - Extract entities: City, Mayor, Council Members, Departments
- Create relationships: governance, representation, administration
- Optionally fetch live data using AI research agents
-
Run the application
uv run wiki.py
-
Access the web interface Open your browser to http://localhost:8001
To enable automated data synchronization:
# Add to your .env file
ENABLE_SYNC_SCHEDULER=true
SYNC_INTERVAL_HOURS=24 # How often to sync data
The Fort Worth Wiki includes a modern web client interface accessible at http://localhost:8001
Features:
- Knowledge Graph Visualization: Interactive graph view using Cytoscape.js
- AI-Powered Chat: Natural language queries with suggested questions
- Real-time Updates: Live connection status and graph refresh
- Export Functionality: Download graph data for analysis
# Chat with the knowledge graph (GraphRAG)
POST /chat
{
"message": "Who is the current mayor of Fort Worth?"
}
# Trigger AI research on a specific topic
POST /api/research/topic
{
"topic": "city budget",
"data_requirements": ["total_budget", "department_allocations"]
}
# Manual data synchronization
POST /api/sync/trigger
# Get sync status
GET /api/sync/status
- "What are the requirements for a home-rule city in Texas?"
- "Show me the city council districts and their representatives"
- "When are the next municipal elections?"
- "What ordinances were passed in the last month?"
- "How does Fort Worth's government structure work?"
For more examples, please refer to the API Documentation
The Texas Ontology Protocol (TOP) is a comprehensive standard for modeling Texas municipal and county government structures in knowledge graphs. It provides:
- Standardized entity types for Texas government structures (home-rule cities, council-manager form, etc.)
- Temporal modeling patterns for tracking political terms, elections, and legislative changes
- Spatial relationships for districts, precincts, and annexations
- Interoperability with W3C standards (ORG, FOAF, GeoSPARQL, OWL-Time)
See artifacts/TOP.md for the complete specification.
- Define Texas Ontology Protocol (TOP)
- Implement temporal knowledge graph with FalkorDB
- Complete chat API implementation with GraphRAG
- Add AI agent system for live data research
- Implement GraphRAG query engine with Graphiti
- Create citizen-friendly web interface
- Add automated data synchronization with scheduler
- Extend to support multiple Texas municipalities
- Add more data sources (county, state integration)
- Implement real-time event streaming
See the open issues for a full list of proposed features (and known issues).
Contributions are what make the open source community such an amazing place to learn, inspire, and create. Any contributions you make are greatly appreciated.
If you have a suggestion that would make this better, please fork the repo and create a pull request. You can also simply open an issue with the tag "enhancement". Don't forget to give the project a star! Thanks again!
- Fork the Project
- Create your Feature Branch (
git checkout -b feature-texas-cyber-awesomeness
) - Commit your Changes (
git commit -m 'Add sure-texas-cyber-awesomeness'
) - Push to the Branch (
git push origin feature-texas-cyber-awesomeness
) - Open a Pull Request
- Implementing additional Texas municipality ontologies
- Enhancing the GraphRAG query engine
- Adding more data sources and ingestion pipelines
- Improving entity resolution algorithms
- Creating visualization tools for the knowledge graph
Distributed under the MIT License. See LICENSE.txt
for more information.
FWTX DAO - @FWTXDAO - [email protected]
Project Link: https://github.com/FWTX-DAO/fwtx-wiki-engine
- Graphiti Core - Temporal knowledge graph framework
- FalkorDB - High-performance graph database
- City of Fort Worth - Municipal data and documentation
- Texas Municipal League - Texas government structure resources