Installation
Clone the repo and run ./launch.sh (Docker recommended for simplicity).
git clone https://github.com/scrypster/memento.git
cd memento
./launch.sh
Connect to AI Tool
After launch, the script outputs the MCP connection command (e.g., ollama serve memento://localhost:8080).
Configure your AI tool (e.g., Ollama, LocalAI) to use this endpoint.
First Use Case Start a conversation with your AI tool. Memento automatically:
Verify: Query the graph via Memento’s built-in CLI:
./memento query "MATCH (n) RETURN n LIMIT 10"
AI Integration
ollama serve memento://localhost:8080 --model llama3
supervisor or laravel-horizon).Graph Querying
./memento query "MATCH (a:Person)-[:OWNS]->(p:Project) RETURN a.name, p.name"
8080):
$response = Http::post('http://localhost:8080/api/query', [
'query' => 'MATCH (n) RETURN n LIMIT 5'
]);
$results = $response->json();
docs/ws.md).Data Ingestion
Http::post('http://localhost:8080/api/ingest', [
'nodes' => [['label' => 'Person', 'properties' => ['name' => 'Alice']]],
'relationships' => [['type' => 'OWNS', 'from' => 1, 'to' => 2]]
]);
Contextual Prompting
{{context}} placeholder in prompts to auto-include relevant graph data:
"You are an assistant with access to my knowledge graph. Here’s what you know so far: {{context}}"
$prompt = "Analyze the following data: " . $this->getContextFromMemento();
docker-compose.yml for local development. Mount a volume to persist the Neo4j database:
volumes:
- ./data/neo4j:/var/lib/neo4j/data
./memento export).API_ENABLED=false in .env (see docs/security.md).Neo4j Performance
neo4j.conf):
CREATE INDEX FOR (p:Person) ON (p.name);
$cacheKey = 'memento_query_' . md5($query);
return Cache::remember($cacheKey, 3600, fn() => Http::post('...')->json());
MCP Connection Drops
Http::ping('http://localhost:8080/health');
Data Duplication
deduplicate: true flag in the MCP config (see config/mcp.json).Port Conflicts
8080 for API, 7687 for Bolt) may clash..env:
MCP_PORT=9090
NEO4J_BOLT_PORT=7688
logs/memento.log for errors. Enable debug mode:
./launch.sh --debug
http://localhost:7474) to manually query the graph.curl -X POST http://localhost:8080/api/health
Custom Node Labels
Extend the graph schema by defining new labels in config/schema.json:
{
"labels": ["Person", "Project", "CustomLabel"],
"relationships": ["OWNS", "WORKS_ON", "NEW_RELATION"]
}
Restart Memento to apply changes.
Plugin System
Memento supports Go plugins. Example: Add a laravel-sync plugin to auto-push graph changes to a Laravel database:
// plugins/laravel_sync/plugin.go
package main
func init() {
memento.RegisterPlugin(&LaravelSyncPlugin{})
}
See docs/plugins.md for the interface.
Prompt Templates
Override default templates in config/prompts/ to customize how context is injected into AI responses.
Backup/Restore Use Neo4j’s built-in backup tools to migrate graphs between instances:
./memento backup --output ./backup.dump
./memento restore --input ./backup.dump
How can I help you explore Laravel packages today?