| import gradio as gr | |
| from utility import chat, populate_memory, search_memory | |
| with gr.Blocks(title="Central Memory") as app: | |
| gr.ChatInterface( | |
| fn=chat, | |
| title="Central Memory ChatBot", | |
| examples=[ | |
| "Remember that my favorite color is blue", | |
| "Store this: I'm learning Rust to make an OS", | |
| "Search the memorie about learning rust", | |
| ], | |
| api_visibility="private", | |
| ) | |
| gr.api(populate_memory.func) | |
| gr.api(search_memory.func) | |
| gr.Markdown("""--- | |
| **Note:** `search_memory` using agentic retrieval. This application exposes all tools as MCP endpoints. | |
| Connect your MCP client to this server to access the `populate_memory` and `search_memory` tools. | |
| """) | |
| app.launch(mcp_server=True, share=False, theme=gr.themes.Soft()) | |