Graphs
One of the common types of databases that we can build Q&A systems for are graph databases. LangChain comes with a number of built-in chains and agents that are compatible with graph query language dialects like Cypher, Neo4j, and MemGraph. They enable use cases such as:
- Generating queries that will be run based on natural language questions,
- Creating chatbots that can answer questions based on database data,
- Building custom dashboards based on insights a user wants to analyze,
and much more.
โ ๏ธ Security note โ ๏ธโ
Building Q&A systems of graph databases might require executing model-generated database queries. There are inherent risks in doing this. Make sure that your database connection permissions are always scoped as narrowly as possible for your chain/agentโs needs. This will mitigate though not eliminate the risks of building a model-driven system. For more on general security best practices, see here.
Employing database query templates within a semantic layer provides the advantage of bypassing the need for database query generation. This approach effectively eradicates security vulnerabilities linked to the generation of database queries.
Quickstartโ
Head to the Quickstart page to get started.
Advancedโ
Once youโve familiarized yourself with the basics, you can head to the advanced guides:
- Prompting strategies: Advanced prompt engineering techniques.
- Mapping values: Techniques for mapping values from questions to database.
- Semantic layer: Techniques for working implementing semantic layers.
- Constructing graphs: Techniques for constructing knowledge graphs.