The German government provides a portal for tracking the legislative progress of laws at dip.bundestag.de, but its presentation is not very user-friendly.
By fetching the government's data via their API, this project aims to provide:
- A more user-friendly presentation of legislative progress.
- Additional features, such as:
- Displaying the remaining legislative steps required for a law to take effect.
- Integrating news articles / news summaries about a law's progress.
- Answering questions about laws via retrieval-augmented generation (RAG).
- Thin controllers that handle HTTP requests and responses
- Routes: Autocomplete search, law display, and AI chat interface
- Focus: User interface and request/response handling only
- Automated data updates triggered by GitHub Actions cronjob
- Law synchronization: Fetches new/updated laws from government API
- Document processing: Converts PDFs to markdown, fixes broken links to specific pages
- News integration: Generates search queries, collects and summarizes relevant news articles
- Search indexing: Maintains Elasticsearch index for law search functionality
- Law parsing: Interprets legislative steps and determines remaining requirements
- AI services: Helper functions for querying LLMs for different types of data
- Search functionality: Elasticsearch-powered law search and autocomplete
- Configuration: Consolidated app setup, database, and service configuration
- Database models: SQLAlchemy models and database utilities
- Elasticsearch: Search client setup and index management
- Logging: Centralized customized logging functionality across all modules
- Vanilla HTML/CSS/JS: Basic but functional user interface
- Timeline visualization: Interactive display of legislative progress
- Real-time chat: Basic AI chat interface with streaming via SSE
- Minor (= re-factoring) or major (= integrating agentic framework) rewrite of the AI-associated functionality.
- Ensure thread-safety throughout entire codebase.
- Retrieve the true result count for each law from google news and factor that in in the autocomplete route (users more likely to search for laws with lots of press coverage).
- Try vectorizing the markdown-converted Dokumente and only retrieving relevant sections when generating answers in the chat route.
- Try to refine get_news() by first retrieving titles of similar-sounding laws, then making sure the LLM is not erroneously processing news articles pertaining to those laws.
- Try to come up with intuitive aliases for laws with unintuitive titles, possibly use those in autocomplete route.
- Implement factory function / config class
- Calculate statistics (e.g., average time for a law to move through legislative steps).
- Highlight if a law is significantly behind/ahead of schedule. Possibly use web search/AI to suggest reasons why.
- Visualize success statistics:
- What percentage of laws pass, and who proposed them?
- Analyze based on governing party, Bundestag/Bundesrat strength at the time.
- Possibly add a small, horizontal timeline up top that reflects the duration of the legislative steps for the current law, as compared to the average.
- Maybe create / replace current DIP-abstracts with AI-generated ones.
- Improve overall visual presentation, move more of the associated data-processing into the front-end.
- Webapp: Flask Server hosted on Heroku
- Database: PostgreSQL db hosted on Supabase
- Search: Elasticsearch cluster hosted on Bonsaisearch
- Automation: GitHub Actions for daily data updates
- AI Services: Integration with various models through OpenRouter