Project Story: Open Intelligence Agent - Geopolitical Insights at Your Fingertips

Inspiration

The inspiration for Open Intelligence Agent stemmed from difficulty in gathering reliable of global event data and making sense of it. Existing resources often required specialized knowledge, complex querying languages, and significant time investment to extract meaningful insights. We envisioned a system where anyone could easily extract geopolitical intelligence information. We wanted to democratize access to this information and empower individuals to foster a deeper understanding of the world around them. The rise of powerful language models and graph databases felt like the perfect combination to achieve this vision.

What it does

Open Intelligence Agent leverages ArangoDB and ArangoQL to extract data related to geopolitical intelligence. It then provides users with a summary of events and an interactive map, enabling them to navigate and explore the data geographically.

How we built it

We built Open Intelligence Agent using the Pydantic-AI framework due to its flexibility and ease of observability. We created custom tools for querying the ArangoDB graph database, validating extracted data, generating interactive maps, and ultimately generating PDF reports.

Stack

  • Pydantic AI framework for agent orchestration
  • Logfire of Observability
  • Streamlit for UI
  • Custom tools for executing python code, data validation, querying Agengo DB cloud server using nx-arangodb module

Challenges we ran into

One of the main challenges was fine-tuning the system prompts and validation tools to effectively traverse the graph database. Ensuring the accuracy and completeness of the information retrieved from the graph required careful prompt engineering and robust validation mechanisms.

  • Data Validation: Possibly the most criticla problem. Sometimes the query would return the result but because to incorrect filter used due to misinterpretation of the user query by the agent, the dataset will be empty. To solve this we designe a validation tool that check the dataset for completeness, if incomplete dataset the agent modifies the AQL query and retreives the dataset again

  • Natural Language Understanding: Accurately translating vague or ambiguous user queries into precise graph database queries was a significant challenge. We experimented with various prompt engineering techniques and fine-tuned our agent module to improve its ability to understand the nuances of natural language.

  • Data Visualization: Presenting complex information in a clear and intuitive way was crucial. Choosing the right chart types, map projections, and interactive elements was an iterative process that required careful consideration of user experience. We needed to balance detail with accessibility, ensuring that visualizations were both informative and easy to understand. In the end, we instructed the agent to use Folium library to plot the events in the interactive manner.

Accomplishments that we're proud of

We're particularly proud of the seamless integration of the toolset and the effective visualizations that bring the data to life. Creating a user-friendly experience while dealing with complex data structures was a significant achievement.

What we learned

We learned a great deal about graph databases, specifically ArangoDB, and how to effectively query them using ArangoQL. This included understanding the intricacies of graph schema design, query optimization techniques, and the nuances of navigating relationships between nodes.

What's next for Open Intelligence Agent

We have ambitious plans for the future of Open Intelligence Agent. Our next steps include:

  • Expanding the Dataset: We plan to integrate data from additional sources to provide a more comprehensive view of global events, including economic, social, and environmental data.
  • Improving Agent Accuracy: Continuously refine the agent module through training and feedback to improve its ability to understand complex queries and generate accurate results.
  • Enhancing Visualization Capabilities: Add new chart types, interactive features, and customization options to provide a richer and more engaging data exploration experience.
  • Adding User Authentication and Collaboration: Implement user accounts, allowing users to save their queries, share their analyses, and collaborate with others.
  • Implementing a Feedback Mechanism: Allow users to provide feedback on the accuracy and relevance of the results, helping us continuously improve the platform.

We believe that Open Intelligence Agent has the potential to become a valuable resource for anyone seeking to understand the complexities of our world. By combining the power of natural language processing, graph databases, and data visualization, we can democratize access to global event data and empower individuals to make more informed decisions.

Built With

  • arangodb
  • pydanticai
  • python
  • streamlit
Share this project:

Updates