Skip to content

feat: improve frontend API, Streamlit UI, FAISS store, and memory storage - #4

Merged
JMcCumberIO merged 1 commit into
mainfrom
claude/suggest-improvements-features-m0Klv
Feb 28, 2026
Merged

feat: improve frontend API, Streamlit UI, FAISS store, and memory storage#4
JMcCumberIO merged 1 commit into
mainfrom
claude/suggest-improvements-features-m0Klv

Conversation

@JMcCumberIO

Copy link
Copy Markdown
Owner

Frontend API (frontend_api_svc.py):

  • Add GET /projects/ endpoint to list all projects (newest-first)
  • Add DELETE /projects/{id}/ endpoint with guard against deleting running projects
  • Add GET /projects/{id}/metrics/ endpoint exposing prompt/completion token counts
    and a rough USD cost estimate per project
  • Add WebSocket /projects/{id}/ws endpoint for real-time streaming of status
    changes, captured logs, and agent messages to connected clients
  • Introduce TokenUsage model and _add_token_usage() helper; accumulate token
    usage during both mock and real MetaGPT runs
  • Structured JSON-line message logging via _write_message(); messages are
    broadcast over WebSocket in real time
  • Improve mock-mode simulation: per-agent-step token accounting and async delays
  • Health check now includes in-memory project count

Streamlit UI (metagpt_streamlit_ui.py):

  • Move all imports to the top of file (Optional/List/Dict were previously at
    the bottom, causing NameErrors on first use)
  • Replace all st.experimental_rerun() calls with st.rerun() (un-deprecated API)
  • Add sidebar project list with status icons and one-click project switching
  • Add one-click project deletion from sidebar
  • Expose the new /metrics/ endpoint as a Cost & Usage Metrics section
  • Expose optional project name input on project creation form
  • Add helper functions for list_projects and delete_project

FAISS store (faiss_store.py):

  • Fix FIXME: call self.persist() after insert_nodes() so added documents
    survive across sessions
  • Accept optional metadatas argument and propagate it to TextNode
  • Return list of inserted node IDs instead of an empty list

Memory storage (memory_storage.py):

  • Replace magic float threshold (0.1) with a configurable similarity_threshold
    parameter (default 0.5) and proper docstring explaining score semantics
  • Fix search_similar() to keep results whose score >= threshold (higher score =
    more relevant in llama_index) and respect the k limit
  • Guard against None scores from the retriever

https://claude.ai/code/session_01Vz63pW62BgvXDQXJiyeEXp

…rage

Frontend API (frontend_api_svc.py):
- Add GET /projects/ endpoint to list all projects (newest-first)
- Add DELETE /projects/{id}/ endpoint with guard against deleting running projects
- Add GET /projects/{id}/metrics/ endpoint exposing prompt/completion token counts
  and a rough USD cost estimate per project
- Add WebSocket /projects/{id}/ws endpoint for real-time streaming of status
  changes, captured logs, and agent messages to connected clients
- Introduce TokenUsage model and _add_token_usage() helper; accumulate token
  usage during both mock and real MetaGPT runs
- Structured JSON-line message logging via _write_message(); messages are
  broadcast over WebSocket in real time
- Improve mock-mode simulation: per-agent-step token accounting and async delays
- Health check now includes in-memory project count

Streamlit UI (metagpt_streamlit_ui.py):
- Move all imports to the top of file (Optional/List/Dict were previously at
  the bottom, causing NameErrors on first use)
- Replace all st.experimental_rerun() calls with st.rerun() (un-deprecated API)
- Add sidebar project list with status icons and one-click project switching
- Add one-click project deletion from sidebar
- Expose the new /metrics/ endpoint as a Cost & Usage Metrics section
- Expose optional project name input on project creation form
- Add helper functions for list_projects and delete_project

FAISS store (faiss_store.py):
- Fix FIXME: call self.persist() after insert_nodes() so added documents
  survive across sessions
- Accept optional metadatas argument and propagate it to TextNode
- Return list of inserted node IDs instead of an empty list

Memory storage (memory_storage.py):
- Replace magic float threshold (0.1) with a configurable similarity_threshold
  parameter (default 0.5) and proper docstring explaining score semantics
- Fix search_similar() to keep results whose score >= threshold (higher score =
  more relevant in llama_index) and respect the k limit
- Guard against None scores from the retriever

https://claude.ai/code/session_01Vz63pW62BgvXDQXJiyeEXp
@JMcCumberIO

Copy link
Copy Markdown
Owner Author

@copilot review this

Copilot AI commented Feb 28, 2026

Copy link
Copy Markdown

@JMcCumberIO I've opened a new pull request, #5, to work on those changes. Once the pull request is ready, I'll request review from you.

@JMcCumberIO
JMcCumberIO merged commit bb21df5 into main Feb 28, 2026
@JMcCumberIO
JMcCumberIO deleted the claude/suggest-improvements-features-m0Klv branch February 28, 2026 01:54
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants